[placement] avoid case issues microversions in gabbits

If a gabbi file sets a default microversion by setting a header
'OpenStack-API-Version' with a value like 'placement latest' and then
later overrides that in an individual test with a header of
'openstack-api-version' the difference in case can lead to failure.

In the best case the failure is consistent.

In the worst case it can sometimes work, because the header shows up
twice in the request, and the last header wins, order in the headers
and the resulting list dependent on the vagrancies of python ordering.

The solution is to always use the same case, so this change updates
all use to be lowercase, to establish a precedent that future people
will be able to use as an example.

Note that gabbi is case sensitive here in part because of the
implementation but also because it provides the control and possibility
to test exactly this problem.

Change-Id: I1e89e231cf0d46d211d360cda091b33520f85027
Closes-Bug: #1728934
This commit is contained in:
Chris Dent 2017-10-31 12:54:17 +00:00
parent 39e7ca3226
commit f974e3c356
10 changed files with 20 additions and 20 deletions

View File

@ -7,7 +7,7 @@ defaults:
x-auth-token: admin x-auth-token: admin
accept: application/json accept: application/json
content-type: application/json content-type: application/json
OpenStack-API-Version: placement latest openstack-api-version: placement latest
tests: tests:

View File

@ -5,7 +5,7 @@ defaults:
request_headers: request_headers:
x-auth-token: admin x-auth-token: admin
accept: application/json accept: application/json
OpenStack-API-Version: placement 1.8 openstack-api-version: placement 1.8
tests: tests:

View File

@ -11,7 +11,7 @@ defaults:
x-auth-token: admin x-auth-token: admin
accept: application/json accept: application/json
content-type: application/json content-type: application/json
OpenStack-API-Version: placement latest openstack-api-version: placement latest
tests: tests:

View File

@ -9,7 +9,7 @@ defaults:
x-auth-token: admin x-auth-token: admin
accept: application/json accept: application/json
content-type: application/json content-type: application/json
OpenStack-API-Version: placement latest openstack-api-version: placement latest
tests: tests:

View File

@ -8,7 +8,7 @@ defaults:
x-auth-token: admin x-auth-token: admin
accept: application/json accept: application/json
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.6 openstack-api-version: placement 1.6
tests: tests:

View File

@ -6,7 +6,7 @@ defaults:
x-auth-token: admin x-auth-token: admin
accept: application/json accept: application/json
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.7 openstack-api-version: placement 1.7
tests: tests:

View File

@ -5,14 +5,14 @@ defaults:
request_headers: request_headers:
x-auth-token: admin x-auth-token: admin
accept: application/json accept: application/json
OpenStack-API-Version: placement latest openstack-api-version: placement latest
tests: tests:
- name: test microversion masks entire resource-classes endpoint with 404 - name: test microversion masks entire resource-classes endpoint with 404
GET: /resource_classes GET: /resource_classes
request_headers: request_headers:
OpenStack-API-Version: placement 1.1 openstack-api-version: placement 1.1
content-type: application/json content-type: application/json
status: 404 status: 404
response_json_paths: response_json_paths:
@ -22,7 +22,7 @@ tests:
desc: we want to get a 404 before a 415 desc: we want to get a 404 before a 415
POST: /resource_classes POST: /resource_classes
request_headers: request_headers:
OpenStack-API-Version: placement 1.1 openstack-api-version: placement 1.1
content-type: text/plain content-type: text/plain
data: data data: data
status: 404 status: 404
@ -31,7 +31,7 @@ tests:
desc: we want to get a 415 when bad content type desc: we want to get a 415 when bad content type
POST: /resource_classes POST: /resource_classes
request_headers: request_headers:
OpenStack-API-Version: placement 1.2 openstack-api-version: placement 1.2
content-type: text/plain content-type: text/plain
data: data data: data
status: 415 status: 415
@ -125,7 +125,7 @@ tests:
PUT: /resource_classes/VCPU PUT: /resource_classes/VCPU
request_headers: request_headers:
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.6 openstack-api-version: placement 1.6
data: data:
name: VCPU_ALTERNATE name: VCPU_ALTERNATE
status: 400 status: 400
@ -139,7 +139,7 @@ tests:
PUT: /resource_classes/VCPU PUT: /resource_classes/VCPU
request_headers: request_headers:
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.6 openstack-api-version: placement 1.6
data: data:
name: $ENVIRON['CUSTOM_RES_CLASS'] name: $ENVIRON['CUSTOM_RES_CLASS']
status: 400 status: 400
@ -152,7 +152,7 @@ tests:
PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
request_headers: request_headers:
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.6 openstack-api-version: placement 1.6
data: data:
name: VCPU name: VCPU
status: 400 status: 400
@ -173,7 +173,7 @@ tests:
PUT: /resource_classes/CUSTOM_NFV_FOO PUT: /resource_classes/CUSTOM_NFV_FOO
request_headers: request_headers:
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.6 openstack-api-version: placement 1.6
data: data:
name: $ENVIRON['CUSTOM_RES_CLASS'] name: $ENVIRON['CUSTOM_RES_CLASS']
status: 409 status: 409
@ -187,7 +187,7 @@ tests:
PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
request_headers: request_headers:
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.6 openstack-api-version: placement 1.6
data: data:
name: CUSTOM_NFV_BAR name: CUSTOM_NFV_BAR
status: 200 status: 200
@ -252,7 +252,7 @@ tests:
PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
request_headers: request_headers:
content-type: application/json content-type: application/json
OpenStack-API-Version: placement 1.6 openstack-api-version: placement 1.6
data: data:
name: *name_exceeds_max_length_check name: *name_exceeds_max_length_check
status: 400 status: 400

View File

@ -7,7 +7,7 @@ defaults:
x-auth-token: admin x-auth-token: admin
content-type: application/json content-type: application/json
accept: application/json accept: application/json
OpenStack-API-Version: placement latest openstack-api-version: placement latest
tests: tests:
@ -41,7 +41,7 @@ tests:
- name: list resource providers providing resources filter before API 1.4 - name: list resource providers providing resources filter before API 1.4
GET: /resource_providers?resources=VCPU:1 GET: /resource_providers?resources=VCPU:1
request_headers: request_headers:
OpenStack-API-Version: placement 1.3 openstack-api-version: placement 1.3
status: 400 status: 400
response_strings: response_strings:
- 'Invalid query string parameters' - 'Invalid query string parameters'

View File

@ -14,7 +14,7 @@ defaults:
x-auth-token: admin x-auth-token: admin
content-type: application/json content-type: application/json
accept: application/json accept: application/json
OpenStack-API-Version: placement latest openstack-api-version: placement latest
tests: tests:

View File

@ -5,7 +5,7 @@ fixtures:
defaults: defaults:
request_headers: request_headers:
x-auth-token: admin x-auth-token: admin
OpenStack-API-Version: placement latest openstack-api-version: placement latest
tests: tests: