]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
[placement] increase gabbi coverage of handlers.allocation
authorChris Dent <cdent@anticdent.org>
Thu, 10 Nov 2016 18:00:35 +0000 (18:00 +0000)
committerChris Dent <cdent@anticdent.org>
Tue, 22 Nov 2016 15:34:51 +0000 (15:34 +0000)
A case where a non-existent resource provider in an allocation PUT
request could raise a 400 was not covered. Now it is.

This still leave a ConcurrentUpdateDetected exception (which can
lead to 409) not covered. There's no simple way to cause such a
thing from a gabbi test.

Change-Id: I98243b679ba8101663d459cb9a76f7015078aff7

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

index d50b0c243eb151c62d812a85c48c93c259cf0396..86b6e7072118b8456930bd5f72db649c8cf4cc0f 100644 (file)
@@ -343,3 +343,18 @@ tests:
       $.allocations.['75d0f5f7-75d9-458c-b204-f90ac91604ec'].resources.VCPU: 4
       $.allocations.['1835b1c9-1c61-45af-9eb3-3e0e9f29487b'].resources.DISK_GB: 10
       $.allocations.['1835b1c9-1c61-45af-9eb3-3e0e9f29487b'].resources.VCPU: 8
+
+- name: put an allocation for a not existing resource provider
+  PUT: /allocations/75d0f5f7-75d9-458c-b204-f90ac91604ec
+  request_headers:
+      content-type: application/json
+  data:
+      allocations:
+          - resource_provider:
+                uuid: be8b9cba-e7db-4a12-a386-99b4242167fe
+            resources:
+                DISK_GB: 5
+                VCPU: 4
+  status: 400
+  response_strings:
+      - Allocation for resource provider 'be8b9cba-e7db-4a12-a386-99b4242167fe' that does not exist