From d5f7f233ddae79ba226a2ad4bdc705b85c5171b0 Mon Sep 17 00:00:00 2001 From: Prajwol Amatya Date: Mon, 12 May 2025 16:13:55 +0545 Subject: [PATCH] resume all uploads sessions --- tests/acceptance/bootstrap/CliContext.php | 14 ++++++++++++++ .../expected-failures-localAPI-on-OCIS-storage.md | 4 ++++ .../features/cliCommands/uploadSessions.feature | 11 +++++++++++ 3 files changed, 29 insertions(+) diff --git a/tests/acceptance/bootstrap/CliContext.php b/tests/acceptance/bootstrap/CliContext.php index cf91ec8c207..cb77d41cfb6 100644 --- a/tests/acceptance/bootstrap/CliContext.php +++ b/tests/acceptance/bootstrap/CliContext.php @@ -917,4 +917,18 @@ class CliContext implements Context { ]; $this->featureContext->setResponse(CliHelper::runCommand($body)); } + + /** + * @When the administrator resumes all the upload sessions using the CLI + * + * @return void + * @throws GuzzleException + */ + public function theAdministratorResumesAllTheUploadSessionsUsingTheCLI(): void { + $command = "storage-users uploads sessions --resume --json"; + $body = [ + "command" => $command + ]; + $this->featureContext->setResponse(CliHelper::runCommand($body)); + } } diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 0a1f613d8b7..a20f3db6f67 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -392,5 +392,9 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSharingNgDriveLinkShare/createInternalLinkShare.feature:339](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNgDriveLinkShare/createInternalLinkShare.feature#L339) +#### [[CLI] Error while resuming an upload](https://github.com/owncloud/ocis/issues/11290) + +- [cliCommands/uploadSessions.feature:156](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/cliCommands/uploadSessions.feature#L156) + Note: always have an empty line at the end of this file. The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/cliCommands/uploadSessions.feature b/tests/acceptance/features/cliCommands/uploadSessions.feature index 46c936bf104..50913b1d4a2 100644 --- a/tests/acceptance/features/cliCommands/uploadSessions.feature +++ b/tests/acceptance/features/cliCommands/uploadSessions.feature @@ -151,3 +151,14 @@ Feature: List upload sessions via CLI command And the CLI response should not contain these entries: | file1.txt | | virusFile.txt | + + @issue-11290 + Scenario: resume all upload sessions + Given the config "POSTPROCESSING_DELAY" has been set to "10s" + And user "Alice" has uploaded file with content "upload content" to "file.txt" + And the administrator has stopped the server + And the administrator has started the server + When the administrator resumes all the upload sessions using the CLI + Then the command should be successful + And the CLI response should contain these entries: + | file.txt |