From d2a05716753cc9297fa38e88a43e39dec71f3b40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Wed, 8 Mar 2023 16:28:44 +0100 Subject: [PATCH] tests(integration): Fix catching error only on object store MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- build/integration/features/bootstrap/WebDav.php | 16 ++++++++++++++++ .../integration/features/webdav-related.feature | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 00ba5c28862..9c81a5817b4 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -1078,4 +1078,20 @@ trait WebDav { public function theSmultipartUploadWasSuccessful($status) { Assert::assertEquals((int)$status, $this->response->getStatusCode()); } + + /** + * @Then /^the upload should fail on object storage$/ + */ + public function theUploadShouldFailOnObjectStorage() { + $descriptor = [ + 0 => ['pipe', 'r'], + 1 => ['pipe', 'w'], + 2 => ['pipe', 'w'], + ]; + $process = proc_open('php occ config:system:get objectstore --no-ansi', $descriptor, $pipes, '../../'); + $lastCode = proc_close($process); + if ($lastCode === 0) { + $this->theHTTPStatusCodeShouldBe(500); + } + } } diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature index f63ee24527f..28a0cad619b 100644 --- a/build/integration/features/webdav-related.feature +++ b/build/integration/features/webdav-related.feature @@ -694,7 +694,7 @@ Feature: webdav-related And user "user0" uploads new chunk v2 file "2" to id "chunking-random" And user "user0" uploads new chunk v2 file "4" to id "chunking-random" And user "user0" moves new chunk v2 file with id "chunking-random" - Then the HTTP status code should be "500" + Then the upload should fail on object storage @s3-multipart Scenario: Upload chunked file with special characters with new chunking v2 -- 2.39.5