From d96b19a50c46e798580c6d21ebe4fbbd931137e6 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Mon, 6 May 2024 17:51:59 +0545 Subject: [PATCH 1/5] test: add more COPY/MOVE tests --- .../coreApiWebdavMove2/moveFile.feature | 104 ++++++++++++++++++ .../coreApiWebdavProperties/copyFile.feature | 26 +++++ 2 files changed, 130 insertions(+) diff --git a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature index 6198535f36f..33af814d848 100644 --- a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature +++ b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature @@ -126,6 +126,27 @@ Feature: move (rename) file | spaces | + Scenario Outline: move a file to existing file name + Given using DAV path + And user "Alice" has uploaded file with content "test file" to "testfile.txt" + And user "Alice" has uploaded file with content "some content" to "lorem.txt" + When user "Alice" moves file "testfile.txt" to "lorem.txt" using the WebDAV API + Then the HTTP status code should be "204" + And as "Alice" file "lorem.txt" should exist + And the content of file "lorem.txt" for user "Alice" should be "test file" + But as "Alice" file "testfile.txt" should not exist + And as "Alice" the file with original path "lorem.txt" should exist in the trashbin + Examples: + | dav-path-version | + | old | + | new | + + @skipOnRevaMaster + Examples: + | dav-path-version | + | spaces | + + Scenario Outline: move file into a not-existing folder Given using DAV path And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "fileToMove.txt" @@ -487,3 +508,86 @@ Feature: move (rename) file Examples: | dav-path-version | | spaces | + + + Scenario Outline: rename folder to/from special characters + Given using DAV path + And user "Alice" has uploaded file with content "test file" to + When user "Alice" moves file to using the WebDAV API + Then the HTTP status code should be "201" + And as "Alice" file should exist + But as "Alice" file should not exist + Examples: + | 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" | "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 | "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" | "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 | "file,comma.txt" | "testfile.txt" | + | new | " start with space.txt" | "testfile.txt" | + + @skipOnRevaMaster + Examples: + | 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" | "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 | "file,comma.txt" | "testfile.txt" | + | spaces | " start with space.txt" | "testfile.txt" | + + + Scenario Outline: try to rename file to name having white space at the end + Given using DAV path + And user "Alice" has uploaded file with content "test file" to "testfile.txt" + When user "Alice" moves file "testfile.txt" to "space at end " using the WebDAV API + Then the HTTP status code should be "201" + And as "Alice" file "space at end" should exist + But as "Alice" file "testfile.txt" should not exist + And as "Alice" file "space at end " should not exist + Examples: + | dav-path-version | + | old | + | new | + + @skipOnRevaMaster + Examples: + | dav-path-version | + | spaces | + + + Scenario Outline: try to rename file to . and .. + Given using DAV path + And user "Alice" has uploaded file with content "test file" to "testfile.txt" + 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 | + + @skipOnRevaMaster + Examples: + | dav-path-version | file-name | http-status-code | + | spaces | /. | 409 | + | spaces | /.. | 400 | \ No newline at end of file diff --git a/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature b/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature index 0a349c617db..821264351b4 100644 --- a/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature +++ b/tests/acceptance/features/coreApiWebdavProperties/copyFile.feature @@ -854,3 +854,29 @@ Feature: copy file Examples: | dav-path-version | | spaces | + + + Scenario Outline: copy a file into a folder with special characters + Given using DAV path + And user "Alice" has created folder + And user "Alice" has uploaded file with content "test file" to + When user "Alice" copies file to using the WebDAV API + Then the HTTP status code should be "201" + And as "Alice" file should exist + And as "Alice" file should exist + And as "Alice" folder should exist + Examples: + | dav-path-version | file-name | folder-name | destination | + | old | "'single'" | "folder-'single'" | "folder-'single'/'single'" | + | old | "question?" | "folder-question?" | "folder-question?/question?" | + | old | "&and#hash" | "folder-&and#hash" | "folder-&and#hash/&and#hash" | + | new | "'single'" | "folder-'single'" | "folder-'single'/'single'" | + | new | "question?" | "folder-question?" | "folder-question?/question?" | + | new | "&and#hash" | "folder-&and#hash" | "folder-&and#hash/&and#hash" | + + @skipOnRevaMaster + Examples: + | dav-path-version | file-name | folder-name | destination | + | spaces | "'single'" | "folder-'single'" | "folder-'single'/'single'" | + | spaces | "question?" | "folder-question?" | "folder-question?/question?" | + | spaces | "&and#hash" | "folder-&and#hash" | "folder-&and#hash/&and#hash" | From 9aa73ff7f6e4dea79b81b788f862ac6f43a33bd5 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Mon, 6 May 2024 17:52:23 +0545 Subject: [PATCH 2/5] test: add sharing to group edgecase tests --- .../apiSharingNg/shareInvitations.feature | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/tests/acceptance/features/apiSharingNg/shareInvitations.feature b/tests/acceptance/features/apiSharingNg/shareInvitations.feature index 42b77a59ba8..59c3ba57bcb 100644 --- a/tests/acceptance/features/apiSharingNg/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNg/shareInvitations.feature @@ -3215,3 +3215,97 @@ Feature: Send a sharing invitations | Space Viewer | group | | Space Editor | group | | Manager | group | + + + Scenario: share a file to user and group having same name (Personal space) + Given user "Carol" has been created with default attributes and without skeleton files + And group "Brian" has been created + And the following users have been added to the following groups + | username | groupname | + | Carol | Brian | + And user "Alice" has uploaded file with content "lorem" to "textfile.txt" + When user "Alice" sends the following share invitation using the Graph API: + | resource | textfile.txt | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + Then the HTTP status code should be "200" + And for user "Brian" the space Shares should contain these entries: + | textfile.txt | + When user "Alice" sends the following share invitation using the Graph API: + | resource | textfile.txt | + | space | Personal | + | sharee | Brian | + | shareType | group | + | permissionsRole | Viewer | + Then the HTTP status code should be "200" + And for user "Carol" the space Shares should contain these entries: + | textfile.txt | + + + Scenario: share a file to group containing special characters in name (Personal space) + Given group "?\?@#%@;" has been created + And the following users have been added to the following groups + | username | groupname | + | Brian | ?\?@#%@; | + And user "Alice" has uploaded file with content "lorem" to "textfile.txt" + When user "Alice" sends the following share invitation using the Graph API: + | resource | textfile.txt | + | space | Personal | + | sharee | ?\?@#%@; | + | shareType | group | + | permissionsRole | Viewer | + Then the HTTP status code should be "200" + And for user "Brian" the space Shares should contain these entries: + | textfile.txt | + + + Scenario: share a file to user and group having same name (Project space) + Given using spaces DAV path + And user "Carol" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "NewSpace" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "NewSpace" with content "lorem" to "textfile.txt" + And group "Brian" has been created + And the following users have been added to the following groups + | username | groupname | + | Carol | Brian | + When user "Alice" sends the following share invitation using the Graph API: + | resource | textfile.txt | + | space | NewSpace | + | sharee | Brian | + | shareType | user | + | permissionsRole | Viewer | + Then the HTTP status code should be "200" + And for user "Brian" the space Shares should contain these entries: + | textfile.txt | + When user "Alice" sends the following share invitation using the Graph API: + | resource | textfile.txt | + | space | NewSpace | + | sharee | Brian | + | shareType | group | + | permissionsRole | Viewer | + Then the HTTP status code should be "200" + And for user "Carol" the space Shares should contain these entries: + | textfile.txt | + + + Scenario: share a file to group containing special characters in name (Project space) + Given using spaces DAV path + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "NewSpace" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "NewSpace" with content "lorem" to "textfile.txt" + And group "?\?@#%@;" has been created + And the following users have been added to the following groups + | username | groupname | + | Brian | ?\?@#%@; | + When user "Alice" sends the following share invitation using the Graph API: + | resource | textfile.txt | + | space | NewSpace | + | sharee | ?\?@#%@; | + | shareType | group | + | permissionsRole | Viewer | + Then the HTTP status code should be "200" + And for user "Brian" the space Shares should contain these entries: + | textfile.txt | From a879e98e4a1667c7895382d111b533dd50e1ba45 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Mon, 6 May 2024 17:54:22 +0545 Subject: [PATCH 3/5] test: new line --- tests/acceptance/features/coreApiWebdavMove2/moveFile.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature index 33af814d848..818e73d7681 100644 --- a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature +++ b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature @@ -590,4 +590,4 @@ Feature: move (rename) file Examples: | dav-path-version | file-name | http-status-code | | spaces | /. | 409 | - | spaces | /.. | 400 | \ No newline at end of file + | spaces | /.. | 400 | From bd7f337ac4c3b639635c266570d0dab2899e383b Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Mon, 6 May 2024 17:57:01 +0545 Subject: [PATCH 4/5] test: fix typo --- tests/acceptance/features/coreApiWebdavMove2/moveFile.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature index 818e73d7681..f38da378367 100644 --- a/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature +++ b/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature @@ -510,7 +510,7 @@ Feature: move (rename) file | spaces | - Scenario Outline: rename folder to/from special characters + Scenario Outline: rename file to/from special characters Given using DAV path And user "Alice" has uploaded file with content "test file" to When user "Alice" moves file to using the WebDAV API From 4a125aceeaef3ee8c6802974a02d517250fad484 Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Tue, 7 May 2024 09:32:00 +0545 Subject: [PATCH 5/5] test: update expected failure --- tests/acceptance/expected-failures-API-on-OCIS-storage.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/expected-failures-API-on-OCIS-storage.md b/tests/acceptance/expected-failures-API-on-OCIS-storage.md index 4151817f418..3306a9fa4fb 100644 --- a/tests/acceptance/expected-failures-API-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-API-on-OCIS-storage.md @@ -353,9 +353,9 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [coreApiWebdavUpload/uploadFile.feature:181](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature#L181) - [coreApiWebdavUpload/uploadFile.feature:180](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature#L180) - [coreApiWebdavUpload/uploadFile.feature:186](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavUpload/uploadFile.feature#L186) -- [coreApiWebdavMove2/moveFile.feature:196](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L196) -- [coreApiWebdavMove2/moveFile.feature:197](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L197) -- [coreApiWebdavMove2/moveFile.feature:202](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L202) +- [coreApiWebdavMove2/moveFile.feature:217](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L217) +- [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) @@ -396,7 +396,7 @@ Not everything needs to be implemented for ocis. While the oc10 testsuite covers - [coreApiWebdavMove1/moveFolder.feature:44](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove1/moveFolder.feature#L44) - [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:158](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/coreApiWebdavMove2/moveFile.feature#L158) +- [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)