Merge pull request #5933 from owncloud/backport-test-for-set-quota-for-differnt-users
[tests-only][full-ci] Backport test for set quota for differnt users
This commit is contained in:
2 files changed
+184
No files matched your search
@@ -118,5 +118,11 @@ The expected failures in this file are from features in the owncloud/ocis repo.
|
||||
- [apiGraph/addUserToGroup.feature:292](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/addUserToGroup.feature#L292)
|
||||
- [apiGraph/addUserToGroup.feature:306](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiGraph/addUserToGroup.feature#L306)
|
||||
|
||||
### [Space admin trying to set personal space quota returns status code 200](https://github.com/owncloud/ocis/issues/5947)
|
||||
- [apiSpaces/setQuota.feature:80](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/setQuota.feature#L80)
|
||||
- [apiSpaces/setQuota.feature:81](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/setQuota.feature#L81)
|
||||
- [apiSpaces/setQuota.feature:82](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/setQuota.feature#L82)
|
||||
- [apiSpaces/setQuota.feature:83](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpaces/setQuota.feature#L83)
|
||||
|
||||
Note: always have an empty line at the end of this file.
|
||||
The bash script that processes this file requires that the last line has a newline on the end.
|
||||
@@ -0,0 +1,178 @@
|
||||
@api
|
||||
Feature: Set quota
|
||||
As a user
|
||||
I want to set quota to different users
|
||||
So that users can only take up a certain amount of storage space
|
||||
|
||||
Background:
|
||||
Given these users have been created with default attributes and without skeleton files:
|
||||
| username |
|
||||
| Alice |
|
||||
| Brian |
|
||||
|
||||
|
||||
Scenario Outline: admin sets personal space quota of user with different role
|
||||
Given the administrator has given "Alice" the role "Admin" using the settings api
|
||||
And the administrator has given "Brian" the role "<userRole>" using the settings api
|
||||
When user "Alice" changes the quota of the "Brian Murphy" space to "100" owned by user "Brian"
|
||||
Then the HTTP status code should be "200"
|
||||
And for user "Brian" the JSON response should contain space called "Brian Murphy" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"quota"
|
||||
],
|
||||
"properties": {
|
||||
"quota": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"total"
|
||||
],
|
||||
"properties": {
|
||||
"total" : {
|
||||
"type": "number",
|
||||
"enum": [100]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole |
|
||||
| Admin |
|
||||
| Space Admin |
|
||||
| User |
|
||||
| Guest |
|
||||
|
||||
|
||||
Scenario Outline: non-admin user tries to set the personal space quota of other users
|
||||
Given the administrator has given "Alice" the role "<role>" using the settings api
|
||||
And the administrator has given "Brian" the role "<userRole>" using the settings api
|
||||
When user "Alice" changes the quota of the "Brian Murphy" space to "100" owned by user "Brian"
|
||||
Then the HTTP status code should be "401"
|
||||
And for user "Brian" the JSON response should contain space called "Brian Murphy" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"quota"
|
||||
],
|
||||
"properties": {
|
||||
"quota": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"total"
|
||||
],
|
||||
"properties": {
|
||||
"total" : {
|
||||
"type": "number",
|
||||
"enum": [0]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| role | userRole |
|
||||
| Space Admin | Admin |
|
||||
| Space Admin | Space Admin |
|
||||
| Space Admin | User |
|
||||
| Space Admin | Guest |
|
||||
| User | Admin |
|
||||
| User | Space Admin |
|
||||
| User | User |
|
||||
| User | Guest |
|
||||
| Guest | Admin |
|
||||
| Guest | Space Admin |
|
||||
| Guest | User |
|
||||
| Guest | Guest |
|
||||
|
||||
|
||||
Scenario Outline: admin or space admin user sets a quota of a project space
|
||||
Given the administrator has given "Alice" the role "Space Admin" using the settings api
|
||||
And the administrator has given "Brian" the role "<userRole>" using the settings api
|
||||
And user "Alice" has created a space "Project Jupiter" of type "project" with quota "20"
|
||||
When user "Brian" changes the quota of the "Project Jupiter" space to "100" owned by user "Alice"
|
||||
Then the HTTP status code should be "200"
|
||||
And for user "Alice" the JSON response should contain space called "Project Jupiter" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"quota"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Jupiter"]
|
||||
},
|
||||
"quota": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"total"
|
||||
],
|
||||
"properties": {
|
||||
"total" : {
|
||||
"type": "number",
|
||||
"enum": [100]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole |
|
||||
| Admin |
|
||||
| Space Admin |
|
||||
|
||||
|
||||
Scenario Outline: normal or guest user tries to set quota of a space
|
||||
Given the administrator has given "Alice" the role "Space Admin" using the settings api
|
||||
And the administrator has given "Brian" the role "<userRole>" using the settings api
|
||||
And user "Alice" has created a space "Project Jupiter" of type "project" with quota "20"
|
||||
And user "Alice" has shared a space "Project Jupiter" with settings:
|
||||
| shareWith | Brian |
|
||||
| role | <spaceRole> |
|
||||
When user "Brian" changes the quota of the "Project Jupiter" space to "100"
|
||||
Then the HTTP status code should be "401"
|
||||
And for user "Alice" the JSON response should contain space called "Project Jupiter" and match
|
||||
"""
|
||||
{
|
||||
"type": "object",
|
||||
"required": [
|
||||
"name",
|
||||
"quota"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"enum": ["Project Jupiter"]
|
||||
},
|
||||
"quota": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"total"
|
||||
],
|
||||
"properties": {
|
||||
"total" : {
|
||||
"type": "number",
|
||||
"enum": [20]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
Examples:
|
||||
| userRole | spaceRole |
|
||||
| User | viewer |
|
||||
| User | editor |
|
||||
| User | manager |
|
||||
| Guest | viewer |
|
||||
| Guest | editor |
|
||||
| Guest | manager |
|
||||
Reference in new issue
Block a user