Remove skips in volume types tests.
This commit removes the skips from test_volume_types_extra_specs_negative
for bugs that have been marked as fixed. However, the XML client class was
not written to accept the bad input for the negative tests. So the XML
client is modified to accept this input. Additionally, the skip in
test_volume_types_negative.py was removed as well.
Change-Id: I45090c29a4115c205b656777e57a940a7de7dbf5
diff --git a/tempest/services/volume/xml/admin/volume_types_client.py b/tempest/services/volume/xml/admin/volume_types_client.py
index ba4ba67..49cbadb 100644
--- a/tempest/services/volume/xml/admin/volume_types_client.py
+++ b/tempest/services/volume/xml/admin/volume_types_client.py
@@ -149,11 +149,16 @@
url = "types/%s/extra_specs" % str(vol_type_id)
extra_specs = Element("extra_specs", xmlns=XMLNS_11)
if extra_spec:
- for key, value in extra_spec.items():
- spec = Element('extra_spec')
- spec.add_attr('key', key)
- spec.append(Text(value))
- extra_specs.append(spec)
+ if isinstance(extra_spec, list):
+ extra_specs.append(extra_spec)
+ else:
+ for key, value in extra_spec.items():
+ spec = Element('extra_spec')
+ spec.add_attr('key', key)
+ spec.append(Text(value))
+ extra_specs.append(spec)
+ else:
+ extra_specs = None
resp, body = self.post(url, str(Document(extra_specs)),
self.headers)
diff --git a/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
index 6b274c6..f528cec 100644
--- a/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/tests/volume/admin/test_volume_types_extra_specs_negative.py
@@ -79,14 +79,12 @@
self.client.create_volume_type_extra_specs,
str(uuid.uuid4()), extra_specs)
- @testtools.skip('Until bug 1090322 is fixed')
def test_create_none_body(self):
# Should not create volume type extra spec for none POST body.
self.assertRaises(exceptions.BadRequest,
self.client.create_volume_type_extra_specs,
self.volume_type['id'], None)
- @testtools.skip('Until bug 1090322 is fixed')
def test_create_invalid_body(self):
# Should not create volume type extra spec for invalid POST body.
self.assertRaises(exceptions.BadRequest,
diff --git a/tempest/tests/volume/admin/test_volume_types_negative.py b/tempest/tests/volume/admin/test_volume_types_negative.py
index c706f3d..1b11d68 100644
--- a/tempest/tests/volume/admin/test_volume_types_negative.py
+++ b/tempest/tests/volume/admin/test_volume_types_negative.py
@@ -32,7 +32,6 @@
display_name=str(uuid.uuid4()),
volume_type=str(uuid.uuid4()))
- @testtools.skip('Until bug 1090356 is fixed')
def test_create_with_empty_name(self):
# Should not be able to create volume type with an empty name.
self.assertRaises(exceptions.BadRequest,