Merge "Revert "Split up XML and JSON testing.""
diff --git a/etc/tempest.conf.sample b/etc/tempest.conf.sample
index 2c1b07c..8429cd0 100644
--- a/etc/tempest.conf.sample
+++ b/etc/tempest.conf.sample
@@ -310,10 +310,3 @@
# Status change wait interval
build_interval = 1
-
-[general]
-#This section contains configuration options that are used for all of tempest
-#that are not specific to a single project or API
-
-#Use xml containe for tests that support both JSON and XML?
-use_xml = False
diff --git a/tempest/clients.py b/tempest/clients.py
index 146acd4..ac163b6 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -141,7 +141,8 @@
Top level manager for OpenStack Compute clients
"""
- def __init__(self, username=None, password=None, tenant_name=None):
+ def __init__(self, username=None, password=None, tenant_name=None,
+ interface='json'):
"""
We allow overriding of the credentials used within the various
client classes managed by the Manager object. Left as None, the
@@ -158,10 +159,6 @@
self.username = username or self.config.compute.username
self.password = password or self.config.compute.password
self.tenant_name = tenant_name or self.config.compute.tenant_name
- if self.config.general.use_xml:
- interface = 'xml'
- else:
- interface = 'json'
if None in (self.username, self.password, self.tenant_name):
msg = ("Missing required credentials. "
@@ -232,11 +229,12 @@
managed client objects
"""
- def __init__(self):
+ def __init__(self, interface='json'):
conf = config.TempestConfig()
super(AdminManager, self).__init__(conf.compute_admin.username,
conf.compute_admin.password,
- conf.compute_admin.tenant_name)
+ conf.compute_admin.tenant_name,
+ interface=interface)
class ServiceManager(object):
@@ -259,11 +257,12 @@
managed client objects
"""
- def __init__(self):
+ def __init__(self, interface='json'):
conf = config.TempestConfig()
super(IdentityManager, self).__init__(conf.identity_admin.username,
conf.identity_admin.password,
- conf.identity_admin.tenant_name)
+ conf.identity_admin.tenant_name,
+ interface)
class IdentityNaManager(Manager):
@@ -273,8 +272,9 @@
managed client objects
"""
- def __init__(self):
+ def __init__(self, interface='json'):
conf = config.TempestConfig()
super(IdentityNaManager, self).__init__(conf.compute.username,
conf.compute.password,
- conf.compute.tenant_name)
+ conf.compute.tenant_name,
+ interface)
diff --git a/tempest/config.py b/tempest/config.py
index 66e0d5d..70b1c79 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -461,20 +461,6 @@
for opt in BotoConfig:
conf.register_opt(opt, group='boto')
-general_group = cfg.OptGroup(name='general', title='General Tempest Options')
-
-GeneralOpts = [
- cfg.BoolOpt('use_xml',
- default=False,
- help="Use xml for the container format"),
-]
-
-
-def register_general_opts(conf):
- conf.register_group(general_group)
- for opt in GeneralOpts:
- conf.register_opt(opt, group='general')
-
# TODO(jaypipes): Move this to a common utils (not data_utils...)
def singleton(cls):
@@ -532,7 +518,6 @@
register_volume_opts(cfg.CONF)
register_object_storage_opts(cfg.CONF)
register_boto_opts(cfg.CONF)
- register_general_opts(cfg.CONF)
self.compute = cfg.CONF.compute
self.compute_admin = cfg.CONF['compute-admin']
self.identity = cfg.CONF.identity
@@ -543,4 +528,3 @@
self.volume = cfg.CONF.volume
self.object_storage = cfg.CONF['object-storage']
self.boto = cfg.CONF.boto
- self.general = cfg.CONF.general
diff --git a/tempest/tests/compute/admin/test_flavors.py b/tempest/tests/compute/admin/test_flavors.py
index eb873bd..8172bd4 100644
--- a/tempest/tests/compute/admin/test_flavors.py
+++ b/tempest/tests/compute/admin/test_flavors.py
@@ -19,12 +19,9 @@
from nose.plugins.attrib import attr
import unittest2 as unittest
-from tempest import config
from tempest.tests import compute
from tempest.tests.compute import base
-CONF = config.TempestConfig()
-
class FlavorsAdminTestBase(object):
@@ -71,12 +68,12 @@
self.assertEqual(flavor['rxtx_factor'], self.rxtx)
self.assertEqual(flavor['OS-FLV-EXT-DATA:ephemeral'],
self.ephemeral)
- if CONF.general.use_xml:
+ if self._interface == "xml":
XMLNS_OS_FLV_ACCESS = "http://docs.openstack.org/compute/ext/"\
"flavor_access/api/v2"
key = "{" + XMLNS_OS_FLV_ACCESS + "}is_public"
self.assertEqual(flavor[key], "True")
- else:
+ if self._interface == "json":
self.assertEqual(flavor['os-flavor-access:is_public'], True)
#Verify flavor is retrieved
@@ -167,12 +164,12 @@
self.assertEqual(flavor['swap'], '')
self.assertEqual(int(flavor['rxtx_factor']), 1)
self.assertEqual(int(flavor['OS-FLV-EXT-DATA:ephemeral']), 0)
- if CONF.general.use_xml:
+ if self._interface == "xml":
XMLNS_OS_FLV_ACCESS = "http://docs.openstack.org/compute/ext/"\
"flavor_access/api/v2"
key = "{" + XMLNS_OS_FLV_ACCESS + "}is_public"
self.assertEqual(flavor[key], "True")
- else:
+ if self._interface == "json":
self.assertEqual(flavor['os-flavor-access:is_public'], True)
#Verify flavor is retrieved
@@ -244,11 +241,23 @@
self.client.wait_for_resource_deletion(self.new_flavor_id)
-class FlavorsAdminTest(base.BaseComputeAdminTest, base.BaseCompTest,
- FlavorsAdminTestBase):
+class FlavorsAdminTestXML(base.BaseComputeAdminTestXML,
+ base.BaseComputeTestXML,
+ FlavorsAdminTestBase):
@classmethod
def setUpClass(cls):
- super(FlavorsAdminTest, cls).setUpClass()
- base.BaseCompTest.setUpClass()
+ super(FlavorsAdminTestXML, cls).setUpClass()
+ base.BaseComputeTestXML.setUpClass()
+ FlavorsAdminTestBase.setUpClass(cls)
+
+
+class FlavorsAdminTestJSON(base.BaseComputeAdminTestJSON,
+ base.BaseComputeTestJSON,
+ FlavorsAdminTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(FlavorsAdminTestJSON, cls).setUpClass()
+ base.BaseComputeTestJSON.setUpClass()
FlavorsAdminTestBase.setUpClass(cls)
diff --git a/tempest/tests/compute/admin/test_quotas.py b/tempest/tests/compute/admin/test_quotas.py
index ca58c6a..eaf245a 100644
--- a/tempest/tests/compute/admin/test_quotas.py
+++ b/tempest/tests/compute/admin/test_quotas.py
@@ -19,10 +19,10 @@
from tempest import exceptions
from tempest.services.compute.admin.json import quotas_client as adm_quotas
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class QuotasTest(BaseCompTest):
+class QuotasTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/base.py b/tempest/tests/compute/base.py
index d1cf522..c44a2f1 100644
--- a/tempest/tests/compute/base.py
+++ b/tempest/tests/compute/base.py
@@ -26,7 +26,8 @@
from tempest import config
from tempest import exceptions
-__all__ = ['BaseCompTest', 'BaseComputeAdminTest']
+__all__ = ['BaseComputeTest', 'BaseComputeTestJSON', 'BaseComputeTestXML',
+ 'BaseComputeAdminTestJSON', 'BaseComputeAdminTestXML']
LOG = logging.getLogger(__name__)
@@ -45,9 +46,10 @@
username, tenant_name, password = creds
os = clients.Manager(username=username,
password=password,
- tenant_name=tenant_name)
+ tenant_name=tenant_name,
+ interface=cls._interface)
else:
- os = clients.Manager()
+ os = clients.Manager(interface=cls._interface)
cls.os = os
cls.servers_client = os.servers_client
@@ -76,7 +78,7 @@
"""
Returns an instance of the Identity Admin API client
"""
- os = clients.IdentityManager()
+ os = clients.IdentityManager(interface=cls._interface)
admin_client = os.admin_client
return admin_client
@@ -225,6 +227,23 @@
time.sleep(self.build_interval)
+class BaseComputeTestJSON(BaseCompTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(BaseComputeTestJSON, cls).setUpClass()
+
+# NOTE(danms): For transition, keep the old name active as JSON
+BaseComputeTest = BaseComputeTestJSON
+
+
+class BaseComputeTestXML(BaseCompTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "xml"
+ super(BaseComputeTestXML, cls).setUpClass()
+
+
class BaseComputeAdminTest(unittest.TestCase):
"""Base test case class for all Compute Admin API tests."""
@@ -241,4 +260,18 @@
"in configuration.")
raise nose.SkipTest(msg)
- cls.os = clients.AdminManager()
+ cls.os = clients.AdminManager(interface=cls._interface)
+
+
+class BaseComputeAdminTestJSON(BaseComputeAdminTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(BaseComputeAdminTestJSON, cls).setUpClass()
+
+
+class BaseComputeAdminTestXML(BaseComputeAdminTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "xml"
+ super(BaseComputeAdminTestXML, cls).setUpClass()
diff --git a/tempest/tests/compute/flavors/test_flavors.py b/tempest/tests/compute/flavors/test_flavors.py
index bf56464..53cad65 100644
--- a/tempest/tests/compute/flavors/test_flavors.py
+++ b/tempest/tests/compute/flavors/test_flavors.py
@@ -137,9 +137,19 @@
9999)
-class FlavorsTest(base.BaseCompTest, FlavorsTestBase):
+class FlavorsTestXML(base.BaseComputeTestXML,
+ FlavorsTestBase):
@classmethod
def setUpClass(cls):
- super(FlavorsTest, cls).setUpClass()
+ super(FlavorsTestXML, cls).setUpClass()
+ cls.client = cls.flavors_client
+
+
+class FlavorsTestJSON(base.BaseComputeTestJSON,
+ FlavorsTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(FlavorsTestJSON, cls).setUpClass()
cls.client = cls.flavors_client
diff --git a/tempest/tests/compute/floating_ips/test_floating_ips_actions.py b/tempest/tests/compute/floating_ips/test_floating_ips_actions.py
index e81022c..9a9914a 100644
--- a/tempest/tests/compute/floating_ips/test_floating_ips_actions.py
+++ b/tempest/tests/compute/floating_ips/test_floating_ips_actions.py
@@ -205,13 +205,25 @@
' with out passing floating IP should raise BadRequest')
-class FloatingIPsTest(base.BaseCompTest, FloatingIPsTestBase):
+class FloatingIPsTestJSON(base.BaseComputeTestJSON, FloatingIPsTestBase):
@classmethod
def setUpClass(cls):
- super(FloatingIPsTest, cls).setUpClass()
+ super(FloatingIPsTestJSON, cls).setUpClass()
FloatingIPsTestBase.setUpClass(cls)
@classmethod
def tearDownClass(cls):
FloatingIPsTestBase.tearDownClass(cls)
- super(FloatingIPsTest, cls).tearDownClass()
+ super(FloatingIPsTestJSON, cls).tearDownClass()
+
+
+class FloatingIPsTestXML(base.BaseComputeTestXML, FloatingIPsTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(FloatingIPsTestXML, cls).setUpClass()
+ FloatingIPsTestBase.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ FloatingIPsTestBase.tearDownClass(cls)
+ super(FloatingIPsTestXML, cls).tearDownClass()
diff --git a/tempest/tests/compute/floating_ips/test_list_floating_ips.py b/tempest/tests/compute/floating_ips/test_list_floating_ips.py
index 4fbe4eb..9eec27c 100644
--- a/tempest/tests/compute/floating_ips/test_list_floating_ips.py
+++ b/tempest/tests/compute/floating_ips/test_list_floating_ips.py
@@ -99,13 +99,27 @@
'nonexistant floating IP')
-class FloatingIPDetailsTest(base.BaseCompTest, FloatingIPDetailsTestBase):
+class FloatingIPDetailsTestJSON(base.BaseComputeTestJSON,
+ FloatingIPDetailsTestBase):
@classmethod
def setUpClass(cls):
- super(FloatingIPDetailsTest, cls).setUpClass()
+ super(FloatingIPDetailsTestJSON, cls).setUpClass()
FloatingIPDetailsTestBase.setUpClass(cls)
@classmethod
def tearDownClass(cls):
FloatingIPDetailsTestBase.tearDownClass(cls)
- super(FloatingIPDetailsTest, cls).tearDownClass()
+ super(FloatingIPDetailsTestJSON, cls).tearDownClass()
+
+
+class FloatingIPDetailsTestXML(base.BaseComputeTestXML,
+ FloatingIPDetailsTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(FloatingIPDetailsTestXML, cls).setUpClass()
+ FloatingIPDetailsTestBase.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ FloatingIPDetailsTestBase.tearDownClass(cls)
+ super(FloatingIPDetailsTestXML, cls).tearDownClass()
diff --git a/tempest/tests/compute/images/test_image_metadata.py b/tempest/tests/compute/images/test_image_metadata.py
index 66c051e..cdf4249 100644
--- a/tempest/tests/compute/images/test_image_metadata.py
+++ b/tempest/tests/compute/images/test_image_metadata.py
@@ -19,10 +19,10 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class ImagesMetadataTest(BaseCompTest):
+class ImagesMetadataTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/images/test_images.py b/tempest/tests/compute/images/test_images.py
index 8bea257..2557f16 100644
--- a/tempest/tests/compute/images/test_images.py
+++ b/tempest/tests/compute/images/test_images.py
@@ -213,13 +213,40 @@
"exceeds 35 character ID length limit")
-class ImagesTest(base.BaseCompTest, ImagesTestBase):
+class ImagesTestJSON(base.BaseComputeTestJSON,
+ ImagesTestBase):
def tearDown(self):
ImagesTestBase.tearDown(self)
@classmethod
def setUpClass(cls):
- super(ImagesTest, cls).setUpClass()
+ super(ImagesTestJSON, cls).setUpClass()
+ cls.client = cls.images_client
+ cls.servers_client = cls.servers_client
+
+ cls.image_ids = []
+
+ if compute.MULTI_USER:
+ if cls.config.compute.allow_tenant_isolation:
+ creds = cls._get_isolated_creds()
+ username, tenant_name, password = creds
+ cls.alt_manager = clients.Manager(username=username,
+ password=password,
+ tenant_name=tenant_name)
+ else:
+ # Use the alt_XXX credentials in the config file
+ cls.alt_manager = clients.AltManager()
+ cls.alt_client = cls.alt_manager.images_client
+
+
+class ImagesTestXML(base.BaseComputeTestXML,
+ ImagesTestBase):
+ def tearDown(self):
+ ImagesTestBase.tearDown(self)
+
+ @classmethod
+ def setUpClass(cls):
+ super(ImagesTestXML, cls).setUpClass()
cls.client = cls.images_client
cls.servers_client = cls.servers_client
diff --git a/tempest/tests/compute/images/test_images_oneserver.py b/tempest/tests/compute/images/test_images_oneserver.py
index 27c73f4..f8b560b 100644
--- a/tempest/tests/compute/images/test_images_oneserver.py
+++ b/tempest/tests/compute/images/test_images_oneserver.py
@@ -187,14 +187,43 @@
self.assertRaises(exceptions.NotFound, self.client.get_image, image_id)
-class ImagesOneServerTest(base.BaseCompTest, ImagesOneServerTestBase):
+class ImagesOneServerTestJSON(base.BaseComputeTestJSON,
+ ImagesOneServerTestBase):
def tearDown(self):
ImagesOneServerTestBase.tearDown(self)
@classmethod
def setUpClass(cls):
- super(ImagesOneServerTest, cls).setUpClass()
+ super(ImagesOneServerTestJSON, cls).setUpClass()
+ cls.client = cls.images_client
+ cls.servers_client = cls.servers_client
+ cls.server = cls.create_server()
+
+ cls.image_ids = []
+
+ if compute.MULTI_USER:
+ if cls.config.compute.allow_tenant_isolation:
+ creds = cls._get_isolated_creds()
+ username, tenant_name, password = creds
+ cls.alt_manager = clients.Manager(username=username,
+ password=password,
+ tenant_name=tenant_name)
+ else:
+ # Use the alt_XXX credentials in the config file
+ cls.alt_manager = clients.AltManager()
+ cls.alt_client = cls.alt_manager.images_client
+
+
+class ImagesOneServerTestXML(base.BaseComputeTestXML,
+ ImagesOneServerTestBase):
+
+ def tearDown(self):
+ ImagesOneServerTestBase.tearDown(self)
+
+ @classmethod
+ def setUpClass(cls):
+ super(ImagesOneServerTestXML, cls).setUpClass()
cls.client = cls.images_client
cls.servers_client = cls.servers_client
cls.server = cls.create_server()
diff --git a/tempest/tests/compute/images/test_images_whitebox.py b/tempest/tests/compute/images/test_images_whitebox.py
index a615761..2987534 100644
--- a/tempest/tests/compute/images/test_images_whitebox.py
+++ b/tempest/tests/compute/images/test_images_whitebox.py
@@ -24,7 +24,7 @@
@attr(type='whitebox')
-class ImagesWhiteboxTest(whitebox.ComputeWhiteboxTest, base.BaseCompTest):
+class ImagesWhiteboxTest(whitebox.ComputeWhiteboxTest, base.BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/images/test_list_image_filters.py b/tempest/tests/compute/images/test_list_image_filters.py
index 1b1baff..26119e3 100644
--- a/tempest/tests/compute/images/test_list_image_filters.py
+++ b/tempest/tests/compute/images/test_list_image_filters.py
@@ -20,10 +20,10 @@
from tempest.common.utils.data_utils import parse_image_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class ListImageFiltersTest(BaseCompTest):
+class ListImageFiltersTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/images/test_list_images.py b/tempest/tests/compute/images/test_list_images.py
index 6b5ca10..da92ca8 100644
--- a/tempest/tests/compute/images/test_list_images.py
+++ b/tempest/tests/compute/images/test_list_images.py
@@ -20,10 +20,10 @@
from tempest.common.utils.data_utils import parse_image_id
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class ListImagesTest(BaseCompTest):
+class ListImagesTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/keypairs/test_keypairs.py b/tempest/tests/compute/keypairs/test_keypairs.py
index e3a97cf..7d95a9b 100644
--- a/tempest/tests/compute/keypairs/test_keypairs.py
+++ b/tempest/tests/compute/keypairs/test_keypairs.py
@@ -20,7 +20,8 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTestJSON
+from tempest.tests.compute.base import BaseComputeTestXML
class KeyPairsTestBase(object):
@@ -221,8 +222,15 @@
self.fail('invalid name')
-class KeyPairsTest(BaseCompTest, KeyPairsTestBase):
+class KeyPairsTestXML(BaseComputeTestXML, KeyPairsTestBase):
@classmethod
def setUpClass(cls):
- super(KeyPairsTest, cls).setUpClass()
+ super(KeyPairsTestXML, cls).setUpClass()
+ cls.client = cls.keypairs_client
+
+
+class KeyPairsTestJSON(BaseComputeTestJSON, KeyPairsTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(KeyPairsTestJSON, cls).setUpClass()
cls.client = cls.keypairs_client
diff --git a/tempest/tests/compute/limits/test_absolute_limits.py b/tempest/tests/compute/limits/test_absolute_limits.py
index 2e201fe..89c5b25 100644
--- a/tempest/tests/compute/limits/test_absolute_limits.py
+++ b/tempest/tests/compute/limits/test_absolute_limits.py
@@ -20,7 +20,7 @@
from tempest.tests.compute import base
-class AbsoluteLimitsTestBase(object):
+class AbsoluteLimitsTest(object):
@staticmethod
def setUpClass(cls):
@@ -50,8 +50,17 @@
% ', '.join(ele for ele in missing_elements))
-class AbsoluteLimitsTest(base.BaseCompTest, AbsoluteLimitsTestBase):
+class AbsoluteLimitsTestJSON(base.BaseComputeTestJSON,
+ AbsoluteLimitsTest):
@classmethod
def setUpClass(cls):
- super(AbsoluteLimitsTest, cls).setUpClass()
- AbsoluteLimitsTestBase.setUpClass(cls)
+ super(AbsoluteLimitsTestJSON, cls).setUpClass()
+ AbsoluteLimitsTest.setUpClass(cls)
+
+
+class AbsoluteLimitsTestXML(base.BaseComputeTestXML,
+ AbsoluteLimitsTest):
+ @classmethod
+ def setUpClass(cls):
+ super(AbsoluteLimitsTestXML, cls).setUpClass()
+ AbsoluteLimitsTest.setUpClass(cls)
diff --git a/tempest/tests/compute/security_groups/test_security_group_rules.py b/tempest/tests/compute/security_groups/test_security_group_rules.py
index 19e10a4..805adf4 100644
--- a/tempest/tests/compute/security_groups/test_security_group_rules.py
+++ b/tempest/tests/compute/security_groups/test_security_group_rules.py
@@ -22,7 +22,7 @@
from tempest.tests.compute import base
-class SecurityGroupRulesTestBase(object):
+class SecurityGroupRulesTest(object):
@staticmethod
def setUpClass(cls):
@@ -244,8 +244,17 @@
'with nonexistant rule id')
-class SecurityGroupRulesTest(base.BaseCompTest, SecurityGroupRulesTestBase):
+class SecurityGroupRulesTestJSON(base.BaseComputeTestJSON,
+ SecurityGroupRulesTest):
@classmethod
def setUpClass(cls):
- super(SecurityGroupRulesTest, cls).setUpClass()
- SecurityGroupRulesTestBase.setUpClass(cls)
+ super(SecurityGroupRulesTestJSON, cls).setUpClass()
+ SecurityGroupRulesTest.setUpClass(cls)
+
+
+class SecurityGroupRulesTestXML(base.BaseComputeTestXML,
+ SecurityGroupRulesTest):
+ @classmethod
+ def setUpClass(cls):
+ super(SecurityGroupRulesTestXML, cls).setUpClass()
+ SecurityGroupRulesTest.setUpClass(cls)
diff --git a/tempest/tests/compute/security_groups/test_security_groups.py b/tempest/tests/compute/security_groups/test_security_groups.py
index 51bea0d..5c0bd82 100644
--- a/tempest/tests/compute/security_groups/test_security_groups.py
+++ b/tempest/tests/compute/security_groups/test_security_groups.py
@@ -22,7 +22,7 @@
from tempest.tests.compute import base
-class SecurityGroupsTestBase(object):
+class SecurityGroupsTest(object):
@staticmethod
def setUpClass(cls):
@@ -298,8 +298,17 @@
self.assertEqual(202, resp.status)
-class SecurityGroupsTest(base.BaseCompTest, SecurityGroupsTestBase):
+class SecurityGroupsTestJSON(base.BaseComputeTestJSON,
+ SecurityGroupsTest):
@classmethod
def setUpClass(cls):
- super(SecurityGroupsTest, cls).setUpClass()
- SecurityGroupsTestBase.setUpClass(cls)
+ super(SecurityGroupsTestJSON, cls).setUpClass()
+ SecurityGroupsTest.setUpClass(cls)
+
+
+class SecurityGroupsTestXML(base.BaseComputeTestXML,
+ SecurityGroupsTest):
+ @classmethod
+ def setUpClass(cls):
+ super(SecurityGroupsTestXML, cls).setUpClass()
+ SecurityGroupsTest.setUpClass(cls)
diff --git a/tempest/tests/compute/servers/test_console_output.py b/tempest/tests/compute/servers/test_console_output.py
index 34ff614..3ad29a1 100644
--- a/tempest/tests/compute/servers/test_console_output.py
+++ b/tempest/tests/compute/servers/test_console_output.py
@@ -23,7 +23,7 @@
from tempest.tests.compute import base
-class ConsoleOutputTestBase(object):
+class ConsoleOutputTest(object):
@classmethod
def setUpClass(self, cls):
@@ -87,13 +87,28 @@
@attr(type='smoke')
-class ConsoleOutputTest(base.BaseCompTest, ConsoleOutputTestBase):
+class ConsoleOutputTestJSON(base.BaseComputeTestJSON,
+ ConsoleOutputTest):
@classmethod
def setUpClass(cls):
- super(ConsoleOutputTest, cls).setUpClass()
- ConsoleOutputTestBase.setUpClass(cls)
+ super(ConsoleOutputTestJSON, cls).setUpClass()
+ ConsoleOutputTest.setUpClass(cls)
@classmethod
def tearDownClass(cls):
- ConsoleOutputTestBase.tearDownClass(cls)
- super(ConsoleOutputTest, cls).tearDownClass()
+ ConsoleOutputTest.tearDownClass(cls)
+ super(ConsoleOutputTestJSON, cls).tearDownClass()
+
+
+@attr(type='smoke')
+class ConsoleOutputTestXML(base.BaseComputeTestXML,
+ ConsoleOutputTest):
+ @classmethod
+ def setUpClass(cls):
+ super(ConsoleOutputTestXML, cls).setUpClass()
+ ConsoleOutputTest.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ ConsoleOutputTest.tearDownClass(cls)
+ super(ConsoleOutputTestXML, cls).tearDownClass()
diff --git a/tempest/tests/compute/servers/test_create_server.py b/tempest/tests/compute/servers/test_create_server.py
index c655d18..c5a54dc 100644
--- a/tempest/tests/compute/servers/test_create_server.py
+++ b/tempest/tests/compute/servers/test_create_server.py
@@ -29,7 +29,7 @@
from tempest.tests.compute import base
-class ServersTestBase(object):
+class ServersTest(object):
run_ssh = tempest.config.TempestConfig().compute.run_ssh
@@ -122,7 +122,8 @@
@attr(type='positive')
-class ServersTestAutoDisk(base.BaseCompTest, ServersTestBase):
+class ServersTestAutoDisk(base.BaseComputeTestJSON,
+ ServersTest):
@classmethod
def setUpClass(cls):
if not compute.DISK_CONFIG_ENABLED:
@@ -130,16 +131,17 @@
raise nose.SkipTest(msg)
super(ServersTestAutoDisk, cls).setUpClass()
cls.disk_config = 'AUTO'
- ServersTestBase.setUpClass(cls)
+ ServersTest.setUpClass(cls)
@classmethod
def tearDownClass(cls):
- ServersTestBase.tearDownClass(cls)
+ ServersTest.tearDownClass(cls)
super(ServersTestAutoDisk, cls).tearDownClass()
@attr(type='positive')
-class ServersTestManualDisk(base.BaseCompTest, ServersTestBase):
+class ServersTestManualDisk(base.BaseComputeTestJSON,
+ ServersTest):
@classmethod
def setUpClass(cls):
if not compute.DISK_CONFIG_ENABLED:
@@ -147,23 +149,39 @@
raise nose.SkipTest(msg)
super(ServersTestManualDisk, cls).setUpClass()
cls.disk_config = 'MANUAL'
- ServersTestBase.setUpClass(cls)
+ ServersTest.setUpClass(cls)
@classmethod
def tearDownClass(cls):
- ServersTestBase.tearDownClass(cls)
+ ServersTest.tearDownClass(cls)
super(ServersTestManualDisk, cls).tearDownClass()
@attr(type='smoke')
-class ServersTest(base.BaseCompTest, ServersTestBase):
+class ServersTestJSON(base.BaseComputeTestJSON,
+ ServersTest):
@classmethod
def setUpClass(cls):
- super(ServersTest, cls).setUpClass()
+ super(ServersTestJSON, cls).setUpClass()
cls.disk_config = None
- ServersTestBase.setUpClass(cls)
+ ServersTest.setUpClass(cls)
@classmethod
def tearDownClass(cls):
- ServersTestBase.tearDownClass(cls)
- super(ServersTest, cls).tearDownClass()
+ ServersTest.tearDownClass(cls)
+ super(ServersTestJSON, cls).tearDownClass()
+
+
+@attr(type='smoke')
+class ServersTestXML(base.BaseComputeTestXML,
+ ServersTest):
+ @classmethod
+ def setUpClass(cls):
+ super(ServersTestXML, cls).setUpClass()
+ cls.disk_config = None
+ ServersTest.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ ServersTest.tearDownClass(cls)
+ super(ServersTestXML, cls).tearDownClass()
diff --git a/tempest/tests/compute/servers/test_disk_config.py b/tempest/tests/compute/servers/test_disk_config.py
index ff04bbc..490156b 100644
--- a/tempest/tests/compute/servers/test_disk_config.py
+++ b/tempest/tests/compute/servers/test_disk_config.py
@@ -22,10 +22,10 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.tests import compute
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class TestServerDiskConfig(BaseCompTest):
+class TestServerDiskConfig(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/servers/test_list_server_filters.py b/tempest/tests/compute/servers/test_list_server_filters.py
index 1f3e48b..d943e5d 100644
--- a/tempest/tests/compute/servers/test_list_server_filters.py
+++ b/tempest/tests/compute/servers/test_list_server_filters.py
@@ -27,7 +27,7 @@
from tempest.tests import utils
-class ListServerFiltersTestBase(object):
+class ListServerFiltersTest(object):
@staticmethod
def setUpClass(cls):
@@ -204,13 +204,27 @@
return min_detail
-class ListServerFiltersTest(base.BaseCompTest, ListServerFiltersTestBase):
+class ListServerFiltersTestJSON(base.BaseComputeTestJSON,
+ ListServerFiltersTest):
@classmethod
def setUpClass(cls):
- super(ListServerFiltersTest, cls).setUpClass()
- ListServerFiltersTestBase.setUpClass(cls)
+ super(ListServerFiltersTestJSON, cls).setUpClass()
+ ListServerFiltersTest.setUpClass(cls)
@classmethod
def tearDownClass(cls):
- super(ListServerFiltersTest, cls).tearDownClass()
- ListServerFiltersTestBase.tearDownClass(cls)
+ super(ListServerFiltersTestJSON, cls).tearDownClass()
+ ListServerFiltersTest.tearDownClass(cls)
+
+
+class ListServerFiltersTestXML(base.BaseComputeTestXML,
+ ListServerFiltersTest):
+ @classmethod
+ def setUpClass(cls):
+ super(ListServerFiltersTestXML, cls).setUpClass()
+ ListServerFiltersTest.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ super(ListServerFiltersTestXML, cls).tearDownClass()
+ ListServerFiltersTest.tearDownClass(cls)
diff --git a/tempest/tests/compute/servers/test_list_servers_negative.py b/tempest/tests/compute/servers/test_list_servers_negative.py
index 66441c4..035ffe8 100644
--- a/tempest/tests/compute/servers/test_list_servers_negative.py
+++ b/tempest/tests/compute/servers/test_list_servers_negative.py
@@ -25,10 +25,10 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.tests import compute
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class ListServersNegativeTest(BaseCompTest):
+class ListServersNegativeTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/servers/test_server_actions.py b/tempest/tests/compute/servers/test_server_actions.py
index a2c5d5c..2fe8464 100644
--- a/tempest/tests/compute/servers/test_server_actions.py
+++ b/tempest/tests/compute/servers/test_server_actions.py
@@ -193,9 +193,10 @@
' be allowed')
-class ServerActionsTest(base.BaseCompTest, ServerActionsTestBase):
+class ServerActionsTestXML(base.BaseComputeTestXML,
+ ServerActionsTestBase):
def setUp(self):
- super(ServerActionsTest, self).setUp()
+ super(ServerActionsTestXML, self).setUp()
# Check if the server is in a clean state after test
try:
self.client.wait_for_server_status(self.server_id, 'ACTIVE')
@@ -211,7 +212,7 @@
@classmethod
def setUpClass(cls):
- super(ServerActionsTest, cls).setUpClass()
+ super(ServerActionsTestXML, cls).setUpClass()
cls.client = cls.servers_client
cls.name = rand_name('server')
resp, server = cls.create_server_with_extras(cls.name,
@@ -224,4 +225,39 @@
@classmethod
def tearDownClass(cls):
cls.clear_servers()
- super(ServerActionsTest, cls).tearDownClass()
+ super(ServerActionsTestXML, cls).tearDownClass()
+
+
+class ServerActionsTestJSON(base.BaseComputeTestJSON,
+ ServerActionsTestBase):
+ def setUp(self):
+ super(ServerActionsTestJSON, self).setUp()
+ # Check if the server is in a clean state after test
+ try:
+ self.client.wait_for_server_status(self.server_id, 'ACTIVE')
+ except exceptions:
+ # Rebuild server if something happened to it during a test
+ self.clear_servers()
+ resp, server = self.create_server_with_extras(self.name,
+ self.image_ref,
+ self.flavor_ref)
+ self.server_id = server['id']
+ self.password = server['adminPass']
+ self.client.wait_for_server_status(self.server_id, 'ACTIVE')
+
+ @classmethod
+ def setUpClass(cls):
+ super(ServerActionsTestJSON, cls).setUpClass()
+ cls.client = cls.servers_client
+ cls.name = rand_name('server')
+ resp, server = cls.create_server_with_extras(cls.name,
+ cls.image_ref,
+ cls.flavor_ref)
+ cls.server_id = server['id']
+ cls.password = server['adminPass']
+ cls.client.wait_for_server_status(cls.server_id, 'ACTIVE')
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.clear_servers()
+ super(ServerActionsTestJSON, cls).tearDownClass()
diff --git a/tempest/tests/compute/servers/test_server_addresses.py b/tempest/tests/compute/servers/test_server_addresses.py
index ee0dbb0..6e819a2 100644
--- a/tempest/tests/compute/servers/test_server_addresses.py
+++ b/tempest/tests/compute/servers/test_server_addresses.py
@@ -19,10 +19,10 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class ServerAddressesTest(BaseCompTest):
+class ServerAddressesTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/servers/test_server_metadata.py b/tempest/tests/compute/servers/test_server_metadata.py
index b1e82be..6c44c3c 100644
--- a/tempest/tests/compute/servers/test_server_metadata.py
+++ b/tempest/tests/compute/servers/test_server_metadata.py
@@ -19,10 +19,10 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class ServerMetadataTest(BaseCompTest):
+class ServerMetadataTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/servers/test_server_personality.py b/tempest/tests/compute/servers/test_server_personality.py
index 23222b5..6ea0959 100644
--- a/tempest/tests/compute/servers/test_server_personality.py
+++ b/tempest/tests/compute/servers/test_server_personality.py
@@ -78,9 +78,21 @@
self.client.delete_server(server['id'])
-class ServerPersonalityTest(base.BaseCompTest, ServerPersonalityTestBase):
+class ServerPersonalityTestXML(base.BaseComputeTestXML,
+ ServerPersonalityTestBase):
@classmethod
def setUpClass(cls):
- super(ServerPersonalityTest, cls).setUpClass()
+ cls._interface = "xml"
+ super(ServerPersonalityTestXML, cls).setUpClass()
+ cls.client = cls.servers_client
+ cls.user_client = cls.limits_client
+
+
+class ServerPersonalityTestJSON(base.BaseComputeTestJSON,
+ ServerPersonalityTestBase):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(ServerPersonalityTestJSON, cls).setUpClass()
cls.client = cls.servers_client
cls.user_client = cls.limits_client
diff --git a/tempest/tests/compute/servers/test_servers.py b/tempest/tests/compute/servers/test_servers.py
index 5829835..3566ef4 100644
--- a/tempest/tests/compute/servers/test_servers.py
+++ b/tempest/tests/compute/servers/test_servers.py
@@ -156,10 +156,10 @@
self.assertEqual('204', resp['status'])
-class ServersTest(base.BaseCompTest, ServersTestBase):
+class ServersTestJSON(base.BaseComputeTestJSON, ServersTestBase):
@classmethod
def setUpClass(cls):
- super(ServersTest, cls).setUpClass()
+ super(ServersTestJSON, cls).setUpClass()
cls.client = cls.servers_client
def tearDown(self):
@@ -169,4 +169,20 @@
# memory
self.clear_servers()
- super(ServersTest, self).tearDown()
+ super(ServersTestJSON, self).tearDown()
+
+
+class ServersTestXML(base.BaseComputeTestXML, ServersTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(ServersTestXML, cls).setUpClass()
+ cls.client = cls.servers_client
+
+ def tearDown(self):
+ # clean up any remaining servers and wait for them to fully
+ # delete. This is done because delete calls are async, and if
+ # deletes are running slow we could very well overrun system
+ # memory
+ self.clear_servers()
+
+ super(ServersTestXML, self).tearDown()
diff --git a/tempest/tests/compute/servers/test_servers_negative.py b/tempest/tests/compute/servers/test_servers_negative.py
index 4ff7f12..dfe5944 100644
--- a/tempest/tests/compute/servers/test_servers_negative.py
+++ b/tempest/tests/compute/servers/test_servers_negative.py
@@ -24,10 +24,10 @@
from tempest import clients
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class ServersNegativeTest(BaseCompTest):
+class ServersNegativeTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/test_authorization.py b/tempest/tests/compute/test_authorization.py
index ff38eee..78661d1 100644
--- a/tempest/tests/compute/test_authorization.py
+++ b/tempest/tests/compute/test_authorization.py
@@ -25,10 +25,10 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
from tempest.tests import compute
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class AuthorizationTest(BaseCompTest):
+class AuthorizationTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/test_extensions.py b/tempest/tests/compute/test_extensions.py
index dc14138..829e295 100644
--- a/tempest/tests/compute/test_extensions.py
+++ b/tempest/tests/compute/test_extensions.py
@@ -30,9 +30,17 @@
self.assertEqual(200, resp.status)
-class ExtensionsTest(base.BaseCompTest):
+class ExtensionsTestJSON(base.BaseComputeTest, ExtensionsTestBase):
@classmethod
def setUpClass(cls):
- super(ExtensionsTest, cls).setUpClass()
+ super(ExtensionsTestJSON, cls).setUpClass()
+ cls.client = cls.extensions_client
+
+
+class ExtensionsTestXML(base.BaseComputeTestXML, ExtensionsTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(ExtensionsTestXML, cls).setUpClass()
cls.client = cls.extensions_client
diff --git a/tempest/tests/compute/test_live_block_migration.py b/tempest/tests/compute/test_live_block_migration.py
index 53f3ac0..915868c 100644
--- a/tempest/tests/compute/test_live_block_migration.py
+++ b/tempest/tests/compute/test_live_block_migration.py
@@ -31,7 +31,7 @@
@attr(category='live-migration')
-class LiveBlockMigrationTest(base.BaseCompTest):
+class LiveBlockMigrationTest(base.BaseComputeTest):
live_migration_available = (
config.TempestConfig().compute.live_migration_available)
diff --git a/tempest/tests/compute/test_quotas.py b/tempest/tests/compute/test_quotas.py
index 5d06273..3dc2515 100644
--- a/tempest/tests/compute/test_quotas.py
+++ b/tempest/tests/compute/test_quotas.py
@@ -17,10 +17,10 @@
from nose.plugins.attrib import attr
-from tempest.tests.compute.base import BaseCompTest
+from tempest.tests.compute.base import BaseComputeTest
-class QuotasTest(BaseCompTest):
+class QuotasTest(BaseComputeTest):
@classmethod
def setUpClass(cls):
diff --git a/tempest/tests/compute/volumes/test_attach_volume.py b/tempest/tests/compute/volumes/test_attach_volume.py
index 792bedf..9581026 100644
--- a/tempest/tests/compute/volumes/test_attach_volume.py
+++ b/tempest/tests/compute/volumes/test_attach_volume.py
@@ -107,8 +107,17 @@
self._delete(server['id'], volume['id'])
-class TestAttachVolume(base.BaseCompTest, AttachVolumeTest):
+class TestAttachVolumeJSON(base.BaseComputeTestJSON,
+ AttachVolumeTest):
@classmethod
def setUpClass(cls):
- super(TestAttachVolume, cls).setUpClass()
+ super(TestAttachVolumeJSON, cls).setUpClass()
+ AttachVolumeTest.setUpClass(cls)
+
+
+class TestAttachVolumeXML(base.BaseComputeTestXML,
+ AttachVolumeTest):
+ @classmethod
+ def setUpClass(cls):
+ super(TestAttachVolumeXML, cls).setUpClass()
AttachVolumeTest.setUpClass(cls)
diff --git a/tempest/tests/compute/volumes/test_volumes_get.py b/tempest/tests/compute/volumes/test_volumes_get.py
index 45f8053..afb00cd 100644
--- a/tempest/tests/compute/volumes/test_volumes_get.py
+++ b/tempest/tests/compute/volumes/test_volumes_get.py
@@ -28,7 +28,7 @@
# CREATE, GET, DELETE Volume
volume = None
try:
- v_name = rand_name('Volume-')
+ v_name = rand_name('Volume-%s-') % self._interface
metadata = {'Type': 'work'}
#Create volume
resp, volume = self.client.create_volume(size=1,
@@ -95,8 +95,17 @@
self.client.wait_for_resource_deletion(volume['id'])
-class VolumesGetTest(base.BaseCompTest, VolumesGetTestBase):
+class VolumesGetTestXML(base.BaseComputeTestXML, VolumesGetTestBase):
@classmethod
def setUpClass(cls):
- super(VolumesGetTest, cls).setUpClass()
+ cls._interface = "xml"
+ super(VolumesGetTestXML, cls).setUpClass()
+ cls.client = cls.volumes_extensions_client
+
+
+class VolumesGetTestJSON(base.BaseComputeTestJSON, VolumesGetTestBase):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(VolumesGetTestJSON, cls).setUpClass()
cls.client = cls.volumes_extensions_client
diff --git a/tempest/tests/compute/volumes/test_volumes_list.py b/tempest/tests/compute/volumes/test_volumes_list.py
index 6ec03ae..fef9c8d 100644
--- a/tempest/tests/compute/volumes/test_volumes_list.py
+++ b/tempest/tests/compute/volumes/test_volumes_list.py
@@ -62,17 +62,19 @@
for m_vol in missing_volumes))
-class VolumesTest(base.BaseCompTest, VolumesTestBase):
+class VolumesTestXML(base.BaseComputeTestXML, VolumesTestBase):
@classmethod
def setUpClass(cls):
- super(VolumesTest, cls).setUpClass()
+ cls._interface = 'xml'
+ super(VolumesTestXML, cls).setUpClass()
cls.client = cls.volumes_extensions_client
# Create 3 Volumes
- cls.volume_list = []
- cls.volume_id_list = []
+ cls.volume_list = list()
+ cls.volume_id_list = list()
for i in range(3):
- v_name = rand_name('volume-%s')
+ v_name = rand_name('volume')
metadata = {'Type': 'work'}
+ v_name += cls._interface
try:
resp, volume = cls.client.create_volume(size=1,
display_name=v_name,
@@ -103,4 +105,50 @@
for volume in cls.volume_list:
resp, _ = cls.client.delete_volume(volume['id'])
cls.client.wait_for_resource_deletion(volume['id'])
- super(VolumesTest, cls).tearDownClass()
+ super(VolumesTestXML, cls).tearDownClass()
+
+
+class VolumesTestJSON(base.BaseComputeTestJSON, VolumesTestBase):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = 'json'
+ super(VolumesTestJSON, cls).setUpClass()
+ cls.client = cls.volumes_extensions_client
+ # Create 3 Volumes
+ cls.volume_list = []
+ cls.volume_id_list = []
+ for i in range(3):
+ v_name = rand_name('volume-%s')
+ metadata = {'Type': 'work'}
+ v_name += cls._interface
+ try:
+ resp, volume = cls.client.create_volume(size=1,
+ display_name=v_name,
+ metadata=metadata)
+ cls.client.wait_for_volume_status(volume['id'], 'available')
+ resp, volume = cls.client.get_volume(volume['id'])
+ cls.volume_list.append(volume)
+ cls.volume_id_list.append(volume['id'])
+ except Exception:
+ if cls.volume_list:
+ # We could not create all the volumes, though we were able
+ # to create *some* of the volumes. This is typically
+ # because the backing file size of the volume group is
+ # too small. So, here, we clean up whatever we did manage
+ # to create and raise a SkipTest
+ for volume in cls.volume_list:
+ cls.client.delete_volume(volume)
+ msg = ("Failed to create ALL necessary volumes to run "
+ "test. This typically means that the backing file "
+ "size of the nova-volumes group is too small to "
+ "create the 3 volumes needed by this test case")
+ raise nose.SkipTest(msg)
+ raise
+
+ @classmethod
+ def tearDownClass(cls):
+ # Delete the created Volumes
+ for volume in cls.volume_list:
+ resp, _ = cls.client.delete_volume(volume['id'])
+ cls.client.wait_for_resource_deletion(volume['id'])
+ super(VolumesTestJSON, cls).tearDownClass()
diff --git a/tempest/tests/compute/volumes/test_volumes_negative.py b/tempest/tests/compute/volumes/test_volumes_negative.py
index bdd6b2f..d2ad30e 100644
--- a/tempest/tests/compute/volumes/test_volumes_negative.py
+++ b/tempest/tests/compute/volumes/test_volumes_negative.py
@@ -124,8 +124,19 @@
resp, volume = self.client.delete_volume('')
-class VolumesNegativeTest(base.BaseCompTest, VolumesNegativeTestBase):
+class VolumesNegativeTestXML(base.BaseComputeTestXML,
+ VolumesNegativeTestBase):
@classmethod
def setUpClass(cls):
- super(VolumesNegativeTest, cls).setUpClass()
+ cls._interface = "xml"
+ super(VolumesNegativeTestXML, cls).setUpClass()
+ cls.client = cls.volumes_extensions_client
+
+
+class VolumesNegativeTestJSON(base.BaseComputeTestJSON,
+ VolumesNegativeTestBase):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(VolumesNegativeTestJSON, cls).setUpClass()
cls.client = cls.volumes_extensions_client
diff --git a/tempest/tests/identity/admin/test_roles.py b/tempest/tests/identity/admin/test_roles.py
index 5ebf2ae..f0dd8d9 100644
--- a/tempest/tests/identity/admin/test_roles.py
+++ b/tempest/tests/identity/admin/test_roles.py
@@ -100,10 +100,21 @@
self.client.delete_role(role1_id)
-class RolesTest(base.BaseIdentityAdminTest, RolesTestBase):
+class RolesTestJSON(base.BaseIdentityAdminTestJSON,
+ RolesTestBase):
+
@classmethod
def setUpClass(cls):
- super(RolesTest, cls).setUpClass()
+ super(RolesTestJSON, cls).setUpClass()
+ RolesTestBase.setUpClass(cls)
+
+
+class RolesTestXML(base.BaseIdentityAdminTestXML,
+ RolesTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(RolesTestXML, cls).setUpClass()
RolesTestBase.setUpClass(cls)
@@ -253,8 +264,17 @@
tenant['id'], 'junk-role-aabbcc11')
-class UserRolesTest(RolesTest, UserRolesTestBase):
+class UserRolesTestJSON(RolesTestJSON,
+ UserRolesTestBase):
@classmethod
def setUpClass(cls):
- super(UserRolesTest, cls).setUpClass()
+ super(UserRolesTestJSON, cls).setUpClass()
+
+
+class UserRolesTestXML(RolesTestXML,
+ UserRolesTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(UserRolesTestXML, cls).setUpClass()
diff --git a/tempest/tests/identity/admin/test_services.py b/tempest/tests/identity/admin/test_services.py
index 7d6cd2a..30dfeb0 100644
--- a/tempest/tests/identity/admin/test_services.py
+++ b/tempest/tests/identity/admin/test_services.py
@@ -18,12 +18,9 @@
import nose
from tempest.common.utils.data_utils import rand_name
-from tempest import config
from tempest import exceptions
from tempest.tests.identity import base
-CONF = config.TempestConfig()
-
class ServicesTestBase(object):
@@ -68,9 +65,15 @@
service_data['id'])
-class ServicesTest(base.BaseIdentityAdminTest, ServicesTestBase):
+class ServicesTestJSON(base.BaseIdentityAdminTestJSON, ServicesTestBase):
@classmethod
def setUpClass(cls):
- super(ServicesTest, cls).setUpClass()
- if CONF.general.use_xml:
- raise nose.SkipTest("Skipping until Bug #1061738 resolved")
+ super(ServicesTestJSON, cls).setUpClass()
+
+
+class ServicesTestXML(base.BaseIdentityAdminTestXML,
+ ServicesTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(ServicesTestXML, cls).setUpClass()
+ raise nose.SkipTest("Skipping until Bug #1061738 resolved")
diff --git a/tempest/tests/identity/admin/test_tenants.py b/tempest/tests/identity/admin/test_tenants.py
index b6678b8..578af4a 100644
--- a/tempest/tests/identity/admin/test_tenants.py
+++ b/tempest/tests/identity/admin/test_tenants.py
@@ -274,8 +274,16 @@
self.data.tenants.remove(tenant)
-class TenantsTest(base.BaseIdentityAdminTest, TenantsTestBase):
+class TenantsTestJSON(base.BaseIdentityAdminTestJSON,
+ TenantsTestBase):
@classmethod
def setUpClass(cls):
- super(TenantsTest, cls).setUpClass()
+ super(TenantsTestJSON, cls).setUpClass()
+
+
+class TenantsTestXML(base.BaseIdentityAdminTestXML, TenantsTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(TenantsTestXML, cls).setUpClass()
diff --git a/tempest/tests/identity/admin/test_users.py b/tempest/tests/identity/admin/test_users.py
index 064f9f8..7ad932b 100644
--- a/tempest/tests/identity/admin/test_users.py
+++ b/tempest/tests/identity/admin/test_users.py
@@ -329,7 +329,14 @@
'tenant ids %s' % fail)
-class UsersTest(base.BaseIdentityAdminTest, UsersTestBase):
+class UsersTestJSON(base.BaseIdentityAdminTestJSON,
+ UsersTestBase):
@classmethod
def setUpClass(cls):
- super(UsersTest, cls).setUpClass()
+ super(UsersTestJSON, cls).setUpClass()
+
+
+class UsersTestXML(base.BaseIdentityAdminTestXML, UsersTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(UsersTestXML, cls).setUpClass()
diff --git a/tempest/tests/identity/base.py b/tempest/tests/identity/base.py
index a75d830..8fee7ef 100644
--- a/tempest/tests/identity/base.py
+++ b/tempest/tests/identity/base.py
@@ -26,7 +26,7 @@
@classmethod
def setUpClass(cls):
- os = clients.IdentityManager()
+ os = clients.IdentityManager(interface=cls._interface)
cls.client = os.admin_client
cls.token_client = os.token_client
@@ -35,7 +35,7 @@
cls.data = DataGenerator(cls.client)
- os = clients.IdentityNaManager()
+ os = clients.IdentityNaManager(interface=cls._interface)
cls.non_admin_client = os.admin_client
@classmethod
@@ -69,10 +69,20 @@
return role[0]
-class BaseIdentityAdminTest(BaseIdAdminTest):
+class BaseIdentityAdminTestJSON(BaseIdAdminTest):
@classmethod
def setUpClass(cls):
- super(BaseIdentityAdminTest, cls).setUpClass()
+ cls._interface = "json"
+ super(BaseIdentityAdminTestJSON, cls).setUpClass()
+
+BaseIdentityAdminTest = BaseIdentityAdminTestJSON
+
+
+class BaseIdentityAdminTestXML(BaseIdAdminTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "xml"
+ super(BaseIdentityAdminTestXML, cls).setUpClass()
class DataGenerator(object):
diff --git a/tempest/tests/volume/admin/base.py b/tempest/tests/volume/admin/base.py
index 38b1e5b..d35efbc 100644
--- a/tempest/tests/volume/admin/base.py
+++ b/tempest/tests/volume/admin/base.py
@@ -42,15 +42,26 @@
"in configuration.")
raise nose.SkipTest(msg)
- if cls.config.general.use_xml:
- cls.client = volumes_types_xml_client.\
- VolumeTypesClient(cls.config, cls.adm_user, cls.adm_pass,
- cls.auth_url, cls.adm_tenant)
- else:
- cls.client = volume_types_json_client.\
- VolumeTypesClientJSON(cls.config, cls.adm_user, cls.adm_pass,
- cls.auth_url, cls.adm_tenant)
-
@classmethod
def tearDownClass(cls):
super(BaseVolumeAdminTest, cls).tearDownClass()
+
+
+class BaseVolumeAdminTestJSON(BaseVolumeAdminTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(BaseVolumeAdminTestJSON, cls).setUpClass()
+ cls.client = volume_types_json_client.\
+ VolumeTypesClientJSON(cls.config, cls.adm_user, cls.adm_pass,
+ cls.auth_url, cls.adm_tenant)
+
+
+class BaseVolumeAdminTestXML(BaseVolumeAdminTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "xml"
+ super(BaseVolumeAdminTestXML, cls).setUpClass()
+ cls.client = volume_types_xml_client.\
+ VolumeTypesClientXML(cls.config, cls.adm_user, cls.adm_pass,
+ cls.auth_url, cls.adm_tenant)
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 a59f9d3..d139425 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
@@ -23,7 +23,8 @@
from tempest.common.utils.data_utils import rand_name
from tempest import exceptions
-from tempest.tests.volume.admin.base import BaseVolumeAdminTest
+from tempest.tests.volume.admin.base import BaseVolumeAdminTestJSON
+from tempest.tests.volume.admin.base import BaseVolumeAdminTestXML
class ExtraSpecsNegativeTestBase():
@@ -135,14 +136,29 @@
str(uuid.uuid4()))
-class ExtraSpecsNegativeTest(BaseVolumeAdminTest, ExtraSpecsNegativeTestBase):
+class ExtraSpecsNegativeTestXML(BaseVolumeAdminTestXML,
+ ExtraSpecsNegativeTestBase):
@classmethod
def setUpClass(cls):
- super(ExtraSpecsNegativeTest, cls).setUpClass()
+ super(ExtraSpecsNegativeTestXML, cls).setUpClass()
ExtraSpecsNegativeTestBase.setUpClass(cls)
@classmethod
def tearDownClass(cls):
- super(ExtraSpecsNegativeTest, cls).tearDownClass()
+ super(ExtraSpecsNegativeTestXML, cls).tearDownClass()
+ ExtraSpecsNegativeTestBase.tearDownClass(cls)
+
+
+class ExtraSpecsNegativeTestJSON(BaseVolumeAdminTestJSON,
+ ExtraSpecsNegativeTestBase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(ExtraSpecsNegativeTestJSON, cls).setUpClass()
+ ExtraSpecsNegativeTestBase.setUpClass(cls)
+
+ @classmethod
+ def tearDownClass(cls):
+ super(ExtraSpecsNegativeTestJSON, cls).tearDownClass()
ExtraSpecsNegativeTestBase.tearDownClass(cls)
diff --git a/tempest/tests/volume/admin/test_volume_types_negative.py b/tempest/tests/volume/admin/test_volume_types_negative.py
index a7be745..c2daef9 100644
--- a/tempest/tests/volume/admin/test_volume_types_negative.py
+++ b/tempest/tests/volume/admin/test_volume_types_negative.py
@@ -22,7 +22,8 @@
from nose.tools import raises
from tempest import exceptions
-from tempest.tests.volume.admin.base import BaseVolumeAdminTest
+from tempest.tests.volume.admin.base import BaseVolumeAdminTestJSON
+from tempest.tests.volume.admin.base import BaseVolumeAdminTestXML
class VolumeTypesNegativeTestBase():
@@ -59,9 +60,17 @@
self.client.delete_volume_type(str(uuid.uuid4()))
-class VolumesTypesNegativeTest(BaseVolumeAdminTest,
- VolumeTypesNegativeTestBase):
+class VolumesTypesNegativeTestXML(BaseVolumeAdminTestXML,
+ VolumeTypesNegativeTestBase):
@classmethod
def setUpClass(cls):
- super(VolumesTypesNegativeTest, cls).setUpClass()
+ super(VolumesTypesNegativeTestXML, cls).setUpClass()
+ VolumeTypesNegativeTestBase.setUpClass(cls)
+
+
+class VolumesTypesNegativeTestJSON(BaseVolumeAdminTestJSON,
+ VolumeTypesNegativeTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(VolumesTypesNegativeTestJSON, cls).setUpClass()
VolumeTypesNegativeTestBase.setUpClass(cls)
diff --git a/tempest/tests/volume/base.py b/tempest/tests/volume/base.py
index 9420d43..8657db8 100644
--- a/tempest/tests/volume/base.py
+++ b/tempest/tests/volume/base.py
@@ -146,3 +146,17 @@
condition()
return
time.sleep(self.build_interval)
+
+
+class BaseVolumeTestJSON(BaseVolumeTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(BaseVolumeTestJSON, cls).setUpClass()
+
+
+class BaseVolumeTestXML(BaseVolumeTest):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "xml"
+ super(BaseVolumeTestXML, cls).setUpClass()
diff --git a/tempest/tests/volume/test_volumes_get.py b/tempest/tests/volume/test_volumes_get.py
index 054f0a9..bc64ff4 100644
--- a/tempest/tests/volume/test_volumes_get.py
+++ b/tempest/tests/volume/test_volumes_get.py
@@ -95,8 +95,17 @@
self.client.wait_for_resource_deletion(volume['id'])
-class VolumesGetTest(base.BaseVolumeTest, VolumesGetTestBase):
+class VolumesGetTestXML(base.BaseVolumeTestXML, VolumesGetTestBase):
@classmethod
def setUpClass(cls):
- super(VolumesGetTest, cls).setUpClass()
+ cls._interface = "xml"
+ super(VolumesGetTestXML, cls).setUpClass()
+ cls.client = cls.volumes_client
+
+
+class VolumesGetTestJSON(base.BaseVolumeTestJSON, VolumesGetTestBase):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = "json"
+ super(VolumesGetTestJSON, cls).setUpClass()
cls.client = cls.volumes_client
diff --git a/tempest/tests/volume/test_volumes_list.py b/tempest/tests/volume/test_volumes_list.py
index 3f0bcee..2fc1353 100644
--- a/tempest/tests/volume/test_volumes_list.py
+++ b/tempest/tests/volume/test_volumes_list.py
@@ -59,10 +59,11 @@
for m_vol in missing_vols))
-class VolumeListTest(base.BaseVolumeTest, VolumesListTestBase):
+class VolumeListTestXML(base.BaseVolumeTestXML, VolumesListTestBase):
@classmethod
def setUpClass(cls):
- super(VolumeListTest, cls).setUpClass()
+ cls._interface = 'xml'
+ super(VolumeListTestXML, cls).setUpClass()
cls.client = cls.volumes_client
# Create 3 test volumes
@@ -102,4 +103,51 @@
for volid in cls.volume_id_list:
resp, _ = cls.client.delete_volume(volid)
cls.client.wait_for_resource_deletion(volid)
- super(VolumeListTest, cls).tearDownClass()
+ super(VolumeListTestXML, cls).tearDownClass()
+
+
+class VolumeListTestJSON(base.BaseVolumeTestJSON, VolumesListTestBase):
+ @classmethod
+ def setUpClass(cls):
+ cls._interface = 'json'
+ super(VolumeListTestJSON, cls).setUpClass()
+ cls.client = cls.volumes_client
+
+ # Create 3 test volumes
+ cls.volume_list = []
+ cls.volume_id_list = []
+ for i in range(3):
+ v_name = rand_name('volume')
+ metadata = {'Type': 'work'}
+ try:
+ resp, volume = cls.client.create_volume(size=1,
+ display_name=v_name,
+ metadata=metadata)
+ cls.client.wait_for_volume_status(volume['id'], 'available')
+ resp, volume = cls.client.get_volume(volume['id'])
+ cls.volume_list.append(volume)
+ cls.volume_id_list.append(volume['id'])
+ except Exception:
+ if cls.volume_list:
+ # We could not create all the volumes, though we were able
+ # to create *some* of the volumes. This is typically
+ # because the backing file size of the volume group is
+ # too small. So, here, we clean up whatever we did manage
+ # to create and raise a SkipTest
+ for volid in cls.volume_id_list:
+ cls.client.delete_volume(volid)
+ cls.client.wait_for_resource_deletion(volid)
+ msg = ("Failed to create ALL necessary volumes to run "
+ "test. This typically means that the backing file "
+ "size of the nova-volumes group is too small to "
+ "create the 3 volumes needed by this test case")
+ raise nose.SkipTest(msg)
+ raise
+
+ @classmethod
+ def tearDownClass(cls):
+ # Delete the created volumes
+ for volid in cls.volume_id_list:
+ resp, _ = cls.client.delete_volume(volid)
+ cls.client.wait_for_resource_deletion(volid)
+ super(VolumeListTestJSON, cls).tearDownClass()
diff --git a/tempest/tests/volume/test_volumes_negative.py b/tempest/tests/volume/test_volumes_negative.py
index 0474eac..6bd7002 100644
--- a/tempest/tests/volume/test_volumes_negative.py
+++ b/tempest/tests/volume/test_volumes_negative.py
@@ -114,8 +114,16 @@
resp, volume = self.client.delete_volume('')
-class VolumesNegativeTest(base.BaseVolumeTest, VolumesNegativeTestBase):
+class VolumesNegativeTestXML(base.BaseVolumeTestXML, VolumesNegativeTestBase):
@classmethod
def setUpClass(cls):
- super(VolumesNegativeTest, cls).setUpClass()
+ super(VolumesNegativeTestXML, cls).setUpClass()
+ cls.client = cls.volumes_client
+
+
+class VolumesNegativeTestJSON(base.BaseVolumeTestJSON,
+ VolumesNegativeTestBase):
+ @classmethod
+ def setUpClass(cls):
+ super(VolumesNegativeTestJSON, cls).setUpClass()
cls.client = cls.volumes_client