Skip to content

Commit

Permalink
test simpler scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlardier committed Dec 4, 2024
1 parent a04401c commit d66eba9
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions tests/ctst/features/quotas/Quotas.feature
Original file line number Diff line number Diff line change
Expand Up @@ -147,34 +147,38 @@ Feature: Quota Management for APIs
Given an action "DeleteObject"
And a permission to perform the "PutObject" action
And a STORAGE_MANAGER type
And a bucket quota set to 1000 B
And an account quota set to 1000 B
And an upload size of 1000 B for the object "obj-1"
And a bucket quota set to <bucketQuota> B
And a bucket quota set to <uploadSize> B
And an account quota set to <accountQuota> B
# Quota is 200: we put an object of 200 B
And an upload size of <bucketQuota> B for the object "obj-1"
And a <userType> type
And an environment setup for the API
And an "existing" IAM Policy that "applies" with "ALLOW" effect for the current API
When I wait 3 seconds
# Quota is 200, inflight are 200, we should not be able to write
And I PUT an object with size <uploadSize>
Then the API should "fail" with "QuotaExceeded"
# The inflights are now part of the current metrics
When the "count-items" cronjobs completes without error
# Wait for inflights to be read by SCUBA
When I wait 3 seconds
# At this point if negative inflights are not supported, write should
# not be possible, as the previous inflights are now part of the current
# metrics.
# Delete 200 B, inflights are now -200
# With 200 "current" bytes, we should accept up to 200 B (200 - 200 + input <= quota)
And i delete object "obj-1"
# Wait for inflights to be read by SCUBA
And I wait 3 seconds
And I PUT an object with size 1000
# Try to write 300
And I PUT an object with size 300
Then the API should "fail" with "QuotaExceeded"

Examples:
| uploadSize | bucketQuota | accountQuota | userType |
| 100 | 200 | 0 | ACCOUNT |
| 100 | 0 | 200 | ACCOUNT |
| 100 | 200 | 200 | ACCOUNT |
| 100 | 200 | 0 | IAM_USER |
| 100 | 0 | 200 | IAM_USER |
| 100 | 200 | 200 | IAM_USER |
| 200 | 200 | 0 | ACCOUNT |
| 200 | 0 | 200 | ACCOUNT |
| 200 | 200 | 200 | ACCOUNT |
| 200 | 200 | 0 | IAM_USER |
| 200 | 0 | 200 | IAM_USER |
| 200 | 200 | 200 | IAM_USER |

0 comments on commit d66eba9

Please sign in to comment.