placement/placement/tests/functional/gabbits/allocations-bug-1778591.yaml
EdLeafe 9b9073c4c3 Move the functional test directories
While in Nova, placement functional test code was relegated to the
'nova/tests/functional/api/openstack/placement/' directory. This commit
moves the contents of that directory to 'placement/tests/functional/',
and removes the unnecesary directories. It also removes the files
related to Nova aggregates that were preserved in the filter_history.sh
script.

Change-Id: I5af2e074f2e1bcb90f32589fce819bd4872b6871
2018-09-04 10:31:24 -05:00

72 lines
2.2 KiB
YAML

# Demonstrate part of bug 1778591, where when creating an allocation for
# a new consumer will create the consumer and its generation, but if it
# fails the subsequent request requires generation 0, not null, which is
# not what we expect. This is made more problematic in the we cannot query
# the generation when the consumer has no allocations.
fixtures:
- APIFixture
defaults:
request_headers:
x-auth-token: admin
# consumer generations were added in 1.28
openstack-api-version: placement 1.28
content-type: application/json
accept: application/json
tests:
# create a simple resource provider with limited inventory
- name: create provider
POST: /resource_providers
data:
name: simple
uuid: $ENVIRON['RP_UUID']
- name: set inventory
PUT: /resource_providers/$ENVIRON['RP_UUID']/inventories
data:
resource_provider_generation: 0
inventories:
VCPU:
total: 4
- name: fail allocations new consumer, bad capacity
PUT: /allocations/88888888-8888-8888-8888-888888888888
data:
allocations:
"$ENVIRON['RP_UUID']":
resources:
VCPU: 9999
project_id: $ENVIRON['PROJECT_ID']
user_id: $ENVIRON['USER_ID']
consumer_generation: null
status: 409
response_strings:
- The requested amount would exceed the capacity
- name: try to get consumer generation
desc: when there are no allocations we can't see the generation of a consumer
GET: /allocations/88888888-8888-8888-8888-888888888888
response_json_paths:
# check entire response
$:
allocations: {}
# The failure to allocate above should have deleted the auto-created consumer,
# so when we retry the allocation here, we should be able to use the
# appropriate null generation to indicate this is a new consumer
- name: retry allocations new consumer, still null gen
PUT: /allocations/88888888-8888-8888-8888-888888888888
data:
allocations:
"$ENVIRON['RP_UUID']":
resources:
VCPU: 1
project_id: $ENVIRON['PROJECT_ID']
user_id: $ENVIRON['USER_ID']
consumer_generation: null
status: 204