summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dent <cdent@anticdent.org>2017-10-31 12:54:17 +0000
committerChris Dent <cdent@anticdent.org>2017-10-31 12:54:17 +0000
commitf974e3c3566f379211d7fdc790d07b5680925584 (patch)
tree738a33f38ac9b1063048da6c5570696b14a0df3c
parent39e7ca322626f4b197de54e1ed83ce046c5fef26 (diff)
[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
Notes
Notes (review): Code-Review+1: Eric Fried <efried@us.ibm.com> Code-Review+2: Balazs Gibizer <balazs.gibizer@ericsson.com> Code-Review+2: Jay Pipes <jaypipes@gmail.com> Workflow+1: Jay Pipes <jaypipes@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 01 Nov 2017 01:26:45 +0000 Reviewed-on: https://review.openstack.org/516662 Project: openstack/nova Branch: refs/heads/master
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/allocation-bad-class.yaml2
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/allocations-1-8.yaml2
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/allocations-bug-1714072.yaml2
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/resource-class-in-use.yaml2
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-6.yaml2
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-7.yaml2
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml20
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/resource-provider-resources-query.yaml4
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/shared-resources.yaml2
-rw-r--r--nova/tests/functional/api/openstack/placement/gabbits/traits.yaml2
10 files changed, 20 insertions, 20 deletions
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/allocation-bad-class.yaml b/nova/tests/functional/api/openstack/placement/gabbits/allocation-bad-class.yaml
index 39e674e..de0ee1c 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/allocation-bad-class.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/allocation-bad-class.yaml
@@ -7,7 +7,7 @@ defaults:
7 x-auth-token: admin 7 x-auth-token: admin
8 accept: application/json 8 accept: application/json
9 content-type: application/json 9 content-type: application/json
10 OpenStack-API-Version: placement latest 10 openstack-api-version: placement latest
11 11
12tests: 12tests:
13 13
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/allocations-1-8.yaml b/nova/tests/functional/api/openstack/placement/gabbits/allocations-1-8.yaml
index d3a8a6b..b42d556 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/allocations-1-8.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/allocations-1-8.yaml
@@ -5,7 +5,7 @@ defaults:
5 request_headers: 5 request_headers:
6 x-auth-token: admin 6 x-auth-token: admin
7 accept: application/json 7 accept: application/json
8 OpenStack-API-Version: placement 1.8 8 openstack-api-version: placement 1.8
9 9
10tests: 10tests:
11 11
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/allocations-bug-1714072.yaml b/nova/tests/functional/api/openstack/placement/gabbits/allocations-bug-1714072.yaml
index f182508..c376046 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/allocations-bug-1714072.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/allocations-bug-1714072.yaml
@@ -11,7 +11,7 @@ defaults:
11 x-auth-token: admin 11 x-auth-token: admin
12 accept: application/json 12 accept: application/json
13 content-type: application/json 13 content-type: application/json
14 OpenStack-API-Version: placement latest 14 openstack-api-version: placement latest
15 15
16tests: 16tests:
17 17
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/resource-class-in-use.yaml b/nova/tests/functional/api/openstack/placement/gabbits/resource-class-in-use.yaml
index a641eb0..62e152e 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/resource-class-in-use.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/resource-class-in-use.yaml
@@ -9,7 +9,7 @@ defaults:
9 x-auth-token: admin 9 x-auth-token: admin
10 accept: application/json 10 accept: application/json
11 content-type: application/json 11 content-type: application/json
12 OpenStack-API-Version: placement latest 12 openstack-api-version: placement latest
13 13
14tests: 14tests:
15 15
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-6.yaml b/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-6.yaml
index 30f250d..9975aa6 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-6.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-6.yaml
@@ -8,7 +8,7 @@ defaults:
8 x-auth-token: admin 8 x-auth-token: admin
9 accept: application/json 9 accept: application/json
10 content-type: application/json 10 content-type: application/json
11 OpenStack-API-Version: placement 1.6 11 openstack-api-version: placement 1.6
12 12
13tests: 13tests:
14 14
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-7.yaml b/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-7.yaml
index 2187c24..1c4a5eb 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-7.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-7.yaml
@@ -6,7 +6,7 @@ defaults:
6 x-auth-token: admin 6 x-auth-token: admin
7 accept: application/json 7 accept: application/json
8 content-type: application/json 8 content-type: application/json
9 OpenStack-API-Version: placement 1.7 9 openstack-api-version: placement 1.7
10 10
11tests: 11tests:
12 12
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 9cf3471..6867c7d 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml
@@ -5,14 +5,14 @@ defaults:
5 request_headers: 5 request_headers:
6 x-auth-token: admin 6 x-auth-token: admin
7 accept: application/json 7 accept: application/json
8 OpenStack-API-Version: placement latest 8 openstack-api-version: placement latest
9 9
10tests: 10tests:
11 11
12- name: test microversion masks entire resource-classes endpoint with 404 12- name: test microversion masks entire resource-classes endpoint with 404
13 GET: /resource_classes 13 GET: /resource_classes
14 request_headers: 14 request_headers:
15 OpenStack-API-Version: placement 1.1 15 openstack-api-version: placement 1.1
16 content-type: application/json 16 content-type: application/json
17 status: 404 17 status: 404
18 response_json_paths: 18 response_json_paths:
@@ -22,7 +22,7 @@ tests:
22 desc: we want to get a 404 before a 415 22 desc: we want to get a 404 before a 415
23 POST: /resource_classes 23 POST: /resource_classes
24 request_headers: 24 request_headers:
25 OpenStack-API-Version: placement 1.1 25 openstack-api-version: placement 1.1
26 content-type: text/plain 26 content-type: text/plain
27 data: data 27 data: data
28 status: 404 28 status: 404
@@ -31,7 +31,7 @@ tests:
31 desc: we want to get a 415 when bad content type 31 desc: we want to get a 415 when bad content type
32 POST: /resource_classes 32 POST: /resource_classes
33 request_headers: 33 request_headers:
34 OpenStack-API-Version: placement 1.2 34 openstack-api-version: placement 1.2
35 content-type: text/plain 35 content-type: text/plain
36 data: data 36 data: data
37 status: 415 37 status: 415
@@ -125,7 +125,7 @@ tests:
125 PUT: /resource_classes/VCPU 125 PUT: /resource_classes/VCPU
126 request_headers: 126 request_headers:
127 content-type: application/json 127 content-type: application/json
128 OpenStack-API-Version: placement 1.6 128 openstack-api-version: placement 1.6
129 data: 129 data:
130 name: VCPU_ALTERNATE 130 name: VCPU_ALTERNATE
131 status: 400 131 status: 400
@@ -139,7 +139,7 @@ tests:
139 PUT: /resource_classes/VCPU 139 PUT: /resource_classes/VCPU
140 request_headers: 140 request_headers:
141 content-type: application/json 141 content-type: application/json
142 OpenStack-API-Version: placement 1.6 142 openstack-api-version: placement 1.6
143 data: 143 data:
144 name: $ENVIRON['CUSTOM_RES_CLASS'] 144 name: $ENVIRON['CUSTOM_RES_CLASS']
145 status: 400 145 status: 400
@@ -152,7 +152,7 @@ tests:
152 PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] 152 PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
153 request_headers: 153 request_headers:
154 content-type: application/json 154 content-type: application/json
155 OpenStack-API-Version: placement 1.6 155 openstack-api-version: placement 1.6
156 data: 156 data:
157 name: VCPU 157 name: VCPU
158 status: 400 158 status: 400
@@ -173,7 +173,7 @@ tests:
173 PUT: /resource_classes/CUSTOM_NFV_FOO 173 PUT: /resource_classes/CUSTOM_NFV_FOO
174 request_headers: 174 request_headers:
175 content-type: application/json 175 content-type: application/json
176 OpenStack-API-Version: placement 1.6 176 openstack-api-version: placement 1.6
177 data: 177 data:
178 name: $ENVIRON['CUSTOM_RES_CLASS'] 178 name: $ENVIRON['CUSTOM_RES_CLASS']
179 status: 409 179 status: 409
@@ -187,7 +187,7 @@ tests:
187 PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] 187 PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
188 request_headers: 188 request_headers:
189 content-type: application/json 189 content-type: application/json
190 OpenStack-API-Version: placement 1.6 190 openstack-api-version: placement 1.6
191 data: 191 data:
192 name: CUSTOM_NFV_BAR 192 name: CUSTOM_NFV_BAR
193 status: 200 193 status: 200
@@ -252,7 +252,7 @@ tests:
252 PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS'] 252 PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
253 request_headers: 253 request_headers:
254 content-type: application/json 254 content-type: application/json
255 OpenStack-API-Version: placement 1.6 255 openstack-api-version: placement 1.6
256 data: 256 data:
257 name: *name_exceeds_max_length_check 257 name: *name_exceeds_max_length_check
258 status: 400 258 status: 400
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/resource-provider-resources-query.yaml b/nova/tests/functional/api/openstack/placement/gabbits/resource-provider-resources-query.yaml
index 2297b42..f80c175 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/resource-provider-resources-query.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/resource-provider-resources-query.yaml
@@ -7,7 +7,7 @@ defaults:
7 x-auth-token: admin 7 x-auth-token: admin
8 content-type: application/json 8 content-type: application/json
9 accept: application/json 9 accept: application/json
10 OpenStack-API-Version: placement latest 10 openstack-api-version: placement latest
11 11
12tests: 12tests:
13 13
@@ -41,7 +41,7 @@ tests:
41- name: list resource providers providing resources filter before API 1.4 41- name: list resource providers providing resources filter before API 1.4
42 GET: /resource_providers?resources=VCPU:1 42 GET: /resource_providers?resources=VCPU:1
43 request_headers: 43 request_headers:
44 OpenStack-API-Version: placement 1.3 44 openstack-api-version: placement 1.3
45 status: 400 45 status: 400
46 response_strings: 46 response_strings:
47 - 'Invalid query string parameters' 47 - 'Invalid query string parameters'
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/shared-resources.yaml b/nova/tests/functional/api/openstack/placement/gabbits/shared-resources.yaml
index 5d087f3..9bfd8b9 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/shared-resources.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/shared-resources.yaml
@@ -14,7 +14,7 @@ defaults:
14 x-auth-token: admin 14 x-auth-token: admin
15 content-type: application/json 15 content-type: application/json
16 accept: application/json 16 accept: application/json
17 OpenStack-API-Version: placement latest 17 openstack-api-version: placement latest
18 18
19tests: 19tests:
20 20
diff --git a/nova/tests/functional/api/openstack/placement/gabbits/traits.yaml b/nova/tests/functional/api/openstack/placement/gabbits/traits.yaml
index fd94d3f..c8e6ba9 100644
--- a/nova/tests/functional/api/openstack/placement/gabbits/traits.yaml
+++ b/nova/tests/functional/api/openstack/placement/gabbits/traits.yaml
@@ -5,7 +5,7 @@ fixtures:
5defaults: 5defaults:
6 request_headers: 6 request_headers:
7 x-auth-token: admin 7 x-auth-token: admin
8 OpenStack-API-Version: placement latest 8 openstack-api-version: placement latest
9 9
10tests: 10tests:
11 11