From 615377a2037654a54992f0a04b1f7098de19f97c Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Thu, 30 Jul 2020 16:31:16 +0545 Subject: [PATCH 1/5] some fixes to make tests pass with ocis pr 409 --- .../features/apiAuthOcs/ocsDELETEAuth.feature | 40 +++++++++++++++++-- .../features/apiAuthOcs/ocsGETAuth.feature | 24 ++++++++--- .../createShare.feature | 4 +- 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/tests/acceptance/features/apiAuthOcs/ocsDELETEAuth.feature b/tests/acceptance/features/apiAuthOcs/ocsDELETEAuth.feature index e862f1175612..864939960b15 100644 --- a/tests/acceptance/features/apiAuthOcs/ocsDELETEAuth.feature +++ b/tests/acceptance/features/apiAuthOcs/ocsDELETEAuth.feature @@ -46,11 +46,43 @@ Feature: auth | /ocs/v2.php/cloud/apps/testing | | /ocs/v1.php/cloud/groups/group1 | | /ocs/v2.php/cloud/groups/group1 | + Then the HTTP status code of responses on all endpoints should be "401" + And the OCS status code of responses on all endpoints should be "notset" + + @smokeTest @skipOnOcV10 @issue-ocis-ocs-26 + #after fixing all issues delete this Scenario and use the one above + Scenario: send DELETE requests to OCS endpoints as admin with wrong password + When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice" + | endpoint | | /ocs/v1.php/cloud/users/%username% | - | /ocs/v2.php/cloud/users/%username% | + | /ocs/v1.php/cloud/users/%username%/subadmins | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "998" + + @smokeTest @skipOnOcV10 @issue-ocis-ocs-26 + #after fixing all issues delete this Scenario and use the one above + Scenario: send DELETE requests to OCS endpoints as admin with wrong password + When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice" + | endpoint | | /ocs/v1.php/cloud/users/%username%/groups | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "996" + + @smokeTest @skipOnOcV10 @issue-ocis-ocs-26 + #after fixing all issues delete this Scenario and use the one above + Scenario: send DELETE requests to OCS endpoints as admin with wrong password + When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice" + | endpoint | | /ocs/v2.php/cloud/users/%username%/groups | - | /ocs/v1.php/cloud/users/%username%/subadmins | + Then the HTTP status code of responses on all endpoints should be "500" + And the OCS status code of responses on all endpoints should be "996" + + @smokeTest @skipOnOcV10 @issue-ocis-ocs-26 + #after fixing all issues delete this Scenario and use the one above + Scenario: send DELETE requests to OCS endpoints as admin with wrong password + When the administrator requests these endpoints with "DELETE" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v2.php/cloud/users/%username% | | /ocs/v2.php/cloud/users/%username%/subadmins | - Then the HTTP status code of responses on all endpoints should be "401" - And the OCS status code of responses on all endpoints should be "notset" + Then the HTTP status code of responses on all endpoints should be "404" + And the OCS status code of responses on all endpoints should be "998" diff --git a/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature b/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature index 9a070451d9ef..2483eb6bf79b 100644 --- a/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature +++ b/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature @@ -62,8 +62,6 @@ Feature: auth | /ocs/v2.php/cloud/apps | | /ocs/v1.php/cloud/groups | | /ocs/v2.php/cloud/groups | - | /ocs/v1.php/cloud/users | - | /ocs/v2.php/cloud/users | | /ocs/v1.php/config | | /ocs/v2.php/config | | /ocs/v1.php/privatedata/getattribute | @@ -71,6 +69,22 @@ Feature: auth Then the HTTP status code of responses on all endpoints should be "401" And the OCS status code of responses on all endpoints should be "notset" + @skipOnOcV10 + @issue-ocis-ocs-26 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: using OCS anonymously + When a user requests these endpoints with "GET" and no authentication + | endpoint | + | /ocs/v1.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "100" + When a user requests these endpoints with "GET" and no authentication + | endpoint | + | /ocs/v2.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "200" + @issue-32068 @skipOnOcis @issue-ocis-reva-11 @issue-ocis-reva-30 @@ -153,12 +167,12 @@ Feature: auth | endpoint | | /ocs/v1.php/cloud/users | Then the HTTP status code of responses on all endpoints should be "200" - And the OCS status code of responses on all endpoints should be "403" + And the OCS status code of responses on all endpoints should be "100" When the user "Alice" requests these endpoints with "GET" with basic auth | endpoint | | /ocs/v2.php/cloud/users | - Then the HTTP status code of responses on all endpoints should be "403" - And the OCS status code of responses on all endpoints should be "403" + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "200" When the user "Alice" requests these endpoints with "GET" with basic auth | endpoint | | /ocs/v2.php/config | diff --git a/tests/acceptance/features/apiShareManagementBasic/createShare.feature b/tests/acceptance/features/apiShareManagementBasic/createShare.feature index 7e8a769b3852..c91a9fb1e16d 100644 --- a/tests/acceptance/features/apiShareManagementBasic/createShare.feature +++ b/tests/acceptance/features/apiShareManagementBasic/createShare.feature @@ -377,8 +377,8 @@ Feature: sharing # And folder "/folder1/folder2" should be included as path in the response Examples: | ocs_api_version | http_status_code | ocs_status_code | - | 1 | 200 | 996 | - | 2 | 500 | 996 | + | 1 | 200 | 100 | + | 2 | 200 | 200 | @skipOnOcis @toImplementOnOCIS @issue-ocis-reva-14 @issue-ocis-reva-243 Scenario Outline: user shares a file with file name longer than 64 chars to another user From dfef949f3fcbf0dbd5b1536e868c97a9e3143e02 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Fri, 31 Jul 2020 16:30:14 +0545 Subject: [PATCH 2/5] more adjustements to the ocs endpoint --- .../features/apiAuthOcs/ocsGETAuth.feature | 54 ++++++++++++++++++- .../features/apiAuthOcs/ocsPUTAuth.feature | 41 ++++++++++++-- 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature b/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature index 2483eb6bf79b..1ab849840876 100644 --- a/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature +++ b/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature @@ -218,6 +218,7 @@ Feature: auth @skipOnOcV10 @issue-ocis-reva-29 @issue-ocis-reva-30 + @issue-ocis-accounts-73 @smokeTest #after fixing all issues delete this Scenario and use the one above Scenario: using OCS as normal user with wrong password @@ -244,7 +245,58 @@ Feature: auth Then the HTTP status code of responses on all endpoints should be "401" And the OCS status code of responses on all endpoints should be "notset" - @skipOnOcis @issue-ocis-reva-65 + @skipOnOcV10 + @issue-ocis-reva-29 + @issue-ocis-reva-30 + @issue-ocis-accounts-73 + @issue-ocis-ocs-26 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: using OCS as normal user (username does not have a capital letter) with wrong password + Given user "brian" has been created with default attributes and skeleton files + When user "brian" requests these endpoints with "GET" using password "invalid" + | endpoint | + | /ocs/v1.php/apps/files_external/api/v1/mounts | + | /ocs/v2.php/apps/files_external/api/v1/mounts | + | /ocs/v1.php/apps/files_sharing/api/v1/remote_shares | + | /ocs/v2.php/apps/files_sharing/api/v1/remote_shares | + | /ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending | + | /ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending | + | /ocs/v1.php/apps/files_sharing/api/v1/shares | + | /ocs/v2.php/apps/files_sharing/api/v1/shares | + | /ocs/v1.php/cloud/apps | + | /ocs/v2.php/cloud/apps | + | /ocs/v1.php/cloud/groups | + | /ocs/v2.php/cloud/groups | + | /ocs/v1.php/config | + | /ocs/v2.php/config | + | /ocs/v1.php/privatedata/getattribute | + | /ocs/v2.php/privatedata/getattribute | + Then the HTTP status code of responses on all endpoints should be "401" + And the OCS status code of responses on all endpoints should be "notset" + + @skipOnOcV10 + @issue-ocis-reva-29 + @issue-ocis-reva-30 + @issue-ocis-accounts-73 + @issue-ocis-ocs-26 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: using OCS as normal user (username does not have a capital letter) with wrong password + Given user "brian" has been created with default attributes and skeleton files + When user "brian" requests these endpoints with "GET" using password "invalid" + | endpoint | + | /ocs/v1.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "100" + When user "brian" requests these endpoints with "GET" using password "invalid" + | endpoint | + | /ocs/v2.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "200" + + @skipOnOcis + @issue-ocis-reva-65 Scenario:using OCS with admin basic auth When the administrator requests these endpoint with "GET" | endpoint | diff --git a/tests/acceptance/features/apiAuthOcs/ocsPUTAuth.feature b/tests/acceptance/features/apiAuthOcs/ocsPUTAuth.feature index cfcd44e90544..8e370ee07a9b 100644 --- a/tests/acceptance/features/apiAuthOcs/ocsPUTAuth.feature +++ b/tests/acceptance/features/apiAuthOcs/ocsPUTAuth.feature @@ -24,18 +24,49 @@ Feature: auth @skipOnOcV10 @issue-ocis-reva-30 + @issue-ocis-ocs-26 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: send PUT request to OCS endpoints as admin with wrong password + When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v1.php/apps/files_sharing/api/v1/shares/123 | + | /ocs/v2.php/apps/files_sharing/api/v1/shares/123 | + Then the HTTP status code of responses on all endpoints should be "401" + And the OCS status code of responses on all endpoints should be "notset" + + @skipOnOcV10 + @issue-ocis-reva-30 + @issue-ocis-ocs-26 @smokeTest #after fixing all issues delete this Scenario and use the one above Scenario: send PUT request to OCS endpoints as admin with wrong password When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice" | endpoint | | /ocs/v1.php/cloud/users/%username% | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "103" + When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | | /ocs/v2.php/cloud/users/%username% | + Then the HTTP status code of responses on all endpoints should be "400" + And the OCS status code of responses on all endpoints should be "103" + + @skipOnOcV10 + @issue-ocis-reva-30 + @issue-ocis-ocs-28 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: send PUT request to OCS endpoints as admin with wrong password + When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | | /ocs/v1.php/cloud/users/%username%/disable | - | /ocs/v2.php/cloud/users/%username%/disable | | /ocs/v1.php/cloud/users/%username%/enable | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "998" + When the administrator requests these endpoints with "PUT" with body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v2.php/cloud/users/%username%/disable | | /ocs/v2.php/cloud/users/%username%/enable | - | /ocs/v1.php/apps/files_sharing/api/v1/shares/123 | - | /ocs/v2.php/apps/files_sharing/api/v1/shares/123 | - Then the HTTP status code of responses on all endpoints should be "401" - And the OCS status code of responses on all endpoints should be "notset" + Then the HTTP status code of responses on all endpoints should be "404" + And the OCS status code of responses on all endpoints should be "998" From de9cb925aca5253d28d127bfed4bf6250b3906b4 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 5 Aug 2020 13:53:33 +0545 Subject: [PATCH 3/5] test adjustements because ocis-accounts/issues/73 was fixed --- .../features/apiAuthOcs/ocsGETAuth.feature | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature b/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature index 1ab849840876..9bedac38ea6a 100644 --- a/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature +++ b/tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature @@ -221,7 +221,7 @@ Feature: auth @issue-ocis-accounts-73 @smokeTest #after fixing all issues delete this Scenario and use the one above - Scenario: using OCS as normal user with wrong password + Scenario: using OCS as normal user (username has a capital letter) with wrong password When user "Alice" requests these endpoints with "GET" using password "invalid" | endpoint | | /ocs/v1.php/apps/files_external/api/v1/mounts | @@ -236,8 +236,6 @@ Feature: auth | /ocs/v2.php/cloud/apps | | /ocs/v1.php/cloud/groups | | /ocs/v2.php/cloud/groups | - | /ocs/v1.php/cloud/users | - | /ocs/v2.php/cloud/users | | /ocs/v1.php/config | | /ocs/v2.php/config | | /ocs/v1.php/privatedata/getattribute | @@ -245,6 +243,25 @@ Feature: auth Then the HTTP status code of responses on all endpoints should be "401" And the OCS status code of responses on all endpoints should be "notset" + @skipOnOcV10 + @issue-ocis-reva-29 + @issue-ocis-reva-30 + @issue-ocis-accounts-73 + @issue-ocis-ocs-26 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: using OCS as normal user (username has a capital letter) with wrong password + When user "Alice" requests these endpoints with "GET" using password "invalid" + | endpoint | + | /ocs/v1.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "100" + When user "Alice" requests these endpoints with "GET" using password "invalid" + | endpoint | + | /ocs/v2.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "200" + @skipOnOcV10 @issue-ocis-reva-29 @issue-ocis-reva-30 From 5d14b9d34f7d6316c96c709a19ff9ed1a7a73ea8 Mon Sep 17 00:00:00 2001 From: Artur Neumann Date: Wed, 5 Aug 2020 16:58:06 +0545 Subject: [PATCH 4/5] adjustment to POST tests --- .../features/apiAuthOcs/ocsPOSTAuth.feature | 53 ++++++++++++++++--- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/tests/acceptance/features/apiAuthOcs/ocsPOSTAuth.feature b/tests/acceptance/features/apiAuthOcs/ocsPOSTAuth.feature index 2cf78c20c9ba..5393585a99ab 100644 --- a/tests/acceptance/features/apiAuthOcs/ocsPOSTAuth.feature +++ b/tests/acceptance/features/apiAuthOcs/ocsPOSTAuth.feature @@ -43,7 +43,7 @@ Feature: auth Then the HTTP status code of responses on all endpoints should be "400" And the OCS status code of responses on all endpoints should be "400" - @skipOnOcV10 @issue-ocis-reva-30 + @skipOnOcV10 @issue-ocis-ocs-26 @issue-ocis-reva-30 @smokeTest #after fixing all issues delete this Scenario and use the one above Scenario: send POST requests to OCS endpoints as normal user with wrong password @@ -59,12 +59,6 @@ Feature: auth | /ocs/v2.php/cloud/apps/testing | | /ocs/v1.php/cloud/groups | | /ocs/v2.php/cloud/groups | - | /ocs/v1.php/cloud/users | - | /ocs/v2.php/cloud/users | - | /ocs/v1.php/cloud/users/%username%/groups | - | /ocs/v2.php/cloud/users/%username%/groups | - | /ocs/v1.php/cloud/users/%username%/subadmins | - | /ocs/v2.php/cloud/users/%username%/subadmins | | /ocs/v1.php/person/check | | /ocs/v2.php/person/check | | /ocs/v1.php/privatedata/deleteattribute/testing/test | @@ -73,3 +67,48 @@ Feature: auth | /ocs/v2.php/privatedata/setattribute/testing/test | Then the HTTP status code of responses on all endpoints should be "401" And the OCS status code of responses on all endpoints should be "notset" + + @skipOnOcV10 @issue-ocis-ocs-26 @issue-ocis-reva-30 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: send POST requests to OCS endpoints as normal user with wrong password + When user "Alice" requests these endpoints with "POST" including body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v1.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "400" + When user "Alice" requests these endpoints with "POST" including body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v2.php/cloud/users | + Then the HTTP status code of responses on all endpoints should be "400" + And the OCS status code of responses on all endpoints should be "400" + + @skipOnOcV10 @issue-ocis-reva-30 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: send POST requests to OCS endpoints as normal user with wrong password + When user "Alice" requests these endpoints with "POST" including body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v1.php/cloud/users/%username%/groups | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "996" + When user "Alice" requests these endpoints with "POST" including body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v2.php/cloud/users/%username%/groups | + Then the HTTP status code of responses on all endpoints should be "500" + And the OCS status code of responses on all endpoints should be "996" + + @skipOnOcV10 @issue-ocis-reva-30 + @smokeTest + #after fixing all issues delete this Scenario and use the one above + Scenario: send POST requests to OCS endpoints as normal user with wrong password + When user "Alice" requests these endpoints with "POST" including body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v1.php/cloud/users/%username%/subadmins | + Then the HTTP status code of responses on all endpoints should be "200" + And the OCS status code of responses on all endpoints should be "998" + When user "Alice" requests these endpoints with "POST" including body "doesnotmatter" using password "invalid" about user "Alice" + | endpoint | + | /ocs/v2.php/cloud/users/%username%/subadmins | + Then the HTTP status code of responses on all endpoints should be "404" + And the OCS status code of responses on all endpoints should be "998" From ee50968dbf7dee50737cd3f4e67a527a1e2fbc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 10 Aug 2020 12:57:09 +0200 Subject: [PATCH 5/5] listing shares should work at least we no longer get an error response whan listing shares --- .../createShare.feature | 35 +------------------ 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/tests/acceptance/features/apiShareManagementBasic/createShare.feature b/tests/acceptance/features/apiShareManagementBasic/createShare.feature index c91a9fb1e16d..fef8f4701271 100644 --- a/tests/acceptance/features/apiShareManagementBasic/createShare.feature +++ b/tests/acceptance/features/apiShareManagementBasic/createShare.feature @@ -317,7 +317,7 @@ Feature: sharing | 1 | 100 | | 2 | 200 | - @skipOnOcis @toImplementOnOCIS @issue-ocis-reva-372 @issue-ocis-reva-243 @toImplementOnOCIS + @issue-ocis-reva-372 @issue-ocis-reva-243 Scenario Outline: sharing subfolder of already shared folder, GET result is correct Given using OCS API version "" And these users have been created with default attributes and without skeleton files: @@ -347,39 +347,6 @@ Feature: sharing | 1 | 100 | | 2 | 200 | - @skipOnOcV10 @issue-ocis-reva-372 @issue-ocis-reva-243 - #after fixing all issues delete this Scenario and use the one above - Scenario Outline: sharing subfolder of already shared folder, GET result is correct - Given using OCS API version "" - And these users have been created with default attributes and without skeleton files: - | username | - | Brian | - | Carol | - | David | - | Emily | - And user "Alice" has created folder "/folder1" - And user "Alice" has shared folder "/folder1" with user "Brian" - And user "Alice" has shared folder "/folder1" with user "Carol" - And user "Alice" has created folder "/folder1/folder2" - And user "Alice" has shared folder "/folder1/folder2" with user "David" - And user "Alice" has shared folder "/folder1/folder2" with user "Emily" - When user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares" - Then the OCS status code should be "" - And the HTTP status code should be "" - # On OCIS and reva the response is currently not there -# And the response should contain 4 entries -# And folder "/folder1" should be included as path in the response -# And folder "/folder1/folder2" should be included as path in the response - And user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares?path=/folder1/folder2" - And the response should contain 2 entries - And folder "/folder1" should not be included as path in the response - And folder "/folder2" should be included as path in the response -# And folder "/folder1/folder2" should be included as path in the response - Examples: - | ocs_api_version | http_status_code | ocs_status_code | - | 1 | 200 | 100 | - | 2 | 200 | 200 | - @skipOnOcis @toImplementOnOCIS @issue-ocis-reva-14 @issue-ocis-reva-243 Scenario Outline: user shares a file with file name longer than 64 chars to another user Given using OCS API version ""