diff --git a/tempest/api/compute/images/test_image_metadata.py b/tempest/api/compute/images/test_image_metadata.py index 89a2f755e3..4115d65ece 100644 --- a/tempest/api/compute/images/test_image_metadata.py +++ b/tempest/api/compute/images/test_image_metadata.py @@ -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) diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py index b5a4802395..3fc7c555f0 100644 --- a/tempest/api/compute/volumes/test_volumes_get.py +++ b/tempest/api/compute/volumes/test_volumes_get.py @@ -15,9 +15,12 @@ from tempest.api.compute import base from tempest.common.utils import data_utils +from tempest import config from tempest.test import attr from testtools.matchers import ContainsAll +CONF = config.CONF + class VolumesGetTestJSON(base.BaseV2ComputeTest): @@ -27,7 +30,7 @@ class VolumesGetTestJSON(base.BaseV2ComputeTest): def setUpClass(cls): super(VolumesGetTestJSON, 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) diff --git a/tempest/api/image/v1/test_images.py b/tempest/api/image/v1/test_images.py index 3c8d95ebd5..8c62c05f0d 100644 --- a/tempest/api/image/v1/test_images.py +++ b/tempest/api/image/v1/test_images.py @@ -16,8 +16,11 @@ import cStringIO as StringIO from tempest.api.image import base +from tempest import config from tempest.test import attr +CONF = config.CONF + class CreateRegisterImagesTest(base.BaseV1ImageTest): """Here we test the registration and creation of images.""" @@ -68,7 +71,7 @@ class CreateRegisterImagesTest(base.BaseV1ImageTest): resp, body = self.create_image(name='New Http Image', container_format='bare', disk_format='raw', is_public=True, - copy_from=self.config.images.http_image) + copy_from=CONF.images.http_image) self.assertIn('id', body) image_id = body.get('id') self.assertEqual('New Http Image', body.get('name')) diff --git a/tempest/manager.py b/tempest/manager.py index cba6ba542c..93ff10fa13 100644 --- a/tempest/manager.py +++ b/tempest/manager.py @@ -13,7 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -from tempest import config from tempest import exceptions @@ -27,7 +26,6 @@ class Manager(object): """ def __init__(self): - self.config = config.CONF self.client_attr_names = [] # we do this everywhere, have it be part of the super class diff --git a/tempest/test.py b/tempest/test.py index 6754831f70..58983588d7 100644 --- a/tempest/test.py +++ b/tempest/test.py @@ -155,13 +155,12 @@ def is_extension_enabled(extension_name, service): """A function that will check the list of enabled extensions from config """ - configs = CONF config_dict = { - 'compute': configs.compute_feature_enabled.api_extensions, - 'compute_v3': configs.compute_feature_enabled.api_v3_extensions, - 'volume': configs.volume_feature_enabled.api_extensions, - 'network': configs.network_feature_enabled.api_extensions, - 'object': configs.object_storage_feature_enabled.discoverable_apis, + 'compute': CONF.compute_feature_enabled.api_extensions, + 'compute_v3': CONF.compute_feature_enabled.api_v3_extensions, + 'volume': CONF.volume_feature_enabled.api_extensions, + 'network': CONF.network_feature_enabled.api_extensions, + 'object': CONF.object_storage_feature_enabled.discoverable_apis, } if config_dict[service][0] == 'all': return True @@ -224,8 +223,6 @@ class BaseTestCase(testtools.TestCase, testtools.testcase.WithAttributes, testresources.ResourcedTestCase): - config = CONF - setUpClassCalled = False network_resources = {} @@ -281,7 +278,7 @@ class BaseTestCase(testtools.TestCase, cls.__name__, network_resources=cls.network_resources) force_tenant_isolation = getattr(cls, 'force_tenant_isolation', None) - if (cls.config.compute.allow_tenant_isolation or + if (CONF.compute.allow_tenant_isolation or force_tenant_isolation): creds = cls.isolated_creds.get_primary_creds() username, tenant_name, password = creds @@ -310,16 +307,6 @@ class BaseTestCase(testtools.TestCase, admin_client = os.identity_client return admin_client - @classmethod - def _get_client_args(cls): - - return ( - cls.config, - cls.config.identity.admin_username, - cls.config.identity.admin_password, - cls.config.identity.uri - ) - @classmethod def set_network_resources(self, network=False, router=False, subnet=False, dhcp=False):