From 32034a93d37c1d6dcb8daa95f5b573124758b67d Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Wed, 18 Jul 2018 15:46:03 +0100 Subject: [PATCH] [placement] Add gabbi coverage for an inventory change There's a special case of changing inventories that we didn't have gabbit coverage for: For an existing resource provider, we allow its inventory to be changed to have a lower total than existing allocations (See commit 09627f2a0bd). There was no gabbi coverage for that case. This adds it. Change-Id: I34e104a766d4578f83a455b4b900ea50c9a6ec0f --- .../placement/gabbits/with-allocations.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 03274caddb..06d0ef4ce0 100644 --- a/nova/tests/functional/api/openstack/placement/gabbits/with-allocations.yaml +++ b/nova/tests/functional/api/openstack/placement/gabbits/with-allocations.yaml @@ -68,6 +68,22 @@ tests: response_json_paths: $.errors[0].code: placement.inventory.inuse +# We can change inventory in a way that makes existing allocations exceed the +# new capacity. This is allowed. +- name: change inventory despite capacity exceeded + PUT: /resource_providers/$ENVIRON['RP_UUID']/inventories + request_headers: + accept: application/json + content-type: application/json + data: + resource_provider_generation: 5 + inventories: + DISK_GB: + total: 1019 + VCPU: + total: 97 + status: 200 + - name: get total usages by project GET: /usages?project_id=$ENVIRON['PROJECT_ID'] request_headers: