Merge "Add check for invalid allocation amounts" into stable/ocata
This commit is contained in:
commit
37d6f6e376
|
@ -51,7 +51,8 @@ ALLOCATION_SCHEMA = {
|
|||
"type": "object",
|
||||
"patternProperties": {
|
||||
"^[0-9A-Z_]+$": {
|
||||
"type": "integer"
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
}
|
||||
},
|
||||
"additionalProperties": False
|
||||
|
|
|
@ -93,6 +93,34 @@ tests:
|
|||
max_unit: 1024
|
||||
status: 201
|
||||
|
||||
- name: put an allocation with zero usage
|
||||
PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
|
||||
request_headers:
|
||||
content-type: application/json
|
||||
data:
|
||||
allocations:
|
||||
- resource_provider:
|
||||
uuid: $ENVIRON['RP_UUID']
|
||||
resources:
|
||||
DISK_GB: 0
|
||||
status: 400
|
||||
response_strings:
|
||||
- "JSON does not validate: 0 is less than the minimum of 1"
|
||||
- Failed validating 'minimum' in schema
|
||||
|
||||
- name: put an allocation with omitted usage
|
||||
PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
|
||||
request_headers:
|
||||
content-type: application/json
|
||||
data:
|
||||
allocations:
|
||||
- resource_provider:
|
||||
uuid: $ENVIRON['RP_UUID']
|
||||
status: 400
|
||||
response_strings:
|
||||
- Failed validating 'required' in schema
|
||||
|
||||
|
||||
- name: put an allocation
|
||||
PUT: /allocations/599ffd2d-526a-4b2e-8683-f13ad25f9958
|
||||
request_headers:
|
||||
|
|
Loading…
Reference in New Issue