Merge pull request #11593 from owncloud/tests/resume-specific-file
[tests-only][full-ci] add tests for resume upload sessions of a single file using cli
This commit is contained in:
8 files changed
+34
-11
No files matched your search
@@ -397,14 +397,16 @@ class CliContext implements Context {
|
||||
}
|
||||
|
||||
/**
|
||||
* @When the administrator restarts the upload sessions of file :file
|
||||
* @When /^the administrator (restarts|resumes) the upload session of file "([^"]*)" using the CLI$/
|
||||
*
|
||||
* @param string $flag
|
||||
* @param string $file
|
||||
*
|
||||
* @return void
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function theAdministratorRestartsUploadSessionsOfFile(string $file): void {
|
||||
public function theAdministratorResumesOrRestartsUploadSessionOfFileUsingTheCLI(string $flag, string $file): void {
|
||||
$flag = rtrim($flag, "s");
|
||||
$response = CliHelper::runCommand(["command" => "storage-users uploads sessions --json"]);
|
||||
$this->featureContext->theHTTPStatusCodeShouldBe(200, '', $response);
|
||||
$responseArray = $this->getJSONDecodedCliMessage($response);
|
||||
@@ -415,7 +417,7 @@ class CliContext implements Context {
|
||||
}
|
||||
}
|
||||
|
||||
$command = "storage-users uploads sessions --id=$uploadId --restart --json";
|
||||
$command = "storage-users uploads sessions --id=$uploadId --$flag --json";
|
||||
$body = [
|
||||
"command" => $command,
|
||||
];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@env-config
|
||||
Feature: create auth-app token
|
||||
As an admin
|
||||
As an administrator
|
||||
I want to create auth-app Tokens
|
||||
So that I can use 3rd party apps
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@env-config
|
||||
Feature: backup consistency
|
||||
As a user
|
||||
As an administrator
|
||||
I want to check my data for inconsistencies
|
||||
So that I can backup my data
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@env-config @email
|
||||
Feature: get grouped email notification
|
||||
As a user
|
||||
As an administrator
|
||||
I want to get email notification of grouped events related to me either daily or weekly
|
||||
So that I can stay updated about the events either once a day or once a week
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@env-config
|
||||
Feature: reindex space via CLI command
|
||||
As an admin
|
||||
As an administrator
|
||||
I want to reindex space
|
||||
So that I can improve search performance by ensuring that the index is up-to-date
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@env-config @cli-stale-uploads
|
||||
Feature: stale upload via CLI command
|
||||
As a user
|
||||
As an administrator
|
||||
I want to manage stale uploads
|
||||
So that I clean up stale uploads from storage
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@env-config
|
||||
Feature: trashbin
|
||||
As a administrator
|
||||
As an administrator
|
||||
I want to manage trash-bin
|
||||
So that I can manage handle trashed resources efficiently
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
@env-config @cli-uploads-sessions
|
||||
Feature: List upload sessions via CLI command
|
||||
As a user
|
||||
As an administrator
|
||||
I want to list the upload sessions
|
||||
So that I can manage the upload sessions
|
||||
|
||||
@@ -106,7 +106,7 @@ Feature: List upload sessions via CLI command
|
||||
When the administrator waits for "3" seconds
|
||||
Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
|
||||
And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
|
||||
When the administrator restarts the upload sessions of file "file1.txt"
|
||||
When the administrator restarts the upload session of file "file1.txt" using the CLI
|
||||
Then the command should be successful
|
||||
And the CLI response should contain these entries:
|
||||
| file1.txt |
|
||||
@@ -179,6 +179,27 @@ Feature: List upload sessions via CLI command
|
||||
Then the content of file "file.txt" for user "Alice" should be "upload content"
|
||||
|
||||
|
||||
Scenario: resume upload session of a single file
|
||||
Given the config "POSTPROCESSING_DELAY" has been set to "3s"
|
||||
And user "Alice" has uploaded file with content "uploaded content" to "file1.txt"
|
||||
And user "Alice" has uploaded file with content "uploaded content" to "file2.txt"
|
||||
And the administrator has waited for "1" seconds
|
||||
And the administrator has stopped the server
|
||||
And the administrator has started the server
|
||||
When the administrator waits for "3" seconds
|
||||
Then for user "Alice" file "file1.txt" of space "Personal" should be in postprocessing
|
||||
And for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
|
||||
When the administrator resumes the upload session of file "file1.txt" using the CLI
|
||||
Then the command should be successful
|
||||
And the CLI response should contain these entries:
|
||||
| file1.txt |
|
||||
And the CLI response should not contain these entries:
|
||||
| file2.txt |
|
||||
When the administrator waits for "3" seconds
|
||||
Then for user "Alice" file "file2.txt" of space "Personal" should be in postprocessing
|
||||
And the content of file "file1.txt" for user "Alice" should be "uploaded content"
|
||||
|
||||
|
||||
Scenario: restart expired upload sessions
|
||||
Given a file "large.zip" with the size of "2GB" has been created locally
|
||||
And the config "STORAGE_USERS_UPLOAD_EXPIRATION" has been set to "1"
|
||||
|
||||
Reference in new issue
Block a user