nova/nova/tests/functional/api/openstack/placement/gabbits/usage.yaml

121 lines
3.8 KiB
YAML

# More interesting tests for usages are in with_allocations
fixtures:
- APIFixture
defaults:
request_headers:
accept: application/json
x-auth-token: admin
tests:
- name: fail to get usages for missing provider
GET: /resource_providers/fae14fa3-4b43-498c-a33c-4a1d00edb577/usages
status: 404
response_strings:
- No resource provider with uuid fae14fa3-4b43-498c-a33c-4a1d00edb577 found
response_json_paths:
$.errors[0].title: Not Found
- name: create provider
POST: /resource_providers
request_headers:
content-type: application/json
data:
name: a name
status: 201
- name: check provider exists
GET: $LOCATION
response_json_paths:
name: a name
- name: get empty usages
GET: $LAST_URL/usages
request_headers:
content-type: application/json
response_json_paths:
usages: {}
- name: get usages no cache headers base microversion
GET: $LAST_URL
response_forbidden_headers:
- last-modified
- cache-control
- name: get usages cache headers 1.15
GET: $LAST_URL
request_headers:
openstack-api-version: placement 1.15
response_headers:
cache-control: no-cache
# Does last-modified look like a legit timestamp?
last-modified: /^\w+, \d+ \w+ \d{4} [\d:]+ GMT$/
- name: get total usages earlier version
GET: /usages?project_id=$ENVIRON['PROJECT_ID']
request_headers:
openstack-api-version: placement 1.8
status: 404
- name: get total usages no project or user
GET: /usages
request_headers:
openstack-api-version: placement 1.9
status: 400
- name: get empty usages with project id
GET: /usages?project_id=$ENVIRON['PROJECT_ID]
request_headers:
openstack-api-version: placement 1.9
response_json_paths:
usages: {}
- name: get empty usages with project id and user id
GET: /usages?project_id=$ENVIRON['PROJECT_ID']&user_id=78725f09-5c01-4c9e-97a5-98d75e1e32b1
request_headers:
openstack-api-version: placement 1.9
response_json_paths:
usages: {}
- name: get total usages project_id less than min length
GET: /usages?project_id=
request_headers:
openstack-api-version: placement 1.9
status: 400
response_strings:
- "Failed validating 'minLength'"
- name: get total usages user_id less than min length
GET: /usages?project_id=$ENVIRON['PROJECT_ID']&user_id=
request_headers:
openstack-api-version: placement 1.9
status: 400
response_strings:
- "Failed validating 'minLength'"
- name: get total usages project_id exceeds max length
GET: /usages?project_id=78725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b1
request_headers:
openstack-api-version: placement 1.9
status: 400
response_strings:
- "Failed validating 'maxLength'"
- name: get total usages user_id exceeds max length
GET: /usages?project_id=$ENVIRON['PROJECT_ID']&user_id=78725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b178725f09-5c01-4c9e-97a5-98d75e1e32b1
request_headers:
openstack-api-version: placement 1.9
status: 400
response_strings:
- "Failed validating 'maxLength'"
- name: get total usages with additional param
GET: /usages?project_id=$ENVIRON['PROJECT_ID']&user_id=78725f09-5c01-4c9e-97a5-98d75e1e32b1&dummy=1
request_headers:
openstack-api-version: placement 1.9
status: 400
response_strings:
- "Additional properties are not allowed"