]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
[placement] increase gabbi coverage of handlers.inventory
authorChris Dent <cdent@anticdent.org>
Thu, 10 Nov 2016 18:29:42 +0000 (18:29 +0000)
committerChris Dent <cdent@anticdent.org>
Tue, 22 Nov 2016 15:34:51 +0000 (15:34 +0000)
Test for correctly formed but invalid data when creating an Inventory.
This increases the coverage of the inventory handler from gabbi.

Race condition and ConcurrentUpdateDetected scenarios are not
covered as those are hard to cause from a gabbi test.

Change-Id: I603558c08d540aa53918252a0a9a050701456f5a

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

index 237a22a8aab6bdf6f526047818b97fef18e90c7f..6ab4acc3aebc7edd401e37b2dc7530fe2e7380fe 100644 (file)
@@ -39,6 +39,17 @@ tests:
   response_strings:
       - Unable to create inventory for resource provider
 
+- name: post an invalid inventory
+  POST: /resource_providers/$ENVIRON['RP_UUID']/inventories
+  request_headers:
+      content-type: application/json
+  data:
+      resource_class: DISK_GB
+      total: -1
+  status: 400
+  response_strings:
+      - Bad inventory DISK_GB for resource provider $ENVIRON['RP_UUID']
+
 - name: post an inventory
   POST: /resource_providers/$ENVIRON['RP_UUID']/inventories
   request_headers: