aboutsummaryrefslogtreecommitdiffstats
path: root/build/integration
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-02-21 07:36:43 +0100
committerGitHub <noreply@github.com>2023-02-21 07:36:43 +0100
commit98ed72b3ed7e81a75d9a323c70a5e7f5af265a23 (patch)
treea92d3ab78f2fa52969139448a8aa7c509ed97af5 /build/integration
parent93e703bbfc7c8ef654b7b0185474397ec1bbaa6b (diff)
downloadnextcloud-server-98ed72b3ed7e81a75d9a323c70a5e7f5af265a23.tar.gz
nextcloud-server-98ed72b3ed7e81a75d9a323c70a5e7f5af265a23.zip
Revert "fix(performance): Do not set up filesystem on every call"
Diffstat (limited to 'build/integration')
-rw-r--r--build/integration/features/bootstrap/ChecksumsContext.php27
-rw-r--r--build/integration/features/checksums.feature16
-rw-r--r--build/integration/features/webdav-related.feature27
3 files changed, 70 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/ChecksumsContext.php b/build/integration/features/bootstrap/ChecksumsContext.php
index f45bbf5e94f..ae44fcb1503 100644
--- a/build/integration/features/bootstrap/ChecksumsContext.php
+++ b/build/integration/features/bootstrap/ChecksumsContext.php
@@ -231,4 +231,31 @@ class ChecksumsContext implements \Behat\Behat\Context\Context {
throw new \Exception("Expected no checksum header but got ".$this->response->getHeader('OC-Checksum')[0]);
}
}
+
+ /**
+ * @Given user :user uploads chunk file :num of :total with :data to :destination with checksum :checksum
+ * @param string $user
+ * @param int $num
+ * @param int $total
+ * @param string $data
+ * @param string $destination
+ * @param string $checksum
+ */
+ public function userUploadsChunkFileOfWithToWithChecksum($user, $num, $total, $data, $destination, $checksum) {
+ $num -= 1;
+ $this->response = $this->client->put(
+ $this->baseUrl . '/remote.php/webdav' . $destination . '-chunking-42-'.$total.'-'.$num,
+ [
+ 'auth' => [
+ $user,
+ $this->getPasswordForUser($user)
+ ],
+ 'body' => $data,
+ 'headers' => [
+ 'OC-Checksum' => $checksum,
+ 'OC-Chunked' => '1',
+ ]
+ ]
+ );
+ }
}
diff --git a/build/integration/features/checksums.feature b/build/integration/features/checksums.feature
index fe6fb505315..d391e93afe8 100644
--- a/build/integration/features/checksums.feature
+++ b/build/integration/features/checksums.feature
@@ -58,3 +58,19 @@ Feature: checksums
When user "user0" uploads file "data/textfile.txt" to "/myChecksumFile.txt"
And user "user0" downloads the file "/myChecksumFile.txt"
Then The OC-Checksum header should not be there
+
+ Scenario: Uploading a chunked file with checksum should return the checksum in the propfind
+ Given user "user0" exists
+ And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
+ And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
+ And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
+ When user "user0" request the checksum of "/myChecksumFile.txt" via propfind
+ Then The webdav checksum should match "MD5:e892fdd61a74bc89cd05673cc2e22f88"
+
+ Scenario: Uploading a chunked file with checksum should return the checksum in the download header
+ Given user "user0" exists
+ And user "user0" uploads chunk file "1" of "3" with "AAAAA" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
+ And user "user0" uploads chunk file "2" of "3" with "BBBBB" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
+ And user "user0" uploads chunk file "3" of "3" with "CCCCC" to "/myChecksumFile.txt" with checksum "MD5:e892fdd61a74bc89cd05673cc2e22f88"
+ When user "user0" downloads the file "/myChecksumFile.txt"
+ Then The header checksum should match "MD5:e892fdd61a74bc89cd05673cc2e22f88"
diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature
index 446a4ee5a49..21e195af115 100644
--- a/build/integration/features/webdav-related.feature
+++ b/build/integration/features/webdav-related.feature
@@ -277,6 +277,33 @@ Feature: webdav-related
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"
+
Scenario: A file that is not shared does not have a share-types property
Given user "user0" exists
And user "user0" created a folder "/test"