71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
|
|
fixtures:
|
|
- AllocationFixture
|
|
|
|
defaults:
|
|
request_headers:
|
|
x-auth-token: admin
|
|
|
|
tests:
|
|
|
|
- name: confirm inventories
|
|
GET: /resource_providers/$ENVIRON['RP_UUID']/inventories
|
|
response_json_paths:
|
|
$.inventories.DISK_GB.total: 2048
|
|
$.inventories.DISK_GB.reserved: 0
|
|
|
|
- name: get usages
|
|
GET: /resource_providers/$ENVIRON['RP_UUID']/usages
|
|
response_headers:
|
|
# use a regex here because charset, which is not only not
|
|
# required but superfluous, is present
|
|
content-type: /application/json/
|
|
response_json_paths:
|
|
$.resource_provider_generation: 5
|
|
$.usages.DISK_GB: 1020
|
|
$.usages.VCPU: 7
|
|
|
|
- name: fail to delete resource provider
|
|
DELETE: /resource_providers/$ENVIRON['RP_UUID']
|
|
status: 409
|
|
response_strings:
|
|
- "Unable to delete resource provider $ENVIRON['RP_UUID']: Resource provider has allocations."
|
|
|
|
- name: fail to delete all inventory
|
|
DELETE: /resource_providers/$ENVIRON['RP_UUID']/inventories
|
|
request_headers:
|
|
accept: application/json
|
|
openstack-api-version: placement 1.5
|
|
status: 409
|
|
response_headers:
|
|
content-type: /application/json/
|
|
response_strings:
|
|
- "Inventory for 'VCPU, DISK_GB' on resource provider '$ENVIRON['RP_UUID']' in use"
|
|
|
|
- name: get total usages by project
|
|
GET: /usages?project_id=$ENVIRON['PROJECT_ID']
|
|
request_headers:
|
|
openstack-api-version: placement 1.9
|
|
status: 200
|
|
response_json_paths:
|
|
$.usages.DISK_GB: 1020
|
|
$.usages.VCPU: 7
|
|
|
|
- name: get total usages by project and user
|
|
GET: /usages?project_id=$ENVIRON['PROJECT_ID']&user_id=$ENVIRON['USER_ID']
|
|
request_headers:
|
|
openstack-api-version: placement 1.9
|
|
status: 200
|
|
response_json_paths:
|
|
$.usages.DISK_GB: 1000
|
|
$.usages.VCPU: 6
|
|
|
|
- name: get total usages by project and alt user
|
|
GET: /usages?project_id=$ENVIRON['PROJECT_ID']&user_id=$ENVIRON['ALT_USER_ID']
|
|
request_headers:
|
|
openstack-api-version: placement 1.9
|
|
status: 200
|
|
response_json_paths:
|
|
$.usages.DISK_GB: 20
|
|
$.usages.VCPU: 1
|