Browse Source

Add integration tests for length header on new chunking

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
tags/v13.0.0beta4
Thomas Müller 6 years ago
parent
commit
74df27b7a7

+ 17
- 0
build/integration/features/bootstrap/WebDav.php View File

@@ -595,6 +595,23 @@ trait WebDav {
], null, "uploads");
}

/**
* @Then user :user moves new chunk file with id :id to :dest with size :size
*/
public function userMovesNewChunkFileWithIdToMychunkedfileWithSize($user, $id, $dest, $size)
{
$source = '/uploads/' . $user . '/' . $id . '/.file';
$destination = substr($this->baseUrl, 0, -4) . $this->getDavFilesPath($user) . $dest;

try {
$this->response = $this->makeDavRequest($user, 'MOVE', $source, [
'Destination' => $destination,
'OC-Total-Length' => $size
], null, "uploads");
} catch(\GuzzleHttp\Exception\BadResponseException $ex) {
$this->response = $ex->getResponse();
}
}

/**
* @Given /^Downloading file "([^"]*)" as "([^"]*)"$/

+ 20
- 0
build/integration/features/webdav-related.feature View File

@@ -578,3 +578,23 @@ Feature: webdav-related
And user "user0" created a folder "/testshare"
When User "user0" moves folder "/testshare" to "/hola%5Chola"
Then the HTTP status code should be "400"

Scenario: Upload file via new chunking endpoint with wrong size header
Given using new dav path
And user "user0" exists
And user "user0" creates a new chunking upload with id "chunking-42"
And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 5
Then the HTTP status code should be "400"

Scenario: Upload file via new chunking endpoint with correct size header
Given using new dav path
And user "user0" exists
And user "user0" creates a new chunking upload with id "chunking-42"
And user "user0" uploads new chunk file "1" with "AAAAA" to id "chunking-42"
And user "user0" uploads new chunk file "2" with "BBBBB" to id "chunking-42"
And user "user0" uploads new chunk file "3" with "CCCCC" to id "chunking-42"
When user "user0" moves new chunk file with id "chunking-42" to "/myChunkedFile.txt" with size 15
Then the HTTP status code should be "201"

Loading…
Cancel
Save