summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-03-07 20:55:49 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-03-07 21:20:13 +0100
commit7301b43eb6a806f62897223db57f9ff51cb1afb5 (patch)
tree65c858aebc8639dd93cc2df08fce8242a500533e /build
parente08f98075cff2087daba94cce1fb7e48e9d3c3ad (diff)
downloadnextcloud-server-7301b43eb6a806f62897223db57f9ff51cb1afb5.tar.gz
nextcloud-server-7301b43eb6a806f62897223db57f9ff51cb1afb5.zip
Added tests
* Unit tests for OC_Filechunking to verify the isComplete function * Intergration tests to show that shuffling chunks is all fine
Diffstat (limited to 'build')
-rw-r--r--build/integration/features/bootstrap/WebDav.php11
-rw-r--r--build/integration/features/webdav-related.feature27
2 files changed, 38 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php
index fa6761d9f71..0430768022c 100644
--- a/build/integration/features/bootstrap/WebDav.php
+++ b/build/integration/features/bootstrap/WebDav.php
@@ -262,5 +262,16 @@ trait WebDav {
}
}
+ /**
+ * @Given user :user uploads chunk file :num of :total with :data to :destination
+ */
+ public function userUploadsChunkFileOfWithToWithChecksum($user, $num, $total, $data, $destination)
+ {
+ $num -= 1;
+ $data = \GuzzleHttp\Stream\Stream::factory($data);
+ $file = $destination . '-chunking-42-'.$total.'-'.$num;
+ $this->makeDavRequest($user, 'PUT', $file, ['OC-Chunked' => '1'], $data);
+ }
+
}
diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature
index 63f205d1e4c..019df3436f8 100644
--- a/build/integration/features/webdav-related.feature
+++ b/build/integration/features/webdav-related.feature
@@ -141,3 +141,30 @@ Feature: webdav-related
Given Logging in using web as "admin"
When Sending a "PROPFIND" to "/remote.php/webdav/welcome.txt" with requesttoken
Then the HTTP status code should be "207"
+
+ Scenario: Upload chunked file asc
+ Given user "user0" exists
+ And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
+ And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
+ And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
+ When As an "user0"
+ And Downloading file "/myChunkedFile.txt"
+ Then Downloaded content should be "AAAAABBBBBCCCCC"
+
+ Scenario: Upload chunked file desc
+ Given user "user0" exists
+ And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
+ And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
+ And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
+ When As an "user0"
+ And Downloading file "/myChunkedFile.txt"
+ Then Downloaded content should be "AAAAABBBBBCCCCC"
+
+ Scenario: Upload chunked file random
+ Given user "user0" exists
+ And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChunkedFile.txt"
+ And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChunkedFile.txt"
+ And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChunkedFile.txt"
+ When As an "user0"
+ And Downloading file "/myChunkedFile.txt"
+ Then Downloaded content should be "AAAAABBBBBCCCCC"