From ded54d7a1a8d63781a972b88c8467b5984414193 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Fri, 21 Jun 2024 12:47:00 +0545 Subject: [PATCH] Adjusted test as .htaccess is not banned file --- .../expected-failures-API-on-OCIS-storage.md | 9 ---- .../coreApiWebdavMove1/moveFolder.feature | 42 ++++++++++++------- .../moveFolderToBlacklistedName.feature | 26 ------------ .../coreApiWebdavMove2/moveFile.feature | 42 ++++++++++++------- .../moveFileToBlacklistedName.feature | 24 ----------- 5 files changed, 56 insertions(+), 87 deletions(-) delete mode 100644 tests/acceptance/features/coreApiWebdavMove1/moveFolderToBlacklistedName.feature delete mode 100644 tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index e2b862677..179faf92c 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -224,14 +224,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [coreApiWebdavMove2/moveFile.feature:218](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L218) - [coreApiWebdavMove2/moveFile.feature:223](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L223) -#### [cannot set blacklisted file names](https://github.com/owncloud/product/issues/260) - -- [coreApiWebdavMove1/moveFolderToBlacklistedName.feature:20](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolderToBlacklistedName.feature#L20) -- [coreApiWebdavMove1/moveFolderToBlacklistedName.feature:21](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolderToBlacklistedName.feature#L21) -- [coreApiWebdavMove1/moveFolderToBlacklistedName.feature:26](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolderToBlacklistedName.feature#L26) -- [coreApiWebdavMove2/moveFileToBlacklistedName.feature:18](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature#L18) -- [coreApiWebdavMove2/moveFileToBlacklistedName.feature:19](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature#L19) - #### [Share path in the response is different between share states](https://github.com/owncloud/ocis/issues/2540) - [coreApiShareManagementToShares/acceptShares.feature:28](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiShareManagementToShares/acceptShares.feature#L28) @@ -248,7 +240,6 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [coreApiWebdavMove1/moveFolder.feature:62](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L62) - [coreApiWebdavMove1/moveFolder.feature:80](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L80) - [coreApiWebdavMove2/moveFile.feature:179](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L179) -- [coreApiWebdavMove2/moveFileToBlacklistedName.feature:24](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature#L24) #### [REPORT method on spaces returns an incorrect d:href response](https://github.com/owncloud/ocis/issues/3111) diff --git a/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature b/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature index fe4af64bc..8b973faac 100644 --- a/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature +++ b/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature @@ -177,28 +177,28 @@ Feature: move (rename) folder | dav-path-version | from-folder-name | to-folder-name | | old | "testFolder" | "'single'quotes" | | old | "testFolder" | '"double"quotes' | - | old | "testFolder" | "strängé नेपाली folder" | + | old | "testFolder" | "strängé नेपाली folder" | | old | "testFolder" | "$%#?&@" | | old | "testFolder" | "Sample,Folder,With,Comma" | | old | "testFolder" | " start with space" | | old | "testFolder" | "renamed.part" | | old | "'single'quotes" | "testFolder" | | old | '"double"quotes' | "testFolder" | - | old | "strängé नेपाली folder" | "testFolder" | + | old | "strängé नेपाली folder" | "testFolder" | | old | "$%#?&@" | "testFolder" | | old | "Sample,Folder,With,Comma" | "testFolder" | | old | " start with space" | "testFolder" | | old | "renamed.part" | "testFolder" | | new | "testFolder" | "'single'quotes" | | new | "testFolder" | '"double"quotes' | - | new | "testFolder" | "strängé नेपाली folder" | + | new | "testFolder" | "strängé नेपाली folder" | | new | "testFolder" | "$%#?&@" | | new | "testFolder" | "Sample,Folder,With,Comma" | | new | "testFolder" | " start with space" | | new | "testFolder" | "renamed.part" | | new | "'single'quotes" | "testFolder" | | new | '"double"quotes' | "testFolder" | - | new | "strängé नेपाली folder" | "testFolder" | + | new | "strängé नेपाली folder" | "testFolder" | | new | "$%#?&@" | "testFolder" | | new | "Sample,Folder,With,Comma" | "testFolder" | | new | " start with space" | "testFolder" | @@ -209,14 +209,14 @@ Feature: move (rename) folder | dav-path-version | from-folder-name | to-folder-name | | spaces | "testFolder" | "'single'quotes" | | spaces | "testFolder" | '"double"quotes' | - | spaces | "testFolder" | "strängé नेपाली folder" | + | spaces | "testFolder" | "strängé नेपाली folder" | | spaces | "testFolder" | "$%#?&@" | | spaces | "testFolder" | "Sample,Folder,With,Comma" | | spaces | "testFolder" | " start with space" | | spaces | "testFolder" | "renamed.part" | | spaces | "'single'quotes" | "testFolder" | | spaces | '"double"quotes' | "testFolder" | - | spaces | "strängé नेपाली folder" | "testFolder" | + | spaces | "strängé नेपाली folder" | "testFolder" | | spaces | "$%#?&@" | "testFolder" | | spaces | "Sample,Folder,With,Comma" | "testFolder" | | spaces | " start with space" | "testFolder" | @@ -287,14 +287,28 @@ Feature: move (rename) folder When user "Alice" moves folder "testFolder" to "" using the WebDAV API Then the HTTP status code should be "" Examples: - | dav-path-version | folder-name | http-status-code | - | old | /. | 409 | - | old | /.. | 404 | - | new | /. | 409 | - | new | /.. | 404 | + | dav-path-version | folder-name | http-status-code | + | old | /. | 409 | + | old | /.. | 404 | + | new | /. | 409 | + | new | /.. | 404 | @skipOnRevaMaster Examples: - | dav-path-version | folder-name | http-status-code | - | spaces | /. | 409 | - | spaces | /.. | 400 | \ No newline at end of file + | dav-path-version | folder-name | http-status-code | + | spaces | /. | 409 | + | spaces | /.. | 400 | + + + Scenario Outline: rename a folder to .htaccess + Given using DAV path + And user "Alice" has created folder "/testshare" + When user "Alice" moves folder "/testshare" to "/.htaccess" using the WebDAV API + Then the HTTP status code should be "201" + And user "Alice" should see the following elements + | /.htaccess/ | + Examples: + | dav-path-version | + | old | + | new | + | spaces | diff --git a/tests/acceptance/features/coreApiWebdavMove1/moveFolderToBlacklistedName.feature b/tests/acceptance/features/coreApiWebdavMove1/moveFolderToBlacklistedName.feature deleted file mode 100644 index 031df92e7..000000000 --- a/tests/acceptance/features/coreApiWebdavMove1/moveFolderToBlacklistedName.feature +++ /dev/null @@ -1,26 +0,0 @@ -Feature: users cannot move (rename) a folder to a blacklisted name - As an administrator - I want to be able to prevent users from moving (renaming) folders to specified names - So that I can prevent unwanted folder names existing in the cloud storage - - Background: - Given using OCS API version "1" - And user "Alice" has been created with default attributes and without skeleton files - - - Scenario Outline: rename a folder to a name that is banned by default - Given using DAV path - And user "Alice" has created folder "/testshare" - When user "Alice" moves folder "/testshare" to "/.htaccess" using the WebDAV API - Then the HTTP status code should be "403" - And user "Alice" should see the following elements - | /testshare/ | - Examples: - | dav-path-version | - | old | - | new | - - @skipOnRevaMaster - Examples: - | dav-path-version | - | spaces | diff --git a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature index f38da3783..6bb6b2e69 100644 --- a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature +++ b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature @@ -521,22 +521,22 @@ Feature: move (rename) file | dav-path-version | from-file-name | to-file-name | | old | "testfile.txt" | "'single'quotes.txt" | | old | "testfile.txt" | '"double"quotes.txt' | - | old | "testfile.txt" | "strängé नेपाली.txt" | + | old | "testfile.txt" | "strängé नेपाली.txt" | | old | "testfile.txt" | "file,comma.txt" | | old | "testfile.txt" | " start with space.txt" | | old | "'single'quotes.txt" | "testfile.txt" | | old | '"double"quotes.txt' | "testfile.txt" | - | old | "strängé नेपाली.txt" | "testfile.txt" | + | old | "strängé नेपाली.txt" | "testfile.txt" | | old | "file,comma.txt" | "testfile.txt" | | old | " start with space.txt" | "testfile.txt" | | new | "testfile.txt" | "'single'quotes.txt" | | new | "testfile.txt" | '"double"quotes.txt' | - | new | "testfile.txt" | "strängé नेपाली.txt" | + | new | "testfile.txt" | "strängé नेपाली.txt" | | new | "testfile.txt" | "file,comma.txt" | | new | "testfile.txt" | " start with space.txt" | | new | "'single'quotes.txt" | "testfile.txt" | | new | '"double"quotes.txt' | "testfile.txt" | - | new | "strängé नेपाली.txt" | "testfile.txt" | + | new | "strängé नेपाली.txt" | "testfile.txt" | | new | "file,comma.txt" | "testfile.txt" | | new | " start with space.txt" | "testfile.txt" | @@ -545,12 +545,12 @@ Feature: move (rename) file | dav-path-version | from-file-name | to-file-name | | spaces | "testfile.txt" | "'single'quotes.txt" | | spaces | "testfile.txt" | '"double"quotes.txt' | - | spaces | "testfile.txt" | "strängé नेपाली.txt" | + | spaces | "testfile.txt" | "strängé नेपाली.txt" | | spaces | "testfile.txt" | "file,comma.txt" | | spaces | "testfile.txt" | " start with space.txt" | | spaces | "'single'quotes.txt" | "testfile.txt" | | spaces | '"double"quotes.txt' | "testfile.txt" | - | spaces | "strängé नेपाली.txt" | "testfile.txt" | + | spaces | "strängé नेपाली.txt" | "testfile.txt" | | spaces | "file,comma.txt" | "testfile.txt" | | spaces | " start with space.txt" | "testfile.txt" | @@ -580,14 +580,28 @@ Feature: move (rename) file When user "Alice" moves file "testfile.txt" to "" using the WebDAV API Then the HTTP status code should be "" Examples: - | dav-path-version | file-name | http-status-code | - | old | /. | 409 | - | old | /.. | 404 | - | new | /. | 409 | - | new | /.. | 404 | + | dav-path-version | file-name | http-status-code | + | old | /. | 409 | + | old | /.. | 404 | + | new | /. | 409 | + | new | /.. | 404 | @skipOnRevaMaster Examples: - | dav-path-version | file-name | http-status-code | - | spaces | /. | 409 | - | spaces | /.. | 400 | + | dav-path-version | file-name | http-status-code | + | spaces | /. | 409 | + | spaces | /.. | 400 | + + + Scenario Outline: rename a file to .htaccess + Given using DAV path + And user "Alice" has uploaded file with content "ownCloud test text file 0" to "textfile0.txt" + When user "Alice" moves file "/textfile0.txt" to "/.htaccess" using the WebDAV API + Then the HTTP status code should be "201" + And user "Alice" should see the following elements + | .htaccess | + Examples: + | dav-path-version | + | old | + | new | + | spaces | diff --git a/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature b/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature deleted file mode 100644 index 04b72ec8f..000000000 --- a/tests/acceptance/features/coreApiWebdavMove2/moveFileToBlacklistedName.feature +++ /dev/null @@ -1,24 +0,0 @@ -Feature: users cannot move (rename) a file to a blacklisted name - As an administrator - I want to be able to prevent users from moving (renaming) files to specified file names - So that I can prevent unwanted file names existing in the cloud storage - - Background: - Given using OCS API version "1" - And user "Alice" has been created with default attributes and without skeleton files - And user "Alice" has uploaded file with content "ownCloud test text file 0" to "textfile0.txt" - - @issue-1295 - Scenario Outline: rename a file to a filename that is banned by default - Given using DAV path - When user "Alice" moves file "/textfile0.txt" to "/.htaccess" using the WebDAV API - Then the HTTP status code should be "403" - Examples: - | dav-path-version | - | old | - | new | - - @skipOnRevaMaster - Examples: - | dav-path-version | - | spaces |