Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] fix tests to run with ocis/409 #37754

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions tests/acceptance/features/apiAuthOcs/ocsDELETEAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
101 changes: 92 additions & 9 deletions tests/acceptance/features/apiAuthOcs/ocsGETAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,29 @@ 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 |
| /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-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
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -204,9 +218,10 @@ 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
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 |
Expand All @@ -221,16 +236,84 @@ 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 |
| /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"

@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 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
@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 |
Expand Down
53 changes: 46 additions & 7 deletions tests/acceptance/features/apiAuthOcs/ocsPOSTAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 |
Expand All @@ -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"
41 changes: 36 additions & 5 deletions tests/acceptance/features/apiAuthOcs/ocsPUTAuth.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading