diff --git a/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py b/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py index 49f0e7a3d9d0..bf23b4fc128c 100644 --- a/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py +++ b/nova/tests/functional/api/openstack/placement/fixtures/gabbits.py @@ -166,6 +166,7 @@ class AllocationFixture(APIFixture): # Create a first consumer for the DISK_GB allocations consumer1 = tb.ensure_consumer(self.context, user, project) tb.set_allocation(self.context, rp, consumer1, {'DISK_GB': 1000}) + os.environ['CONSUMER_0'] = consumer1.uuid # Create a second consumer for the VCPU allocations consumer2 = tb.ensure_consumer(self.context, user, project) diff --git a/nova/tests/functional/api/openstack/placement/gabbits/with-allocations.yaml b/nova/tests/functional/api/openstack/placement/gabbits/with-allocations.yaml index 06d0ef4ce012..fac6dd051073 100644 --- a/nova/tests/functional/api/openstack/placement/gabbits/with-allocations.yaml +++ b/nova/tests/functional/api/openstack/placement/gabbits/with-allocations.yaml @@ -25,6 +25,24 @@ tests: $.usages.DISK_GB: 1020 $.usages.VCPU: 7 +- name: get allocations + GET: /resource_providers/$ENVIRON['RP_UUID']/allocations + response_headers: + content-type: /application/json/ + response_json_paths: + # Bug#1785382: It doesn't show all the consumers + # on the resource provider + # $.allocations.`len`: 3 + $.allocations.`len`: 2 + $.allocations["$ENVIRON['CONSUMER_0']"].resources: + DISK_GB: 1000 + $.allocations["$ENVIRON['CONSUMER_ID']"].resources: + VCPU: 6 + # $.allocations["$ENVIRON['ALT_CONSUMER_ID']"].resources: + # VCPU: 1 + # DISK_GB: 20 + $.resource_provider_generation: 5 + - name: fail to delete resource provider DELETE: /resource_providers/$ENVIRON['RP_UUID'] status: 409