Browse Source

[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
tags/17.0.0.0b2
Chris Dent 1 year ago
parent
commit
f974e3c356

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/allocation-bad-class.yaml View File

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

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/allocations-1-8.yaml View File

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

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/allocations-bug-1714072.yaml View File

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

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/resource-class-in-use.yaml View File

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

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-6.yaml View File

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

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/resource-classes-1-7.yaml View File

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

+ 10
- 10
nova/tests/functional/api/openstack/placement/gabbits/resource-classes.yaml View File

@@ -5,14 +5,14 @@ defaults:
5 5
     request_headers:
6 6
         x-auth-token: admin
7 7
         accept: application/json
8
-        OpenStack-API-Version: placement latest
8
+        openstack-api-version: placement latest
9 9
 
10 10
 tests:
11 11
 
12 12
 - name: test microversion masks entire resource-classes endpoint with 404
13 13
   GET: /resource_classes
14 14
   request_headers:
15
-    OpenStack-API-Version: placement 1.1
15
+    openstack-api-version: placement 1.1
16 16
     content-type: application/json
17 17
   status: 404
18 18
   response_json_paths:
@@ -22,7 +22,7 @@ tests:
22 22
   desc: we want to get a 404 before a 415
23 23
   POST: /resource_classes
24 24
   request_headers:
25
-    OpenStack-API-Version: placement 1.1
25
+    openstack-api-version: placement 1.1
26 26
     content-type: text/plain
27 27
   data: data
28 28
   status: 404
@@ -31,7 +31,7 @@ tests:
31 31
   desc: we want to get a 415 when bad content type
32 32
   POST: /resource_classes
33 33
   request_headers:
34
-    OpenStack-API-Version: placement 1.2
34
+    openstack-api-version: placement 1.2
35 35
     content-type: text/plain
36 36
   data: data
37 37
   status: 415
@@ -125,7 +125,7 @@ tests:
125 125
   PUT: /resource_classes/VCPU
126 126
   request_headers:
127 127
     content-type: application/json
128
-    OpenStack-API-Version: placement 1.6
128
+    openstack-api-version: placement 1.6
129 129
   data:
130 130
       name: VCPU_ALTERNATE
131 131
   status: 400
@@ -139,7 +139,7 @@ tests:
139 139
   PUT: /resource_classes/VCPU
140 140
   request_headers:
141 141
     content-type: application/json
142
-    OpenStack-API-Version: placement 1.6
142
+    openstack-api-version: placement 1.6
143 143
   data:
144 144
       name: $ENVIRON['CUSTOM_RES_CLASS']
145 145
   status: 400
@@ -152,7 +152,7 @@ tests:
152 152
   PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
153 153
   request_headers:
154 154
     content-type: application/json
155
-    OpenStack-API-Version: placement 1.6
155
+    openstack-api-version: placement 1.6
156 156
   data:
157 157
       name: VCPU
158 158
   status: 400
@@ -173,7 +173,7 @@ tests:
173 173
   PUT: /resource_classes/CUSTOM_NFV_FOO
174 174
   request_headers:
175 175
     content-type: application/json
176
-    OpenStack-API-Version: placement 1.6
176
+    openstack-api-version: placement 1.6
177 177
   data:
178 178
       name: $ENVIRON['CUSTOM_RES_CLASS']
179 179
   status: 409
@@ -187,7 +187,7 @@ tests:
187 187
   PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
188 188
   request_headers:
189 189
     content-type: application/json
190
-    OpenStack-API-Version: placement 1.6
190
+    openstack-api-version: placement 1.6
191 191
   data:
192 192
       name: CUSTOM_NFV_BAR
193 193
   status: 200
@@ -252,7 +252,7 @@ tests:
252 252
   PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
253 253
   request_headers:
254 254
       content-type: application/json
255
-      OpenStack-API-Version: placement 1.6
255
+      openstack-api-version: placement 1.6
256 256
   data:
257 257
       name: *name_exceeds_max_length_check
258 258
   status: 400

+ 2
- 2
nova/tests/functional/api/openstack/placement/gabbits/resource-provider-resources-query.yaml View File

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

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/shared-resources.yaml View File

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

+ 1
- 1
nova/tests/functional/api/openstack/placement/gabbits/traits.yaml View File

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

Loading…
Cancel
Save