[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
This commit is contained in:
Chris Dent 2017-10-12 15:01:02 +01:00
parent 783c429057
commit 6506943a03

View File

@ -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: