Convert compute api tests to global CONF object
This commit takes all the uses of config in the compute api tests and converts them to use the global CONF object. Partially implements bp config-cleanup Change-Id: Iac92d6ac88200222392a131b4c95411594c509ba
This commit is contained in:
@@ -14,8 +14,11 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class FixedIPsTestJson(base.BaseV2ComputeAdminTest):
|
||||
_interface = 'json'
|
||||
@@ -23,7 +26,7 @@ class FixedIPsTestJson(base.BaseV2ComputeAdminTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(FixedIPsTestJson, cls).setUpClass()
|
||||
if cls.config.service_available.neutron:
|
||||
if CONF.service_available.neutron:
|
||||
msg = ("%s skipped as neutron is available" % cls.__name__)
|
||||
raise cls.skipException(msg)
|
||||
cls.client = cls.os_adm.fixed_ips_client
|
||||
|
||||
@@ -13,9 +13,12 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
|
||||
_interface = 'json'
|
||||
@@ -23,7 +26,7 @@ class FixedIPsNegativeTestJson(base.BaseV2ComputeAdminTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(FixedIPsNegativeTestJson, cls).setUpClass()
|
||||
if cls.config.service_available.neutron:
|
||||
if CONF.service_available.neutron:
|
||||
msg = ("%s skipped as neutron is available" % cls.__name__)
|
||||
raise cls.skipException(msg)
|
||||
cls.client = cls.os_adm.fixed_ips_client
|
||||
|
||||
@@ -17,10 +17,12 @@ import time
|
||||
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.openstack.common import log as logging
|
||||
import tempest.test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -37,15 +39,15 @@ class BaseComputeTest(tempest.test.BaseTestCase):
|
||||
os = cls.get_client_manager()
|
||||
|
||||
cls.os = os
|
||||
cls.build_interval = cls.config.compute.build_interval
|
||||
cls.build_timeout = cls.config.compute.build_timeout
|
||||
cls.ssh_user = cls.config.compute.ssh_user
|
||||
cls.image_ref = cls.config.compute.image_ref
|
||||
cls.image_ref_alt = cls.config.compute.image_ref_alt
|
||||
cls.flavor_ref = cls.config.compute.flavor_ref
|
||||
cls.flavor_ref_alt = cls.config.compute.flavor_ref_alt
|
||||
cls.image_ssh_user = cls.config.compute.image_ssh_user
|
||||
cls.image_ssh_password = cls.config.compute.image_ssh_password
|
||||
cls.build_interval = CONF.compute.build_interval
|
||||
cls.build_timeout = CONF.compute.build_timeout
|
||||
cls.ssh_user = CONF.compute.ssh_user
|
||||
cls.image_ref = CONF.compute.image_ref
|
||||
cls.image_ref_alt = CONF.compute.image_ref_alt
|
||||
cls.flavor_ref = CONF.compute.flavor_ref
|
||||
cls.flavor_ref_alt = CONF.compute.flavor_ref_alt
|
||||
cls.image_ssh_user = CONF.compute.image_ssh_user
|
||||
cls.image_ssh_password = CONF.compute.image_ssh_password
|
||||
cls.servers = []
|
||||
cls.images = []
|
||||
cls.multi_user = cls.get_multi_user()
|
||||
@@ -57,14 +59,14 @@ class BaseComputeTest(tempest.test.BaseTestCase):
|
||||
# used in testing. If the test cases are allowed to create
|
||||
# users (config.compute.allow_tenant_isolation is true,
|
||||
# then we allow multi-user.
|
||||
if not cls.config.compute.allow_tenant_isolation:
|
||||
user1 = cls.config.identity.username
|
||||
user2 = cls.config.identity.alt_username
|
||||
if not CONF.compute.allow_tenant_isolation:
|
||||
user1 = CONF.identity.username
|
||||
user2 = CONF.identity.alt_username
|
||||
if not user2 or user1 == user2:
|
||||
multi_user = False
|
||||
else:
|
||||
user2_password = cls.config.identity.alt_password
|
||||
user2_tenant_name = cls.config.identity.alt_tenant_name
|
||||
user2_password = CONF.identity.alt_password
|
||||
user2_tenant_name = CONF.identity.alt_tenant_name
|
||||
if not user2_password or not user2_tenant_name:
|
||||
msg = ("Alternate user specified but not alternate "
|
||||
"tenant or password: alt_tenant_name=%s "
|
||||
@@ -234,14 +236,14 @@ class BaseV2ComputeAdminTest(BaseV2ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(BaseV2ComputeAdminTest, cls).setUpClass()
|
||||
admin_username = cls.config.compute_admin.username
|
||||
admin_password = cls.config.compute_admin.password
|
||||
admin_tenant = cls.config.compute_admin.tenant_name
|
||||
admin_username = CONF.compute_admin.username
|
||||
admin_password = CONF.compute_admin.password
|
||||
admin_tenant = CONF.compute_admin.tenant_name
|
||||
if not (admin_username and admin_password and admin_tenant):
|
||||
msg = ("Missing Compute Admin API credentials "
|
||||
"in configuration.")
|
||||
raise cls.skipException(msg)
|
||||
if (cls.config.compute.allow_tenant_isolation or
|
||||
if (CONF.compute.allow_tenant_isolation or
|
||||
cls.force_tenant_isolation is True):
|
||||
creds = cls.isolated_creds.get_admin_creds()
|
||||
admin_username, admin_tenant_name, admin_password = creds
|
||||
@@ -265,7 +267,7 @@ class BaseV3ComputeTest(BaseComputeTest):
|
||||
|
||||
cls.set_network_resources()
|
||||
super(BaseV3ComputeTest, cls).setUpClass()
|
||||
if not cls.config.compute_feature_enabled.api_v3:
|
||||
if not CONF.compute_feature_enabled.api_v3:
|
||||
cls.tearDownClass()
|
||||
skip_msg = ("%s skipped as nova v3 api is not available" %
|
||||
cls.__name__)
|
||||
@@ -330,14 +332,14 @@ class BaseV3ComputeAdminTest(BaseV3ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(BaseV3ComputeAdminTest, cls).setUpClass()
|
||||
admin_username = cls.config.compute_admin.username
|
||||
admin_password = cls.config.compute_admin.password
|
||||
admin_tenant = cls.config.compute_admin.tenant_name
|
||||
admin_username = CONF.compute_admin.username
|
||||
admin_password = CONF.compute_admin.password
|
||||
admin_tenant = CONF.compute_admin.tenant_name
|
||||
if not (admin_username and admin_password and admin_tenant):
|
||||
msg = ("Missing Compute Admin API credentials "
|
||||
"in configuration.")
|
||||
raise cls.skipException(msg)
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_admin_creds()
|
||||
admin_username, admin_tenant_name, admin_password = creds
|
||||
os_adm = clients.Manager(username=admin_username,
|
||||
|
||||
@@ -17,9 +17,12 @@ import uuid
|
||||
|
||||
from tempest.api.compute.floating_ips import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
|
||||
_interface = 'json'
|
||||
@@ -40,7 +43,7 @@ class FloatingIPsNegativeTestJSON(base.BaseFloatingIPsTest):
|
||||
cls.floating_ip_ids.append(body[i]['id'])
|
||||
while True:
|
||||
cls.non_exist_id = data_utils.rand_int_id(start=999)
|
||||
if cls.config.service_available.neutron:
|
||||
if CONF.service_available.neutron:
|
||||
cls.non_exist_id = str(uuid.uuid4())
|
||||
if cls.non_exist_id not in cls.floating_ip_ids:
|
||||
break
|
||||
|
||||
@@ -17,9 +17,12 @@ import uuid
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class FloatingIPDetailsNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -34,7 +37,7 @@ class FloatingIPDetailsNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
# Negative test:Should not be able to GET the details
|
||||
# of non-existent floating IP
|
||||
# Creating a non-existent floatingIP id
|
||||
if self.config.service_available.neutron:
|
||||
if CONF.service_available.neutron:
|
||||
non_exist_id = str(uuid.uuid4())
|
||||
else:
|
||||
non_exist_id = data_utils.rand_int_id(start=999)
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
from tempest.api.compute import base
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class ImagesTestJSON(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -25,7 +28,7 @@ class ImagesTestJSON(base.BaseV2ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(ImagesTestJSON, cls).setUpClass()
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
cls.client = cls.images_client
|
||||
@@ -34,7 +37,7 @@ class ImagesTestJSON(base.BaseV2ComputeTest):
|
||||
cls.image_ids = []
|
||||
|
||||
if cls.multi_user:
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_alt_creds()
|
||||
username, tenant_name, password = creds
|
||||
cls.alt_manager = clients.Manager(username=username,
|
||||
|
||||
@@ -55,7 +55,7 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
|
||||
def setUpClass(cls):
|
||||
super(ImagesOneServerTestJSON, cls).setUpClass()
|
||||
cls.client = cls.images_client
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
@@ -69,7 +69,7 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
|
||||
cls.image_ids = []
|
||||
|
||||
if cls.multi_user:
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_alt_creds()
|
||||
username, tenant_name, password = creds
|
||||
cls.alt_manager = clients.Manager(username=username,
|
||||
|
||||
@@ -17,11 +17,14 @@
|
||||
from tempest.api.compute import base
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.openstack.common import log as logging
|
||||
from tempest.test import attr
|
||||
from tempest.test import skip_because
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -57,7 +60,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
def setUpClass(cls):
|
||||
super(ImagesOneServerNegativeTestJSON, cls).setUpClass()
|
||||
cls.client = cls.images_client
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
@@ -71,7 +74,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
cls.image_ids = []
|
||||
|
||||
if cls.multi_user:
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_alt_creds()
|
||||
username, tenant_name, password = creds
|
||||
cls.alt_manager = clients.Manager(username=username,
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.openstack.common import log as logging
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -28,7 +30,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(ListImageFiltersTestJSON, cls).setUpClass()
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
cls.client = cls.images_client
|
||||
|
||||
@@ -14,8 +14,11 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class ListImagesTestJSON(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -23,7 +26,7 @@ class ListImagesTestJSON(base.BaseV2ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(ListImagesTestJSON, cls).setUpClass()
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
cls.client = cls.images_client
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
|
||||
from tempest.api.compute.security_groups import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
|
||||
_interface = 'json'
|
||||
@@ -25,7 +28,7 @@ class SecurityGroupRulesTestJSON(base.BaseSecurityGroupsTest):
|
||||
def setUpClass(cls):
|
||||
super(SecurityGroupRulesTestJSON, cls).setUpClass()
|
||||
cls.client = cls.security_groups_client
|
||||
cls.neutron_available = cls.config.service_available.neutron
|
||||
cls.neutron_available = CONF.service_available.neutron
|
||||
|
||||
@attr(type='smoke')
|
||||
def test_security_group_rules_create(self):
|
||||
|
||||
@@ -31,7 +31,7 @@ class SecurityGroupsNegativeTestJSON(base.BaseSecurityGroupsTest):
|
||||
def setUpClass(cls):
|
||||
super(SecurityGroupsNegativeTestJSON, cls).setUpClass()
|
||||
cls.client = cls.security_groups_client
|
||||
cls.neutron_available = cls.config.service_available.neutron
|
||||
cls.neutron_available = CONF.service_available.neutron
|
||||
|
||||
def _delete_security_group(self, securitygroup_id):
|
||||
resp, _ = self.client.delete_security_group(securitygroup_id)
|
||||
|
||||
@@ -14,18 +14,21 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
import time
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class AttachInterfacesTestJSON(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
if not cls.config.service_available.neutron:
|
||||
if not CONF.service_available.neutron:
|
||||
raise cls.skipException("Neutron is required")
|
||||
# This test class requires network and subnet
|
||||
cls.set_network_resources(network=True, subnet=True)
|
||||
|
||||
@@ -71,7 +71,7 @@ class ListServerFiltersTestJSON(base.BaseV2ComputeTest):
|
||||
flavor=cls.flavor_ref_alt,
|
||||
wait_until='ACTIVE')
|
||||
|
||||
cls.fixed_network_name = cls.config.compute.fixed_network_name
|
||||
cls.fixed_network_name = CONF.compute.fixed_network_name
|
||||
|
||||
@utils.skip_unless_attr('multiple_images', 'Only one image found')
|
||||
@attr(type='gate')
|
||||
|
||||
@@ -369,7 +369,7 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
|
||||
resp, server = self.client.shelve_server(self.server_id)
|
||||
self.assertEqual(202, resp.status)
|
||||
|
||||
offload_time = self.config.compute.shelved_offload_time
|
||||
offload_time = CONF.compute.shelved_offload_time
|
||||
if offload_time >= 0:
|
||||
self.client.wait_for_server_status(self.server_id,
|
||||
'SHELVED_OFFLOADED',
|
||||
|
||||
@@ -19,9 +19,12 @@ import sys
|
||||
from tempest.api.compute import base
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -408,7 +411,7 @@ class ServersNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
self.assertEqual(202, resp.status)
|
||||
self.addCleanup(self.client.unshelve_server, self.server_id)
|
||||
|
||||
offload_time = self.config.compute.shelved_offload_time
|
||||
offload_time = CONF.compute.shelved_offload_time
|
||||
if offload_time >= 0:
|
||||
self.client.wait_for_server_status(self.server_id,
|
||||
'SHELVED_OFFLOADED',
|
||||
|
||||
@@ -19,12 +19,12 @@ from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class VirtualInterfacesTestJSON(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
# This test needs a network and a subnet
|
||||
|
||||
@@ -16,10 +16,13 @@
|
||||
from tempest.api.compute import base
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.openstack.common import log as logging
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -39,7 +42,7 @@ class AuthorizationTestJSON(base.BaseV2ComputeTest):
|
||||
cls.keypairs_client = cls.os.keypairs_client
|
||||
cls.security_client = cls.os.security_groups_client
|
||||
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_alt_creds()
|
||||
username, tenant_name, password = creds
|
||||
cls.alt_manager = clients.Manager(username=username,
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest.openstack.common import log as logging
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -28,11 +31,11 @@ class ExtensionsTestJSON(base.BaseV2ComputeTest):
|
||||
@test.attr(type='gate')
|
||||
def test_list_extensions(self):
|
||||
# List of all extensions
|
||||
if len(self.config.compute_feature_enabled.api_extensions) == 0:
|
||||
if len(CONF.compute_feature_enabled.api_extensions) == 0:
|
||||
raise self.skipException('There are not any extensions configured')
|
||||
resp, extensions = self.extensions_client.list_extensions()
|
||||
self.assertEqual(200, resp.status)
|
||||
ext = self.config.compute_feature_enabled.api_extensions[0]
|
||||
ext = CONF.compute_feature_enabled.api_extensions[0]
|
||||
if ext == 'all':
|
||||
self.assertIn('Hosts', map(lambda x: x['name'], extensions))
|
||||
elif ext:
|
||||
|
||||
@@ -23,13 +23,13 @@ from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
|
||||
_host_key = 'OS-EXT-SRV-ATTR:host'
|
||||
_interface = 'json'
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(LiveBlockMigrationTestJSON, cls).setUpClass()
|
||||
@@ -57,8 +57,7 @@ class LiveBlockMigrationTestJSON(base.BaseV2ComputeAdminTest):
|
||||
def _migrate_server_to(self, server_id, dest_host):
|
||||
_resp, body = self.admin_servers_client.live_migrate_server(
|
||||
server_id, dest_host,
|
||||
self.config.compute_feature_enabled.
|
||||
block_migration_for_live_migration)
|
||||
CONF.compute_feature_enabled.block_migration_for_live_migration)
|
||||
return body
|
||||
|
||||
def _get_host_other_than(self, host):
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class QuotasAdminV3TestJSON(base.BaseV3ComputeAdminTest):
|
||||
_interface = 'json'
|
||||
@@ -26,7 +29,7 @@ class QuotasAdminV3TestJSON(base.BaseV3ComputeAdminTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(QuotasAdminV3TestJSON, cls).setUpClass()
|
||||
cls.auth_url = cls.config.identity.uri
|
||||
cls.auth_url = CONF.identity.uri
|
||||
cls.client = cls.quotas_client
|
||||
cls.adm_client = cls.quotas_admin_client
|
||||
cls.identity_admin_client = cls._get_identity_admin_client()
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -24,7 +27,7 @@ class ImagesMetadataTestJSON(base.BaseV2ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(ImagesMetadataTestJSON, cls).setUpClass()
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
|
||||
@@ -15,9 +15,12 @@
|
||||
from tempest.api.compute import base
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class ImagesV3TestJSON(base.BaseV3ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -25,14 +28,14 @@ class ImagesV3TestJSON(base.BaseV3ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(ImagesV3TestJSON, cls).setUpClass()
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
cls.client = cls.images_client
|
||||
cls.servers_client = cls.servers_client
|
||||
|
||||
if cls.multi_user:
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_alt_creds()
|
||||
username, tenant_name, password = creds
|
||||
cls.alt_manager = clients.Manager(username=username,
|
||||
|
||||
@@ -55,7 +55,7 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
|
||||
def setUpClass(cls):
|
||||
super(ImagesOneServerTestJSON, cls).setUpClass()
|
||||
cls.client = cls.images_client
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
@@ -69,7 +69,7 @@ class ImagesOneServerTestJSON(base.BaseV2ComputeTest):
|
||||
cls.image_ids = []
|
||||
|
||||
if cls.multi_user:
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_alt_creds()
|
||||
username, tenant_name, password = creds
|
||||
cls.alt_manager = clients.Manager(username=username,
|
||||
|
||||
@@ -17,11 +17,14 @@
|
||||
from tempest.api.compute import base
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.openstack.common import log as logging
|
||||
from tempest.test import attr
|
||||
from tempest.test import skip_because
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -57,7 +60,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
def setUpClass(cls):
|
||||
super(ImagesOneServerNegativeTestJSON, cls).setUpClass()
|
||||
cls.client = cls.images_client
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
@@ -71,7 +74,7 @@ class ImagesOneServerNegativeTestJSON(base.BaseV2ComputeTest):
|
||||
cls.image_ids = []
|
||||
|
||||
if cls.multi_user:
|
||||
if cls.config.compute.allow_tenant_isolation:
|
||||
if CONF.compute.allow_tenant_isolation:
|
||||
creds = cls.isolated_creds.get_alt_creds()
|
||||
username, tenant_name, password = creds
|
||||
cls.alt_manager = clients.Manager(username=username,
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.openstack.common import log as logging
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -28,7 +30,7 @@ class ListImageFiltersTestJSON(base.BaseV2ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(ListImageFiltersTestJSON, cls).setUpClass()
|
||||
if not cls.config.service_available.glance:
|
||||
if not CONF.service_available.glance:
|
||||
skip_msg = ("%s skipped as glance is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
cls.client = cls.images_client
|
||||
|
||||
@@ -14,18 +14,21 @@
|
||||
# under the License.
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
import time
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class AttachInterfacesV3TestJSON(base.BaseV3ComputeTest):
|
||||
_interface = 'json'
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
if not cls.config.service_available.neutron:
|
||||
if not CONF.service_available.neutron:
|
||||
raise cls.skipException("Neutron is required")
|
||||
# This test class requires network and subnet
|
||||
cls.set_network_resources(network=True, subnet=True)
|
||||
|
||||
@@ -36,8 +36,8 @@ class AttachVolumeV3TestJSON(base.BaseV3ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(AttachVolumeV3TestJSON, cls).setUpClass()
|
||||
cls.device = cls.config.compute.volume_device_name
|
||||
if not cls.config.service_available.cinder:
|
||||
cls.device = CONF.compute.volume_device_name
|
||||
if not CONF.service_available.cinder:
|
||||
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class ListServerFiltersV3TestJSON(base.BaseV3ComputeTest):
|
||||
flavor=cls.flavor_ref_alt,
|
||||
wait_until='ACTIVE')
|
||||
|
||||
cls.fixed_network_name = cls.config.compute.fixed_network_name
|
||||
cls.fixed_network_name = CONF.compute.fixed_network_name
|
||||
|
||||
@utils.skip_unless_attr('multiple_images', 'Only one image found')
|
||||
@attr(type='gate')
|
||||
|
||||
@@ -359,7 +359,7 @@ class ServerActionsV3TestJSON(base.BaseV3ComputeTest):
|
||||
resp, server = self.client.shelve_server(self.server_id)
|
||||
self.assertEqual(202, resp.status)
|
||||
|
||||
offload_time = self.config.compute.shelved_offload_time
|
||||
offload_time = CONF.compute.shelved_offload_time
|
||||
if offload_time >= 0:
|
||||
self.client.wait_for_server_status(self.server_id,
|
||||
'SHELVED_OFFLOADED',
|
||||
|
||||
@@ -19,9 +19,12 @@ import sys
|
||||
from tempest.api.compute import base
|
||||
from tempest import clients
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class ServersNegativeV3TestJSON(base.BaseV3ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -396,7 +399,7 @@ class ServersNegativeV3TestJSON(base.BaseV3ComputeTest):
|
||||
self.assertEqual(202, resp.status)
|
||||
self.addCleanup(self.client.unshelve_server, self.server_id)
|
||||
|
||||
offload_time = self.config.compute.shelved_offload_time
|
||||
offload_time = CONF.compute.shelved_offload_time
|
||||
if offload_time >= 0:
|
||||
self.client.wait_for_server_status(self.server_id,
|
||||
'SHELVED_OFFLOADED',
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest import config
|
||||
from tempest.openstack.common import log as logging
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -28,11 +30,11 @@ class ExtensionsV3TestJSON(base.BaseV3ComputeTest):
|
||||
@test.attr(type='gate')
|
||||
def test_list_extensions(self):
|
||||
# List of all extensions
|
||||
if len(self.config.compute_feature_enabled.api_v3_extensions) == 0:
|
||||
if len(CONF.compute_feature_enabled.api_v3_extensions) == 0:
|
||||
raise self.skipException('There are not any extensions configured')
|
||||
resp, extensions = self.extensions_client.list_extensions()
|
||||
self.assertEqual(200, resp.status)
|
||||
ext = self.config.compute_feature_enabled.api_v3_extensions[0]
|
||||
ext = CONF.compute_feature_enabled.api_v3_extensions[0]
|
||||
if ext == 'all':
|
||||
self.assertIn('Hosts', map(lambda x: x['name'], extensions))
|
||||
elif ext:
|
||||
|
||||
@@ -23,13 +23,13 @@ from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class LiveBlockMigrationV3TestJSON(base.BaseV3ComputeAdminTest):
|
||||
_host_key = 'os-extended-server-attributes:host'
|
||||
_interface = 'json'
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(LiveBlockMigrationV3TestJSON, cls).setUpClass()
|
||||
@@ -57,7 +57,7 @@ class LiveBlockMigrationV3TestJSON(base.BaseV3ComputeAdminTest):
|
||||
def _migrate_server_to(self, server_id, dest_host):
|
||||
_resp, body = self.admin_servers_client.live_migrate_server(
|
||||
server_id, dest_host,
|
||||
self.config.compute_feature_enabled.
|
||||
CONF.compute_feature_enabled.
|
||||
block_migration_for_live_migration)
|
||||
return body
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ class AttachVolumeTestJSON(base.BaseV2ComputeTest):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(AttachVolumeTestJSON, cls).setUpClass()
|
||||
cls.device = cls.config.compute.volume_device_name
|
||||
if not cls.config.service_available.cinder:
|
||||
cls.device = CONF.compute.volume_device_name
|
||||
if not CONF.service_available.cinder:
|
||||
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
|
||||
@@ -15,8 +15,11 @@
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class VolumesTestJSON(base.BaseV2ComputeTest):
|
||||
|
||||
@@ -34,7 +37,7 @@ class VolumesTestJSON(base.BaseV2ComputeTest):
|
||||
def setUpClass(cls):
|
||||
super(VolumesTestJSON, cls).setUpClass()
|
||||
cls.client = cls.volumes_extensions_client
|
||||
if not cls.config.service_available.cinder:
|
||||
if not CONF.service_available.cinder:
|
||||
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
# Create 3 Volumes
|
||||
|
||||
@@ -17,9 +17,12 @@ import uuid
|
||||
|
||||
from tempest.api.compute import base
|
||||
from tempest.common.utils import data_utils
|
||||
from tempest import config
|
||||
from tempest import exceptions
|
||||
from tempest.test import attr
|
||||
|
||||
CONF = config.CONF
|
||||
|
||||
|
||||
class VolumesNegativeTest(base.BaseV2ComputeTest):
|
||||
_interface = 'json'
|
||||
@@ -28,7 +31,7 @@ class VolumesNegativeTest(base.BaseV2ComputeTest):
|
||||
def setUpClass(cls):
|
||||
super(VolumesNegativeTest, cls).setUpClass()
|
||||
cls.client = cls.volumes_extensions_client
|
||||
if not cls.config.service_available.cinder:
|
||||
if not CONF.service_available.cinder:
|
||||
skip_msg = ("%s skipped as Cinder is not available" % cls.__name__)
|
||||
raise cls.skipException(skip_msg)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user