From d5385be436aaa81678f2b38153c187427b36959d Mon Sep 17 00:00:00 2001 From: Michael Stingl Date: Mon, 8 Jun 2026 01:27:44 +0200 Subject: [PATCH] test(acceptance): assert COPY and MOVE preserve the source mtime No acceptance scenario checked the mtime after a WebDAV COPY or MOVE. mtime is covered on the upload path (coreApiWebdavUploadTUS/uploadFileMtime.feature) but not on the server-side copy and move operations, which is why the COPY mtime bug in #2378 surfaced only through rclone's external integration tests. Add copyFileMtime.feature and moveFileMtime.feature, built from existing steps: upload a file with a known mtime, copy or move it (to a sibling name and into a folder), then assert the destination keeps the mtime, across the old, new and spaces DAV paths. The fix shipped in https://github.com/opencloud-eu/reva/pull/535; this adds the missing regression coverage. --- .../copyFileMtime.feature | 32 +++++++++++++++++++ .../coreApiWebdavMove/moveFileMtime.feature | 32 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 tests/acceptance/features/coreApiWebdavCopyCreate/copyFileMtime.feature create mode 100644 tests/acceptance/features/coreApiWebdavMove/moveFileMtime.feature diff --git a/tests/acceptance/features/coreApiWebdavCopyCreate/copyFileMtime.feature b/tests/acceptance/features/coreApiWebdavCopyCreate/copyFileMtime.feature new file mode 100644 index 0000000000..69fd8dae49 --- /dev/null +++ b/tests/acceptance/features/coreApiWebdavCopyCreate/copyFileMtime.feature @@ -0,0 +1,32 @@ +Feature: copy file + As a user + I want the mtime of a file to be preserved when it is copied + So that a copy keeps the original modification date + + Background: + Given user "Alice" has been created with default attributes + + @issue-2378 + Scenario Outline: copying a file preserves the mtime + Given using DAV path + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol + When user "Alice" copies file "file.txt" to "textfile_copy.txt" using the WebDAV API + Then as "Alice" the mtime of the file "textfile_copy.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT" + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @issue-2378 + Scenario Outline: copying a file into a folder preserves the mtime + Given using DAV path + And user "Alice" has created folder "testFolder" + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol + When user "Alice" copies file "file.txt" to "/testFolder/file.txt" using the WebDAV API + Then as "Alice" the mtime of the file "/testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT" + Examples: + | dav-path-version | + | old | + | new | + | spaces | diff --git a/tests/acceptance/features/coreApiWebdavMove/moveFileMtime.feature b/tests/acceptance/features/coreApiWebdavMove/moveFileMtime.feature new file mode 100644 index 0000000000..c76ff75377 --- /dev/null +++ b/tests/acceptance/features/coreApiWebdavMove/moveFileMtime.feature @@ -0,0 +1,32 @@ +Feature: move file + As a user + I want the mtime of a file to be preserved when it is moved + So that a moved file keeps its original modification date + + Background: + Given user "Alice" has been created with default attributes + + @issue-2378 + Scenario Outline: moving a file preserves the mtime + Given using DAV path + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol + When user "Alice" moves file "file.txt" to "renamed.txt" using the WebDAV API + Then as "Alice" the mtime of the file "renamed.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT" + Examples: + | dav-path-version | + | old | + | new | + | spaces | + + @issue-2378 + Scenario Outline: moving a file into a folder preserves the mtime + Given using DAV path + And user "Alice" has created folder "testFolder" + And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "file.txt" with mtime "Thu, 08 Aug 2019 04:18:13 GMT" using the TUS protocol + When user "Alice" moves file "file.txt" to "/testFolder/file.txt" using the WebDAV API + Then as "Alice" the mtime of the file "/testFolder/file.txt" should be "Thu, 08 Aug 2019 04:18:13 GMT" + Examples: + | dav-path-version | + | old | + | new | + | spaces |