Look for api microversion header in "Vary" header data
Apache configuration adds "Accept-Encoding" to the "Vary" header
in its responses, this causes to failures in some tests which check
the "Vary" header content of the response.
In order to avoid this issue we should only check that api microversion
header axists in "Vary" header data.
Change-Id: I1490bf8f424181233aa3ea04a8410052b385699c
Related-bug: #1833766
diff --git a/manila_tempest_tests/tests/api/test_microversions.py b/manila_tempest_tests/tests/api/test_microversions.py
index 156a223..d62d35b 100644
--- a/manila_tempest_tests/tests/api/test_microversions.py
+++ b/manila_tempest_tests/tests/api/test_microversions.py
@@ -68,7 +68,8 @@
self.assertEqual({'v1.0'}, set(ids))
self.assertEqual('1.0', resp.get(API_MICROVERSIONS_HEADER_LOWER))
- self.assertEqual(API_MICROVERSIONS_HEADER, resp.get('vary'))
+ self.assertIn(API_MICROVERSIONS_HEADER,
+ resp.get('vary', '').split(','))
self.assertEqual('', version_list[0].get('min_version'))
self.assertEqual('', version_list[0].get('version'))
@@ -85,7 +86,8 @@
self.assertEqual({'v1.0'}, set(ids))
self.assertEqual('1.0', resp.get(API_MICROVERSIONS_HEADER_LOWER))
- self.assertEqual(API_MICROVERSIONS_HEADER, resp.get('vary'))
+ self.assertIn(API_MICROVERSIONS_HEADER,
+ resp.get('vary', '').split(','))
self.assertEqual('', version_list[0].get('min_version'))
self.assertEqual('', version_list[0].get('version'))
@@ -103,7 +105,8 @@
self.assertEqual(_MIN_API_VERSION,
resp.get(API_MICROVERSIONS_HEADER_LOWER))
- self.assertEqual(API_MICROVERSIONS_HEADER, resp.get('vary'))
+ self.assertIn(API_MICROVERSIONS_HEADER,
+ resp.get('vary', '').split(','))
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertNotIn(version_list[0].get('version'), [None, ''])
@@ -121,7 +124,8 @@
self.assertEqual(_MIN_API_VERSION,
resp.get(API_MICROVERSIONS_HEADER_LOWER))
- self.assertEqual(API_MICROVERSIONS_HEADER, resp.get('vary'))
+ self.assertIn(API_MICROVERSIONS_HEADER,
+ resp.get('vary', '').split(','))
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertNotIn(version_list[0].get('version'), [None, ''])
@@ -139,7 +143,8 @@
self.assertEqual(_MAX_API_VERSION,
resp.get(API_MICROVERSIONS_HEADER_LOWER))
- self.assertEqual(API_MICROVERSIONS_HEADER, resp.get('vary'))
+ self.assertIn(API_MICROVERSIONS_HEADER,
+ resp.get('vary', '').split(','))
self.assertEqual(_MIN_API_VERSION, version_list[0].get('min_version'))
self.assertNotIn(version_list[0].get('version'), [None, ''])