From 6506943a03d857f851c7b34e68d488c5e74218dc Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Thu, 12 Oct 2017 15:01:02 +0100 Subject: [PATCH] [placement] add coverage for update of standard resource class In microversion <= 1.6 it is possible to update a resource class to have a new name. This is only possible for custom resource classes, but there was no test to show that the proper 400 was returned when attempting to change a standard class. This adds one test to cover it, and in the process changes the name of a related test to distinguish it from the new one. Change-Id: I6c665db68de91c0de91c16f7e622f0c7e2f28bc2 Closes-Bug: #1723123 --- .../placement/gabbits/resource-classes.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml b/nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml index 8fd204515984..b3137c57d5eb 100644 --- a/nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml +++ b/nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml @@ -121,7 +121,7 @@ tests: $.resource_classes[10].name: $ENVIRON['CUSTOM_RES_CLASS'] $.resource_classes[10].links[?rel = "self"].href: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] -- name: update standard resource class +- name: update standard resource class bad json PUT: /resource_classes/VCPU request_headers: content-type: application/json @@ -134,6 +134,20 @@ tests: response_json_paths: $.errors[0].title: Bad Request +- name: update standard resource class to custom + desc: standard classes cannot be updated + PUT: /resource_classes/VCPU + request_headers: + content-type: application/json + OpenStack-API-Version: placement 1.6 + data: + name: $ENVIRON['CUSTOM_RES_CLASS'] + status: 400 + response_strings: + - Cannot update standard resource class VCPU + response_json_paths: + $.errors[0].title: Bad Request + - name: update custom resource class to standard resource class name PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] request_headers: