Merge "Change basic server client methods to return one value and update tests"
diff --git a/requirements.txt b/requirements.txt
index 94c6fb0..ebb23c3 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -11,7 +11,7 @@
netaddr>=0.7.12
python-ceilometerclient>=1.0.6
python-glanceclient>=0.15.0
-python-keystoneclient>=1.0.0
+python-keystoneclient>=1.1.0
python-novaclient>=2.18.0
python-neutronclient>=2.3.6,<3
python-cinderclient>=1.1.0
@@ -25,4 +25,4 @@
iso8601>=0.1.9
fixtures>=0.3.14
testscenarios>=0.4
-tempest-lib>=0.1.0
+tempest-lib>=0.2.0
diff --git a/tempest/api/compute/admin/test_flavors_negative.py b/tempest/api/compute/admin/test_flavors_negative.py
index 34d8e3f..d1060c5 100644
--- a/tempest/api/compute/admin/test_flavors_negative.py
+++ b/tempest/api/compute/admin/test_flavors_negative.py
@@ -106,6 +106,5 @@
@test.SimpleNegativeAutoTest
class FlavorCreateNegativeTestJSON(base.BaseV2ComputeAdminTest,
test.NegativeAutoTest):
- _interface = 'json'
_service = CONF.compute.catalog_type
_schema = flavors.flavor_create
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index 21e342a..4120a9a 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -329,20 +329,17 @@
class BaseV2ComputeTest(BaseComputeTest):
_api_version = 2
- _interface = "json"
class BaseComputeAdminTest(BaseComputeTest):
"""Base test case class for Compute Admin API tests."""
- _interface = "json"
@classmethod
def resource_setup(cls):
super(BaseComputeAdminTest, cls).resource_setup()
try:
creds = cls.isolated_creds.get_admin_creds()
- cls.os_adm = clients.Manager(
- credentials=creds, interface=cls._interface)
+ cls.os_adm = clients.Manager(credentials=creds)
except NotImplementedError:
msg = ("Missing Compute Admin API credentials in configuration.")
raise cls.skipException(msg)
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
index 0d3fe7d..a2e5f56 100644
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -172,8 +172,6 @@
# Verify only the expected number of results are returned
params = {'limit': '1'}
images = self.client.list_images(params)
- # when _interface='xml', one element for images_links in images
- # ref: Question #224349
self.assertEqual(1, len([x for x in images if 'id' in x]))
@test.attr(type='gate')
diff --git a/tempest/api/compute/servers/test_list_servers_negative.py b/tempest/api/compute/servers/test_list_servers_negative.py
index a017f5f..3827ad9 100644
--- a/tempest/api/compute/servers/test_list_servers_negative.py
+++ b/tempest/api/compute/servers/test_list_servers_negative.py
@@ -101,7 +101,6 @@
# List servers by specifying limits
resp, body = self.client.list_servers({'limit': 1})
self.assertEqual('200', resp['status'])
- # when _interface='xml', one element for servers_links in servers
self.assertEqual(1, len([x for x in body['servers'] if 'id' in x]))
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
index 53f5ac0..69998d2 100644
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -38,7 +38,7 @@
def test_volume_create_get_delete(self):
# CREATE, GET, DELETE Volume
volume = None
- v_name = data_utils.rand_name('Volume-%s-') % self._interface
+ v_name = data_utils.rand_name('Volume')
metadata = {'Type': 'work'}
# Create volume
volume = self.client.create_volume(size=1,
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
index c0ac99b..ba7ee6b 100644
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -42,7 +42,7 @@
cls.volume_list = []
cls.volume_id_list = []
for i in range(3):
- v_name = data_utils.rand_name('volume-%s' % cls._interface)
+ v_name = data_utils.rand_name('volume')
metadata = {'Type': 'work'}
try:
volume = cls.client.create_volume(size=1,
diff --git a/tempest/api/data_processing/base.py b/tempest/api/data_processing/base.py
index 4c53a57..5992921 100644
--- a/tempest/api/data_processing/base.py
+++ b/tempest/api/data_processing/base.py
@@ -22,16 +22,26 @@
class BaseDataProcessingTest(tempest.test.BaseTestCase):
- _interface = 'json'
+
+ @classmethod
+ def skip_checks(cls):
+ super(BaseDataProcessingTest, cls).skip_checks()
+ if not CONF.service_available.sahara:
+ raise cls.skipException('Sahara support is required')
+
+ @classmethod
+ def setup_credentials(cls):
+ super(BaseDataProcessingTest, cls).setup_credentials()
+ cls.os = cls.get_client_manager()
+
+ @classmethod
+ def setup_clients(cls):
+ super(BaseDataProcessingTest, cls).setup_clients()
+ cls.client = cls.os.data_processing_client
@classmethod
def resource_setup(cls):
super(BaseDataProcessingTest, cls).resource_setup()
- if not CONF.service_available.sahara:
- raise cls.skipException('Sahara support is required')
-
- cls.os = cls.get_client_manager()
- cls.client = cls.os.data_processing_client
cls.flavor_ref = CONF.compute.flavor_ref
diff --git a/tempest/api/database/base.py b/tempest/api/database/base.py
index dd4c684..31c5d2a 100644
--- a/tempest/api/database/base.py
+++ b/tempest/api/database/base.py
@@ -24,22 +24,30 @@
class BaseDatabaseTest(tempest.test.BaseTestCase):
"""Base test case class for all Database API tests."""
- _interface = 'json'
-
@classmethod
- def resource_setup(cls):
- super(BaseDatabaseTest, cls).resource_setup()
+ def skip_checks(cls):
+ super(BaseDatabaseTest, cls).skip_checks()
if not CONF.service_available.trove:
skip_msg = ("%s skipped as trove is not available" % cls.__name__)
raise cls.skipException(skip_msg)
- cls.catalog_type = CONF.database.catalog_type
- cls.db_flavor_ref = CONF.database.db_flavor_ref
- cls.db_current_version = CONF.database.db_current_version
+ @classmethod
+ def setup_credentials(cls):
+ super(BaseDatabaseTest, cls).setup_credentials()
+ cls.os = cls.get_client_manager()
- os = cls.get_client_manager()
- cls.os = os
+ @classmethod
+ def setup_clients(cls):
+ super(BaseDatabaseTest, cls).setup_clients()
cls.database_flavors_client = cls.os.database_flavors_client
cls.os_flavors_client = cls.os.flavors_client
cls.database_limits_client = cls.os.database_limits_client
cls.database_versions_client = cls.os.database_versions_client
+
+ @classmethod
+ def resource_setup(cls):
+ super(BaseDatabaseTest, cls).resource_setup()
+
+ cls.catalog_type = CONF.database.catalog_type
+ cls.db_flavor_ref = CONF.database.db_flavor_ref
+ cls.db_current_version = CONF.database.db_current_version
diff --git a/tempest/api/database/flavors/test_flavors.py b/tempest/api/database/flavors/test_flavors.py
index ed172e9..bb7035b 100644
--- a/tempest/api/database/flavors/test_flavors.py
+++ b/tempest/api/database/flavors/test_flavors.py
@@ -20,8 +20,8 @@
class DatabaseFlavorsTest(base.BaseDatabaseTest):
@classmethod
- def resource_setup(cls):
- super(DatabaseFlavorsTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(DatabaseFlavorsTest, cls).setup_clients()
cls.client = cls.database_flavors_client
@test.attr(type='smoke')
diff --git a/tempest/api/database/flavors/test_flavors_negative.py b/tempest/api/database/flavors/test_flavors_negative.py
index c6acacf..bb9c05d 100644
--- a/tempest/api/database/flavors/test_flavors_negative.py
+++ b/tempest/api/database/flavors/test_flavors_negative.py
@@ -22,8 +22,8 @@
class DatabaseFlavorsNegativeTest(base.BaseDatabaseTest):
@classmethod
- def resource_setup(cls):
- super(DatabaseFlavorsNegativeTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(DatabaseFlavorsNegativeTest, cls).setup_clients()
cls.client = cls.database_flavors_client
@test.attr(type=['negative', 'gate'])
diff --git a/tempest/api/database/limits/test_limits.py b/tempest/api/database/limits/test_limits.py
index 30d0a77..68a3884 100644
--- a/tempest/api/database/limits/test_limits.py
+++ b/tempest/api/database/limits/test_limits.py
@@ -18,7 +18,6 @@
class DatabaseLimitsTest(base.BaseDatabaseTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/database/versions/test_versions.py b/tempest/api/database/versions/test_versions.py
index 80fcecf..37a7407 100644
--- a/tempest/api/database/versions/test_versions.py
+++ b/tempest/api/database/versions/test_versions.py
@@ -18,11 +18,10 @@
class DatabaseVersionsTest(base.BaseDatabaseTest):
- _interface = 'json'
@classmethod
- def resource_setup(cls):
- super(DatabaseVersionsTest, cls).resource_setup()
+ def setup_clients(cls):
+ super(DatabaseVersionsTest, cls).setup_clients()
cls.client = cls.database_versions_client
@test.attr(type='smoke')
diff --git a/tempest/api/identity/admin/test_roles.py b/tempest/api/identity/admin/test_roles.py
index c6c7dc3..80ad6db 100644
--- a/tempest/api/identity/admin/test_roles.py
+++ b/tempest/api/identity/admin/test_roles.py
@@ -21,7 +21,6 @@
class RolesTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/test_roles_negative.py b/tempest/api/identity/admin/test_roles_negative.py
index 789e8b6..2c51715 100644
--- a/tempest/api/identity/admin/test_roles_negative.py
+++ b/tempest/api/identity/admin/test_roles_negative.py
@@ -23,7 +23,6 @@
class RolesNegativeTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
def _get_role_params(self):
self.data.setup_test_user()
diff --git a/tempest/api/identity/admin/test_services.py b/tempest/api/identity/admin/test_services.py
index 30e0058..af38afc 100644
--- a/tempest/api/identity/admin/test_services.py
+++ b/tempest/api/identity/admin/test_services.py
@@ -22,7 +22,6 @@
class ServicesTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
def _del_service(self, service_id):
# Deleting the service created in this method
diff --git a/tempest/api/identity/admin/test_tenant_negative.py b/tempest/api/identity/admin/test_tenant_negative.py
index a4bf263..16ea96a 100644
--- a/tempest/api/identity/admin/test_tenant_negative.py
+++ b/tempest/api/identity/admin/test_tenant_negative.py
@@ -23,7 +23,6 @@
class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
@test.attr(type=['negative', 'gate'])
def test_list_tenants_by_unauthorized_user(self):
diff --git a/tempest/api/identity/admin/test_tenants.py b/tempest/api/identity/admin/test_tenants.py
index 549e952..cfae3a1 100644
--- a/tempest/api/identity/admin/test_tenants.py
+++ b/tempest/api/identity/admin/test_tenants.py
@@ -21,7 +21,6 @@
class TenantsTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
@test.attr(type='gate')
def test_tenant_list_delete(self):
diff --git a/tempest/api/identity/admin/test_tokens.py b/tempest/api/identity/admin/test_tokens.py
index bec621c..5323fde 100644
--- a/tempest/api/identity/admin/test_tokens.py
+++ b/tempest/api/identity/admin/test_tokens.py
@@ -19,7 +19,6 @@
class TokensTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
@test.attr(type='gate')
def test_create_get_delete_token(self):
diff --git a/tempest/api/identity/admin/test_users.py b/tempest/api/identity/admin/test_users.py
index 25312e8..9159468 100644
--- a/tempest/api/identity/admin/test_users.py
+++ b/tempest/api/identity/admin/test_users.py
@@ -21,7 +21,6 @@
class UsersTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/test_users_negative.py b/tempest/api/identity/admin/test_users_negative.py
index 33a2f35..db8c564 100644
--- a/tempest/api/identity/admin/test_users_negative.py
+++ b/tempest/api/identity/admin/test_users_negative.py
@@ -23,7 +23,6 @@
class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_credentials.py b/tempest/api/identity/admin/v3/test_credentials.py
index 6f2f6d4..f22ceec 100644
--- a/tempest/api/identity/admin/v3/test_credentials.py
+++ b/tempest/api/identity/admin/v3/test_credentials.py
@@ -19,7 +19,6 @@
class CredentialsTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_default_project_id.py b/tempest/api/identity/admin/v3/test_default_project_id.py
index bd29cb8..72d323a 100644
--- a/tempest/api/identity/admin/v3/test_default_project_id.py
+++ b/tempest/api/identity/admin/v3/test_default_project_id.py
@@ -18,7 +18,6 @@
class TestDefaultProjectId (base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
@@ -74,8 +73,7 @@
domain_name=dom_name)
auth_provider = auth.KeystoneV3AuthProvider(creds)
creds = auth_provider.fill_credentials()
- admin_client = clients.Manager(interface=self._interface,
- credentials=creds)
+ admin_client = clients.Manager(credentials=creds)
# verify the user's token and see that it is scoped to the project
token, auth_data = admin_client.auth_provider.get_auth()
diff --git a/tempest/api/identity/admin/v3/test_domains.py b/tempest/api/identity/admin/v3/test_domains.py
index c1bc705..0914674 100644
--- a/tempest/api/identity/admin/v3/test_domains.py
+++ b/tempest/api/identity/admin/v3/test_domains.py
@@ -20,7 +20,6 @@
class DomainsTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
def _delete_domain(self, domain_id):
# It is necessary to disable the domain before deleting,
@@ -62,10 +61,7 @@
self.assertIsNotNone(domain['id'])
self.assertEqual(d_name, domain['name'])
self.assertEqual(d_desc, domain['description'])
- if self._interface == "json":
- self.assertEqual(True, domain['enabled'])
- else:
- self.assertEqual('true', str(domain['enabled']).lower())
+ self.assertEqual(True, domain['enabled'])
new_desc = data_utils.rand_name('new-desc-')
new_name = data_utils.rand_name('new-name-')
diff --git a/tempest/api/identity/admin/v3/test_endpoints.py b/tempest/api/identity/admin/v3/test_endpoints.py
index eed0eb5..2283c21 100644
--- a/tempest/api/identity/admin/v3/test_endpoints.py
+++ b/tempest/api/identity/admin/v3/test_endpoints.py
@@ -19,7 +19,6 @@
class EndPointsTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_endpoints_negative.py b/tempest/api/identity/admin/v3/test_endpoints_negative.py
index 9da0a57..9846010 100644
--- a/tempest/api/identity/admin/v3/test_endpoints_negative.py
+++ b/tempest/api/identity/admin/v3/test_endpoints_negative.py
@@ -22,7 +22,6 @@
class EndpointsNegativeTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_groups.py b/tempest/api/identity/admin/v3/test_groups.py
index d8c7063..6dfddb0 100644
--- a/tempest/api/identity/admin/v3/test_groups.py
+++ b/tempest/api/identity/admin/v3/test_groups.py
@@ -19,7 +19,6 @@
class GroupsV3TestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_list_projects.py b/tempest/api/identity/admin/v3/test_list_projects.py
index c0187f9..24b130c 100644
--- a/tempest/api/identity/admin/v3/test_list_projects.py
+++ b/tempest/api/identity/admin/v3/test_list_projects.py
@@ -19,7 +19,6 @@
class ListProjectsTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_list_users.py b/tempest/api/identity/admin/v3/test_list_users.py
index e728867..a6c3309 100644
--- a/tempest/api/identity/admin/v3/test_list_users.py
+++ b/tempest/api/identity/admin/v3/test_list_users.py
@@ -19,7 +19,6 @@
class UsersV3TestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
def _list_users_with_params(self, params, key, expected, not_expected):
# Helper method to list users filtered with params and
diff --git a/tempest/api/identity/admin/v3/test_policies.py b/tempest/api/identity/admin/v3/test_policies.py
index 23df13d..0d5dc47 100644
--- a/tempest/api/identity/admin/v3/test_policies.py
+++ b/tempest/api/identity/admin/v3/test_policies.py
@@ -19,7 +19,6 @@
class PoliciesTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
def _delete_policy(self, policy_id):
self.policy_client.delete_policy(policy_id)
diff --git a/tempest/api/identity/admin/v3/test_projects.py b/tempest/api/identity/admin/v3/test_projects.py
index 2cf6458..d879c7a 100644
--- a/tempest/api/identity/admin/v3/test_projects.py
+++ b/tempest/api/identity/admin/v3/test_projects.py
@@ -19,7 +19,6 @@
class ProjectsTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@test.attr(type='gate')
def test_project_create_with_description(self):
diff --git a/tempest/api/identity/admin/v3/test_projects_negative.py b/tempest/api/identity/admin/v3/test_projects_negative.py
index 23a16d1..fc013c5 100644
--- a/tempest/api/identity/admin/v3/test_projects_negative.py
+++ b/tempest/api/identity/admin/v3/test_projects_negative.py
@@ -22,7 +22,6 @@
class ProjectsNegativeTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@test.attr(type=['negative', 'gate'])
def test_list_projects_by_unauthorized_user(self):
diff --git a/tempest/api/identity/admin/v3/test_regions.py b/tempest/api/identity/admin/v3/test_regions.py
index 2ca3538..359c0cf 100644
--- a/tempest/api/identity/admin/v3/test_regions.py
+++ b/tempest/api/identity/admin/v3/test_regions.py
@@ -21,7 +21,6 @@
class RegionsTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_roles.py b/tempest/api/identity/admin/v3/test_roles.py
index b8b309d..15ca21e 100644
--- a/tempest/api/identity/admin/v3/test_roles.py
+++ b/tempest/api/identity/admin/v3/test_roles.py
@@ -19,7 +19,6 @@
class RolesV3TestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/identity/admin/v3/test_services.py b/tempest/api/identity/admin/v3/test_services.py
index c060094..13e6d66 100644
--- a/tempest/api/identity/admin/v3/test_services.py
+++ b/tempest/api/identity/admin/v3/test_services.py
@@ -21,7 +21,6 @@
class ServicesTestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
def _del_service(self, service_id):
# Used for deleting the services created in this class
diff --git a/tempest/api/identity/admin/v3/test_tokens.py b/tempest/api/identity/admin/v3/test_tokens.py
index de142e0..36be098 100644
--- a/tempest/api/identity/admin/v3/test_tokens.py
+++ b/tempest/api/identity/admin/v3/test_tokens.py
@@ -21,7 +21,6 @@
class TokensV3TestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@test.attr(type='smoke')
def test_tokens(self):
diff --git a/tempest/api/identity/admin/v3/test_trusts.py b/tempest/api/identity/admin/v3/test_trusts.py
index 13c47eb..fd62004 100644
--- a/tempest/api/identity/admin/v3/test_trusts.py
+++ b/tempest/api/identity/admin/v3/test_trusts.py
@@ -16,8 +16,8 @@
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
-from tempest import auth
from tempest import clients
+from tempest.common import cred_provider
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
@@ -89,13 +89,11 @@
self.assertIsNotNone(self.trustee_user_id)
# Initialize a new client with the trustor credentials
- creds = auth.get_credentials(
+ creds = cred_provider.get_credentials(
username=self.trustor_username,
password=self.trustor_password,
tenant_name=self.trustor_project_name)
- os = clients.Manager(
- credentials=creds,
- interface=self._interface)
+ os = clients.Manager(credentials=creds)
self.trustor_client = os.identity_v3_client
def cleanup_user_and_roles(self):
@@ -187,7 +185,6 @@
class TrustsV3TestJSON(BaseTrustsV3Test):
- _interface = 'json'
def setUp(self):
super(TrustsV3TestJSON, self).setUp()
diff --git a/tempest/api/identity/admin/v3/test_users.py b/tempest/api/identity/admin/v3/test_users.py
index 4f3ec05..2481d9d 100644
--- a/tempest/api/identity/admin/v3/test_users.py
+++ b/tempest/api/identity/admin/v3/test_users.py
@@ -19,7 +19,6 @@
class UsersV3TestJSON(base.BaseIdentityV3AdminTest):
- _interface = 'json'
@test.attr(type='gate')
def test_user_update(self):
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index 90e1a9e..8f07a6a 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -15,8 +15,8 @@
from tempest_lib import exceptions as lib_exc
-from tempest import auth
from tempest import clients
+from tempest.common import cred_provider
from tempest.common.utils import data_utils
from tempest import config
from tempest.openstack.common import log as logging
@@ -31,8 +31,8 @@
@classmethod
def resource_setup(cls):
super(BaseIdentityAdminTest, cls).resource_setup()
- cls.os_adm = clients.AdminManager(interface=cls._interface)
- cls.os = clients.Manager(interface=cls._interface)
+ cls.os_adm = clients.AdminManager()
+ cls.os = clients.Manager()
@classmethod
def disable_user(cls, user_name):
@@ -149,11 +149,11 @@
@property
def test_credentials(self):
- return auth.get_credentials(username=self.test_user,
- user_id=self.user['id'],
- password=self.test_password,
- tenant_name=self.test_tenant,
- tenant_id=self.tenant['id'])
+ return cred_provider.get_credentials(username=self.test_user,
+ user_id=self.user['id'],
+ password=self.test_password,
+ tenant_name=self.test_tenant,
+ tenant_id=self.tenant['id'])
def setup_test_user(self):
"""Set up a test user."""
diff --git a/tempest/api/identity/test_extension.py b/tempest/api/identity/test_extension.py
index e3badfc..bbc4c13 100644
--- a/tempest/api/identity/test_extension.py
+++ b/tempest/api/identity/test_extension.py
@@ -18,7 +18,6 @@
class ExtensionTestJSON(base.BaseIdentityV2AdminTest):
- _interface = 'json'
@test.attr(type='gate')
def test_list_extensions(self):
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
index 4d33d37..344742b 100644
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -35,7 +35,6 @@
cls.set_network_resources()
super(BaseImageTest, cls).resource_setup()
cls.created_images = []
- cls._interface = 'json'
cls.isolated_creds = credentials.get_isolated_credentials(
cls.__name__, network_resources=cls.network_resources)
if not CONF.service_available.glance:
diff --git a/tempest/api/image/v2/test_images_member.py b/tempest/api/image/v2/test_images_member.py
index ec1cf14..956829e 100644
--- a/tempest/api/image/v2/test_images_member.py
+++ b/tempest/api/image/v2/test_images_member.py
@@ -15,7 +15,6 @@
class ImagesMemberTest(base.BaseV2MemberImageTest):
- _interface = 'json'
@test.attr(type='gate')
def test_image_share_accept(self):
diff --git a/tempest/api/image/v2/test_images_member_negative.py b/tempest/api/image/v2/test_images_member_negative.py
index 9965286..4402af9 100644
--- a/tempest/api/image/v2/test_images_member_negative.py
+++ b/tempest/api/image/v2/test_images_member_negative.py
@@ -18,7 +18,6 @@
class ImagesMemberNegativeTest(base.BaseV2MemberImageTest):
- _interface = 'json'
@test.attr(type=['negative', 'gate'])
def test_image_share_invalid_status(self):
diff --git a/tempest/api/messaging/test_claims.py b/tempest/api/messaging/test_claims.py
index 1aab8d2..c9064b0 100644
--- a/tempest/api/messaging/test_claims.py
+++ b/tempest/api/messaging/test_claims.py
@@ -29,7 +29,6 @@
class TestClaims(base.BaseMessagingTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/messaging/test_messages.py b/tempest/api/messaging/test_messages.py
index 3c27ac2..dca95fc 100644
--- a/tempest/api/messaging/test_messages.py
+++ b/tempest/api/messaging/test_messages.py
@@ -26,7 +26,6 @@
class TestMessages(base.BaseMessagingTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/messaging/test_queues.py b/tempest/api/messaging/test_queues.py
index 04ba8a3..24656bf 100644
--- a/tempest/api/messaging/test_queues.py
+++ b/tempest/api/messaging/test_queues.py
@@ -48,7 +48,6 @@
class TestManageQueue(base.BaseMessagingTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/admin/test_agent_management.py b/tempest/api/network/admin/test_agent_management.py
index e7fd016..20948cc 100644
--- a/tempest/api/network/admin/test_agent_management.py
+++ b/tempest/api/network/admin/test_agent_management.py
@@ -18,7 +18,6 @@
class AgentManagementTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/admin/test_dhcp_agent_scheduler.py b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
index a89f25c..4eb6b87 100644
--- a/tempest/api/network/admin/test_dhcp_agent_scheduler.py
+++ b/tempest/api/network/admin/test_dhcp_agent_scheduler.py
@@ -17,7 +17,6 @@
class DHCPAgentSchedulersTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/admin/test_external_network_extension.py b/tempest/api/network/admin/test_external_network_extension.py
index 06cce48..6e24f8e 100644
--- a/tempest/api/network/admin/test_external_network_extension.py
+++ b/tempest/api/network/admin/test_external_network_extension.py
@@ -15,7 +15,6 @@
class ExternalNetworksTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/admin/test_external_networks_negative.py b/tempest/api/network/admin/test_external_networks_negative.py
index 8eb6888..aa8dd9a 100644
--- a/tempest/api/network/admin/test_external_networks_negative.py
+++ b/tempest/api/network/admin/test_external_networks_negative.py
@@ -23,7 +23,6 @@
class ExternalNetworksAdminNegativeTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
@test.attr(type=['negative'])
def test_create_port_with_precreated_floatingip_as_fixed_ip(self):
diff --git a/tempest/api/network/admin/test_floating_ips_admin_actions.py b/tempest/api/network/admin/test_floating_ips_admin_actions.py
index 62ba1b3..ee3b0bb 100644
--- a/tempest/api/network/admin/test_floating_ips_admin_actions.py
+++ b/tempest/api/network/admin/test_floating_ips_admin_actions.py
@@ -22,7 +22,7 @@
class FloatingIPAdminTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
+
force_tenant_isolation = True
@classmethod
diff --git a/tempest/api/network/admin/test_l3_agent_scheduler.py b/tempest/api/network/admin/test_l3_agent_scheduler.py
index a6de581..05a8e35 100644
--- a/tempest/api/network/admin/test_l3_agent_scheduler.py
+++ b/tempest/api/network/admin/test_l3_agent_scheduler.py
@@ -18,7 +18,6 @@
class L3AgentSchedulerTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/admin/test_lbaas_agent_scheduler.py b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
index da1af36..8cfd5c2 100644
--- a/tempest/api/network/admin/test_lbaas_agent_scheduler.py
+++ b/tempest/api/network/admin/test_lbaas_agent_scheduler.py
@@ -18,7 +18,6 @@
class LBaaSAgentSchedulerTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/admin/test_load_balancer_admin_actions.py b/tempest/api/network/admin/test_load_balancer_admin_actions.py
index e81616b..2537b28 100644
--- a/tempest/api/network/admin/test_load_balancer_admin_actions.py
+++ b/tempest/api/network/admin/test_load_balancer_admin_actions.py
@@ -19,7 +19,6 @@
class LoadBalancerAdminTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
"""
Test admin actions for load balancer.
diff --git a/tempest/api/network/admin/test_quotas.py b/tempest/api/network/admin/test_quotas.py
index f8dfca9..39850f5 100644
--- a/tempest/api/network/admin/test_quotas.py
+++ b/tempest/api/network/admin/test_quotas.py
@@ -20,7 +20,6 @@
class QuotasTest(base.BaseAdminNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/base.py b/tempest/api/network/base.py
index 520bec7..4cb1485 100644
--- a/tempest/api/network/base.py
+++ b/tempest/api/network/base.py
@@ -50,7 +50,6 @@
neutron as True
"""
- _interface = 'json'
force_tenant_isolation = False
# Default to ipv4.
@@ -421,8 +420,7 @@
try:
creds = cls.isolated_creds.get_admin_creds()
- cls.os_adm = clients.Manager(
- credentials=creds, interface=cls._interface)
+ cls.os_adm = clients.Manager(credentials=creds)
except NotImplementedError:
msg = ("Missing Administrative Network API credentials "
"in configuration.")
diff --git a/tempest/api/network/test_allowed_address_pair.py b/tempest/api/network/test_allowed_address_pair.py
index 57887ac..a4954af 100644
--- a/tempest/api/network/test_allowed_address_pair.py
+++ b/tempest/api/network/test_allowed_address_pair.py
@@ -23,7 +23,6 @@
class AllowedAddressPairTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the Neutron Allowed Address Pair API extension using the Tempest
diff --git a/tempest/api/network/test_extensions.py b/tempest/api/network/test_extensions.py
index 54c3cb9..2b4ccaf 100644
--- a/tempest/api/network/test_extensions.py
+++ b/tempest/api/network/test_extensions.py
@@ -19,7 +19,6 @@
class ExtensionsTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/test_extra_dhcp_options.py b/tempest/api/network/test_extra_dhcp_options.py
index bd70323..1faac58 100644
--- a/tempest/api/network/test_extra_dhcp_options.py
+++ b/tempest/api/network/test_extra_dhcp_options.py
@@ -19,7 +19,6 @@
class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the following operations with the Extra DHCP Options Neutron API
diff --git a/tempest/api/network/test_floating_ips.py b/tempest/api/network/test_floating_ips.py
index 1151c5d..43b296c 100644
--- a/tempest/api/network/test_floating_ips.py
+++ b/tempest/api/network/test_floating_ips.py
@@ -24,7 +24,6 @@
class FloatingIPTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Quantum API using the REST client for
diff --git a/tempest/api/network/test_floating_ips_negative.py b/tempest/api/network/test_floating_ips_negative.py
index 7e91ba2..81eedd4 100644
--- a/tempest/api/network/test_floating_ips_negative.py
+++ b/tempest/api/network/test_floating_ips_negative.py
@@ -26,7 +26,7 @@
class FloatingIPNegativeTestJSON(base.BaseNetworkTest):
- _interface = 'json'
+
"""
Test the following negative operations for floating ips:
diff --git a/tempest/api/network/test_fwaas_extensions.py b/tempest/api/network/test_fwaas_extensions.py
index b0318c9..280c5bb 100644
--- a/tempest/api/network/test_fwaas_extensions.py
+++ b/tempest/api/network/test_fwaas_extensions.py
@@ -24,7 +24,6 @@
class FWaaSExtensionTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/test_load_balancer.py b/tempest/api/network/test_load_balancer.py
index df76757..107d8cd 100644
--- a/tempest/api/network/test_load_balancer.py
+++ b/tempest/api/network/test_load_balancer.py
@@ -21,7 +21,6 @@
class LoadBalancerTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/test_metering_extensions.py b/tempest/api/network/test_metering_extensions.py
index 6ba1ea4..c80d0e9 100644
--- a/tempest/api/network/test_metering_extensions.py
+++ b/tempest/api/network/test_metering_extensions.py
@@ -24,7 +24,6 @@
class MeteringTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/test_networks.py b/tempest/api/network/test_networks.py
index a5f9667..0df455e 100644
--- a/tempest/api/network/test_networks.py
+++ b/tempest/api/network/test_networks.py
@@ -27,7 +27,6 @@
class NetworksTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
@@ -399,7 +398,6 @@
class BulkNetworkOpsTestJSON(base.BaseNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/network/test_networks_negative.py b/tempest/api/network/test_networks_negative.py
index b694728..09bd9c3 100644
--- a/tempest/api/network/test_networks_negative.py
+++ b/tempest/api/network/test_networks_negative.py
@@ -22,7 +22,6 @@
class NetworksNegativeTestJSON(base.BaseNetworkTest):
- _interface = 'json'
@test.attr(type=['negative', 'smoke'])
def test_show_non_existent_network(self):
diff --git a/tempest/api/network/test_ports.py b/tempest/api/network/test_ports.py
index bf85e90..2460092 100644
--- a/tempest/api/network/test_ports.py
+++ b/tempest/api/network/test_ports.py
@@ -27,7 +27,6 @@
class PortsTestJSON(sec_base.BaseSecGroupTest):
- _interface = 'json'
"""
Test the following operations for ports:
@@ -300,7 +299,6 @@
class PortsAdminExtendedAttrsTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/test_routers.py b/tempest/api/network/test_routers.py
index 210a8af..b0ee00d 100644
--- a/tempest/api/network/test_routers.py
+++ b/tempest/api/network/test_routers.py
@@ -25,7 +25,6 @@
class RoutersTest(base.BaseRouterTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/test_routers_negative.py b/tempest/api/network/test_routers_negative.py
index 32dcf74..655fa58 100644
--- a/tempest/api/network/test_routers_negative.py
+++ b/tempest/api/network/test_routers_negative.py
@@ -26,7 +26,6 @@
class RoutersNegativeTest(base.BaseRouterTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/test_security_groups.py b/tempest/api/network/test_security_groups.py
index 415dedd..3d26b48 100644
--- a/tempest/api/network/test_security_groups.py
+++ b/tempest/api/network/test_security_groups.py
@@ -24,7 +24,7 @@
class SecGroupTest(base.BaseSecGroupTest):
- _interface = 'json'
+
_tenant_network_cidr = CONF.network.tenant_network_cidr
@classmethod
diff --git a/tempest/api/network/test_security_groups_negative.py b/tempest/api/network/test_security_groups_negative.py
index 0398c66..47b218c 100644
--- a/tempest/api/network/test_security_groups_negative.py
+++ b/tempest/api/network/test_security_groups_negative.py
@@ -26,7 +26,7 @@
class NegativeSecGroupTest(base.BaseSecGroupTest):
- _interface = 'json'
+
_tenant_network_cidr = CONF.network.tenant_network_cidr
@classmethod
diff --git a/tempest/api/network/test_service_type_management.py b/tempest/api/network/test_service_type_management.py
index 0492fe3..e620ae6 100644
--- a/tempest/api/network/test_service_type_management.py
+++ b/tempest/api/network/test_service_type_management.py
@@ -17,7 +17,6 @@
class ServiceTypeManagementTestJSON(base.BaseNetworkTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/network/test_vpnaas_extensions.py b/tempest/api/network/test_vpnaas_extensions.py
index 9ff406c..d869b55 100644
--- a/tempest/api/network/test_vpnaas_extensions.py
+++ b/tempest/api/network/test_vpnaas_extensions.py
@@ -24,7 +24,6 @@
class VPNaaSTestJSON(base.BaseAdminNetworkTest):
- _interface = 'json'
"""
Tests the following operations in the Neutron API using the REST client for
diff --git a/tempest/api/orchestration/base.py b/tempest/api/orchestration/base.py
index 2a99630..6873756 100644
--- a/tempest/api/orchestration/base.py
+++ b/tempest/api/orchestration/base.py
@@ -59,7 +59,7 @@
@classmethod
def _get_identity_admin_client(cls):
"""Returns an instance of the Identity Admin API client."""
- manager = clients.AdminManager(interface=cls._interface)
+ manager = clients.AdminManager()
admin_client = manager.identity_client
return admin_client
diff --git a/tempest/api/telemetry/test_telemetry_alarming_api.py b/tempest/api/telemetry/test_telemetry_alarming_api.py
index 2457438..05aed08 100644
--- a/tempest/api/telemetry/test_telemetry_alarming_api.py
+++ b/tempest/api/telemetry/test_telemetry_alarming_api.py
@@ -18,7 +18,6 @@
class TelemetryAlarmingAPITestJSON(base.BaseTelemetryTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/telemetry/test_telemetry_notification_api.py b/tempest/api/telemetry/test_telemetry_notification_api.py
index 4223dfc..048e305 100644
--- a/tempest/api/telemetry/test_telemetry_notification_api.py
+++ b/tempest/api/telemetry/test_telemetry_notification_api.py
@@ -21,7 +21,6 @@
class TelemetryNotificationAPITestJSON(base.BaseTelemetryTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index 65c4bd3..245161a 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -22,7 +22,6 @@
class VolumeMultiBackendV2Test(base.BaseVolumeAdminTest):
- _interface = "json"
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/admin/test_snapshots_actions.py b/tempest/api/volume/admin/test_snapshots_actions.py
index 6c64298..e7d9d7b 100644
--- a/tempest/api/volume/admin/test_snapshots_actions.py
+++ b/tempest/api/volume/admin/test_snapshots_actions.py
@@ -19,7 +19,6 @@
class SnapshotsActionsV2Test(base.BaseVolumeAdminTest):
- _interface = "json"
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/admin/test_volume_hosts.py b/tempest/api/volume/admin/test_volume_hosts.py
index a214edf..8189aab 100644
--- a/tempest/api/volume/admin/test_volume_hosts.py
+++ b/tempest/api/volume/admin/test_volume_hosts.py
@@ -18,7 +18,6 @@
class VolumeHostsAdminV2TestsJSON(base.BaseVolumeAdminTest):
- _interface = "json"
@test.attr(type='gate')
def test_list_hosts(self):
diff --git a/tempest/api/volume/admin/test_volume_quotas.py b/tempest/api/volume/admin/test_volume_quotas.py
index 52f2d90..2a30b54 100644
--- a/tempest/api/volume/admin/test_volume_quotas.py
+++ b/tempest/api/volume/admin/test_volume_quotas.py
@@ -23,7 +23,6 @@
class BaseVolumeQuotasAdminV2TestJSON(base.BaseVolumeAdminTest):
- _interface = "json"
force_tenant_isolation = True
@classmethod
diff --git a/tempest/api/volume/admin/test_volume_quotas_negative.py b/tempest/api/volume/admin/test_volume_quotas_negative.py
index d5eb05a..f972457 100644
--- a/tempest/api/volume/admin/test_volume_quotas_negative.py
+++ b/tempest/api/volume/admin/test_volume_quotas_negative.py
@@ -20,7 +20,6 @@
class BaseVolumeQuotasNegativeV2TestJSON(base.BaseVolumeAdminTest):
- _interface = "json"
force_tenant_isolation = True
@classmethod
diff --git a/tempest/api/volume/admin/test_volume_services.py b/tempest/api/volume/admin/test_volume_services.py
index 46db70f..3bab185 100644
--- a/tempest/api/volume/admin/test_volume_services.py
+++ b/tempest/api/volume/admin/test_volume_services.py
@@ -22,7 +22,6 @@
Tests Volume Services API.
volume service list requires admin privileges.
"""
- _interface = "json"
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
index 58f1551..f2c1dda 100644
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -22,7 +22,6 @@
class VolumeTypesV2Test(base.BaseVolumeAdminTest):
- _interface = "json"
def _delete_volume(self, volume_id):
self.volumes_client.delete_volume(volume_id)
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs.py b/tempest/api/volume/admin/test_volume_types_extra_specs.py
index 460a6c3..1ce1402 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs.py
@@ -19,7 +19,6 @@
class VolumeTypesExtraSpecsV2Test(base.BaseVolumeAdminTest):
- _interface = "json"
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
index 2e2cfd2..2f3b382 100644
--- a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
@@ -24,7 +24,6 @@
class ExtraSpecsNegativeV2Test(base.BaseVolumeAdminTest):
- _interface = 'json'
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/admin/test_volume_types_negative.py b/tempest/api/volume/admin/test_volume_types_negative.py
index 18d54fa..77ca34c 100644
--- a/tempest/api/volume/admin/test_volume_types_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_negative.py
@@ -23,7 +23,6 @@
class VolumeTypesNegativeV2Test(base.BaseVolumeAdminTest):
- _interface = 'json'
@test.attr(type='gate')
def test_create_with_nonexistent_volume_type(self):
diff --git a/tempest/api/volume/admin/test_volumes_actions.py b/tempest/api/volume/admin/test_volumes_actions.py
index 4feba73..439dd35 100644
--- a/tempest/api/volume/admin/test_volumes_actions.py
+++ b/tempest/api/volume/admin/test_volumes_actions.py
@@ -19,7 +19,6 @@
class VolumesActionsV2Test(base.BaseVolumeAdminTest):
- _interface = "json"
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
index 0739480..d572893 100644
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -24,7 +24,6 @@
class VolumesBackupsV2Test(base.BaseVolumeAdminTest):
- _interface = "json"
@classmethod
def resource_setup(cls):
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index a1858de..2489b79 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -31,7 +31,6 @@
"""Base test case class for all Cinder API tests."""
_api_version = 2
- _interface = 'json'
@classmethod
def resource_setup(cls):
@@ -155,8 +154,7 @@
try:
cls.adm_creds = cls.isolated_creds.get_admin_creds()
- cls.os_adm = clients.Manager(
- credentials=cls.adm_creds, interface=cls._interface)
+ cls.os_adm = clients.Manager(credentials=cls.adm_creds)
except NotImplementedError:
msg = "Missing Volume Admin API credentials in configuration."
raise cls.skipException(msg)
diff --git a/tempest/api/volume/test_volume_transfers.py b/tempest/api/volume/test_volume_transfers.py
index b2961bd..7451050 100644
--- a/tempest/api/volume/test_volume_transfers.py
+++ b/tempest/api/volume/test_volume_transfers.py
@@ -30,13 +30,11 @@
super(VolumesV2TransfersTest, cls).resource_setup()
# Add another tenant to test volume-transfer
- cls.os_alt = clients.Manager(cls.isolated_creds.get_alt_creds(),
- interface=cls._interface)
+ cls.os_alt = clients.Manager(cls.isolated_creds.get_alt_creds())
# Add admin tenant to cleanup resources
try:
creds = cls.isolated_creds.get_admin_creds()
- cls.os_adm = clients.Manager(
- credentials=creds, interface=cls._interface)
+ cls.os_adm = clients.Manager(credentials=creds)
except NotImplementedError:
msg = "Missing Volume Admin API credentials in configuration."
raise cls.skipException(msg)
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
index 6d9c438..2a49210 100644
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -37,15 +37,6 @@
self.client.delete_volume(volume_id)
self.client.wait_for_resource_deletion(volume_id)
- def _is_true(self, val):
- # NOTE(jdg): Temporary conversion method to get cinder patch
- # merged. Then we'll make this strict again and
- # specifically check "true" or "false"
- if val in ['true', 'True', True]:
- return True
- else:
- return False
-
def _volume_create_get_update_delete(self, **kwargs):
# Create a volume, Get it's details and Delete the volume
volume = {}
@@ -79,13 +70,10 @@
'The fetched Volume metadata misses data '
'from the created Volume')
- # NOTE(jdg): Revert back to strict true/false checking
- # after fix for bug #1227837 merges
- boot_flag = self._is_true(fetched_volume['bootable'])
if 'imageRef' in kwargs:
- self.assertEqual(boot_flag, True)
+ self.assertEqual('true', fetched_volume['bootable'])
if 'imageRef' not in kwargs:
- self.assertEqual(boot_flag, False)
+ self.assertEqual('false', fetched_volume['bootable'])
# Update Volume
# Test volume update when display_name is same with original value
@@ -125,13 +113,10 @@
self.descrip_field: volume[self.descrip_field]}
self.client.update_volume(new_volume['id'], **params)
- # NOTE(jdg): Revert back to strict true/false checking
- # after fix for bug #1227837 merges
- boot_flag = self._is_true(updated_volume['bootable'])
if 'imageRef' in kwargs:
- self.assertEqual(boot_flag, True)
+ self.assertEqual('true', updated_volume['bootable'])
if 'imageRef' not in kwargs:
- self.assertEqual(boot_flag, False)
+ self.assertEqual('false', updated_volume['bootable'])
@test.attr(type='smoke')
def test_volume_create_get_update_delete(self):
diff --git a/tempest/auth.py b/tempest/auth.py
index 5820893..7e1928f 100644
--- a/tempest/auth.py
+++ b/tempest/auth.py
@@ -38,34 +38,21 @@
Provide authentication
"""
- def __init__(self, credentials, interface=None):
+ def __init__(self, credentials):
"""
:param credentials: credentials for authentication
- :param interface: 'json' or 'xml'. Applicable for tempest client only
- (deprecated: only json now supported)
"""
- credentials = self._convert_credentials(credentials)
if self.check_credentials(credentials):
self.credentials = credentials
else:
raise TypeError("Invalid credentials")
- self.interface = 'json'
self.cache = None
self.alt_auth_data = None
self.alt_part = None
- def _convert_credentials(self, credentials):
- # Support dict credentials for backwards compatibility
- if isinstance(credentials, dict):
- return get_credentials(**credentials)
- else:
- return credentials
-
def __str__(self):
- return "Creds :{creds}, interface: {interface}, " \
- "cached auth data: {cache}".format(
- creds=self.credentials, interface=self.interface,
- cache=self.cache)
+ return "Creds :{creds}, cached auth data: {cache}".format(
+ creds=self.credentials, cache=self.cache)
@abc.abstractmethod
def _decorate_request(self, filters, method, url, headers=None, body=None,
@@ -201,8 +188,8 @@
token_expiry_threshold = datetime.timedelta(seconds=60)
- def __init__(self, credentials, interface=None):
- super(KeystoneAuthProvider, self).__init__(credentials, interface)
+ def __init__(self, credentials):
+ super(KeystoneAuthProvider, self).__init__(credentials)
self.auth_client = self._auth_client()
def _decorate_request(self, filters, method, url, headers=None, body=None,
@@ -440,7 +427,11 @@
datetime.datetime.utcnow()
-def get_credentials(fill_in=True, **kwargs):
+def is_identity_version_supported(identity_version):
+ return identity_version in IDENTITY_VERSION
+
+
+def get_credentials(fill_in=True, identity_version='v2', **kwargs):
"""
Builds a credentials object based on the configured auth_version
@@ -448,6 +439,8 @@
details provided by the identity service. When fill_in is not
specified, credentials are not validated. Validation can be invoked
by invoking ``is_valid()``
+ :param identity_version (string): identity API version is used to
+ select the matching auth provider and credentials class
:param kwargs (dict): Dict of credential key/value pairs
Examples:
@@ -458,14 +451,13 @@
Returns credentials including IDs:
>>> get_credentials(username='foo', password='bar', fill_in=True)
"""
- if CONF.identity.auth_version == 'v2':
- credential_class = KeystoneV2Credentials
- auth_provider_class = KeystoneV2AuthProvider
- elif CONF.identity.auth_version == 'v3':
- credential_class = KeystoneV3Credentials
- auth_provider_class = KeystoneV3AuthProvider
- else:
- raise exceptions.InvalidConfiguration('Unsupported auth version')
+ if not is_identity_version_supported(identity_version):
+ raise exceptions.InvalidIdentityVersion(
+ identity_version=identity_version)
+
+ credential_class, auth_provider_class = IDENTITY_VERSION.get(
+ identity_version)
+
creds = credential_class(**kwargs)
# Fill in the credentials fields that were not specified
if fill_in:
@@ -638,3 +630,7 @@
self.project_id is not None,
self.project_name is not None and valid_project_domain])
return all([self.password is not None, valid_user, valid_project])
+
+
+IDENTITY_VERSION = {'v2': (KeystoneV2Credentials, KeystoneV2AuthProvider),
+ 'v3': (KeystoneV3Credentials, KeystoneV3AuthProvider)}
diff --git a/tempest/cli/simple_read_only/compute/__init__.py b/tempest/cli/simple_read_only/compute/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tempest/cli/simple_read_only/compute/__init__.py
+++ /dev/null
diff --git a/tempest/cli/simple_read_only/compute/test_nova.py b/tempest/cli/simple_read_only/compute/test_nova.py
deleted file mode 100644
index aee92fa..0000000
--- a/tempest/cli/simple_read_only/compute/test_nova.py
+++ /dev/null
@@ -1,209 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from tempest_lib import decorators
-from tempest_lib import exceptions
-import testtools
-
-from tempest import cli
-from tempest import config
-from tempest.openstack.common import log as logging
-
-CONF = config.CONF
-
-LOG = logging.getLogger(__name__)
-
-
-class SimpleReadOnlyNovaClientTest(cli.ClientTestBase):
-
- """
- This is a first pass at a simple read only python-novaclient test. This
- only exercises client commands that are read only.
-
- This should test commands:
- * as a regular user
- * as a admin user
- * with and without optional parameters
- * initially just check return codes, and later test command outputs
-
- """
-
- @classmethod
- def resource_setup(cls):
- if not CONF.service_available.nova:
- msg = ("%s skipped as Nova is not available" % cls.__name__)
- raise cls.skipException(msg)
- super(SimpleReadOnlyNovaClientTest, cls).resource_setup()
-
- def nova(self, *args, **kwargs):
- return self.clients.nova(*args,
- endpoint_type=CONF.compute.endpoint_type,
- **kwargs)
-
- def test_admin_fake_action(self):
- self.assertRaises(exceptions.CommandFailed,
- self.nova,
- 'this-does-nova-exist')
-
- # NOTE(jogo): Commands in order listed in 'nova help'
-
- # Positional arguments:
-
- def test_admin_absolute_limites(self):
- self.nova('absolute-limits')
- self.nova('absolute-limits', params='--reserved')
-
- def test_admin_aggregate_list(self):
- self.nova('aggregate-list')
-
- def test_admin_availability_zone_list(self):
- self.assertIn("internal", self.nova('availability-zone-list'))
-
- def test_admin_cloudpipe_list(self):
- self.nova('cloudpipe-list')
-
- def test_admin_credentials(self):
- self.nova('credentials')
-
- @testtools.skipIf(CONF.service_available.neutron,
- "Neutron does not provide this feature")
- def test_admin_dns_domains(self):
- self.nova('dns-domains')
-
- @decorators.skip_because(bug="1157349")
- def test_admin_dns_list(self):
- self.nova('dns-list')
-
- def test_admin_endpoints(self):
- self.nova('endpoints')
-
- def test_admin_flavor_acces_list(self):
- self.assertRaises(exceptions.CommandFailed,
- self.nova,
- 'flavor-access-list')
- # Failed to get access list for public flavor type
- self.assertRaises(exceptions.CommandFailed,
- self.nova,
- 'flavor-access-list',
- params='--flavor m1.tiny')
-
- def test_admin_flavor_list(self):
- self.assertIn("Memory_MB", self.nova('flavor-list'))
-
- def test_admin_floating_ip_bulk_list(self):
- self.nova('floating-ip-bulk-list')
-
- def test_admin_floating_ip_list(self):
- self.nova('floating-ip-list')
-
- def test_admin_floating_ip_pool_list(self):
- self.nova('floating-ip-pool-list')
-
- def test_admin_host_list(self):
- self.nova('host-list')
-
- def test_admin_hypervisor_list(self):
- self.nova('hypervisor-list')
-
- def test_admin_image_list(self):
- self.nova('image-list')
-
- @decorators.skip_because(bug="1157349")
- def test_admin_interface_list(self):
- self.nova('interface-list')
-
- def test_admin_keypair_list(self):
- self.nova('keypair-list')
-
- def test_admin_list(self):
- self.nova('list')
- self.nova('list', params='--all-tenants 1')
- self.nova('list', params='--all-tenants 0')
- self.assertRaises(exceptions.CommandFailed,
- self.nova,
- 'list',
- params='--all-tenants bad')
-
- def test_admin_network_list(self):
- self.nova('network-list')
-
- def test_admin_rate_limits(self):
- self.nova('rate-limits')
-
- def test_admin_secgroup_list(self):
- self.nova('secgroup-list')
-
- @decorators.skip_because(bug="1157349")
- def test_admin_secgroup_list_rules(self):
- self.nova('secgroup-list-rules')
-
- @cli.min_client_version(client='nova', version='2.18')
- def test_admin_server_group_list(self):
- self.nova('server-group-list')
-
- def test_admin_servce_list(self):
- self.nova('service-list')
-
- def test_admin_usage(self):
- self.nova('usage')
-
- def test_admin_usage_list(self):
- self.nova('usage-list')
-
- @testtools.skipIf(not CONF.service_available.cinder,
- "Skipped as Cinder is not available")
- def test_admin_volume_list(self):
- self.nova('volume-list')
-
- @testtools.skipIf(not CONF.service_available.cinder,
- "Skipped as Cinder is not available")
- def test_admin_volume_snapshot_list(self):
- self.nova('volume-snapshot-list')
-
- @testtools.skipIf(not CONF.service_available.cinder,
- "Skipped as Cinder is not available")
- def test_admin_volume_type_list(self):
- self.nova('volume-type-list')
-
- def test_admin_help(self):
- self.nova('help')
-
- def test_admin_list_extensions(self):
- self.nova('list-extensions')
-
- def test_admin_net_list(self):
- self.nova('net-list')
-
- def test_agent_list(self):
- self.nova('agent-list')
- self.nova('agent-list', flags='--debug')
-
- def test_migration_list(self):
- self.nova('migration-list')
- self.nova('migration-list', flags='--debug')
-
- # Optional arguments:
-
- def test_admin_version(self):
- self.nova('', flags='--version')
-
- def test_admin_debug_list(self):
- self.nova('list', flags='--debug')
-
- def test_admin_timeout(self):
- self.nova('list', flags='--timeout %d' % CONF.cli.timeout)
-
- def test_admin_timing(self):
- self.nova('list', flags='--timing')
diff --git a/tempest/clients.py b/tempest/clients.py
index cbc6571..786e05f 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -64,7 +64,8 @@
TenantUsagesClientJSON
from tempest.services.compute.json.volumes_extensions_client import \
VolumesExtensionsClientJSON
-from tempest.services.data_processing.v1_1.client import DataProcessingClient
+from tempest.services.data_processing.v1_1.data_processing_client import \
+ DataProcessingClient
from tempest.services.database.json.flavors_client import \
DatabaseFlavorsClientJSON
from tempest.services.database.json.limits_client import \
@@ -155,10 +156,7 @@
}
default_params_with_timeout_values.update(default_params)
- def __init__(self, credentials=None, interface='json', service=None):
- # Set interface and client type first
- self.interface = interface
- # super cares for credentials validation
+ def __init__(self, credentials=None, service=None):
super(Manager, self).__init__(credentials=credentials)
self._set_compute_clients()
@@ -204,6 +202,12 @@
build_interval=CONF.orchestration.build_interval,
build_timeout=CONF.orchestration.build_timeout,
**self.default_params)
+ self.data_processing_client = DataProcessingClient(
+ self.auth_provider,
+ CONF.data_processing.catalog_type,
+ CONF.identity.region,
+ endpoint_type=CONF.data_processing.endpoint_type,
+ **self.default_params_with_timeout_values)
self.negative_client = negative_rest_client.NegativeRestClient(
self.auth_provider, service)
@@ -214,8 +218,6 @@
self.credentials.tenant_name)
self.ec2api_client = botoclients.APIClientEC2(*ec2_client_args)
self.s3_client = botoclients.ObjectClientS3(*ec2_client_args)
- self.data_processing_client = DataProcessingClient(
- self.auth_provider)
def _set_compute_clients(self):
params = {
@@ -330,9 +332,12 @@
**params)
self.snapshots_v2_client = SnapshotsV2ClientJSON(self.auth_provider,
**params)
- self.volumes_client = VolumesClientJSON(self.auth_provider, **params)
- self.volumes_v2_client = VolumesV2ClientJSON(self.auth_provider,
- **params)
+ self.volumes_client = VolumesClientJSON(
+ self.auth_provider, default_volume_size=CONF.volume.volume_size,
+ **params)
+ self.volumes_v2_client = VolumesV2ClientJSON(
+ self.auth_provider, default_volume_size=CONF.volume.volume_size,
+ **params)
self.volume_types_client = VolumeTypesClientJSON(self.auth_provider,
**params)
self.volume_services_client = VolumesServicesClientJSON(
@@ -376,9 +381,8 @@
managed client objects
"""
- def __init__(self, interface='json', service=None):
+ def __init__(self, service=None):
super(AdminManager, self).__init__(
credentials=cred_provider.get_configured_credentials(
'identity_admin'),
- interface=interface,
service=service)
diff --git a/tempest/cmd/cleanup.py b/tempest/cmd/cleanup.py
index 28992b9..c52704a 100755
--- a/tempest/cmd/cleanup.py
+++ b/tempest/cmd/cleanup.py
@@ -54,9 +54,9 @@
import json
import sys
-from tempest import auth
from tempest import clients
from tempest.cmd import cleanup_service
+from tempest.common import cred_provider
from tempest import config
from tempest.openstack.common import log as logging
@@ -159,7 +159,8 @@
kwargs = {"username": CONF.identity.admin_username,
"password": CONF.identity.admin_password,
"tenant_name": tenant['name']}
- mgr = clients.Manager(credentials=auth.get_credentials(**kwargs))
+ mgr = clients.Manager(credentials=cred_provider.get_credentials(
+ **kwargs))
kwargs = {'data': tenant_data,
'is_dry_run': is_dry_run,
'saved_state_json': None,
diff --git a/tempest/cmd/verify_tempest_config.py b/tempest/cmd/verify_tempest_config.py
index 65a3a95..87f5ca6 100755
--- a/tempest/cmd/verify_tempest_config.py
+++ b/tempest/cmd/verify_tempest_config.py
@@ -327,7 +327,7 @@
CONF_PARSER = moves.configparser.SafeConfigParser()
CONF_PARSER.optionxform = str
CONF_PARSER.readfp(conf_file)
- os = clients.AdminManager(interface='json')
+ os = clients.AdminManager()
services = check_service_availability(os, update)
results = {}
for service in ['nova', 'cinder', 'neutron', 'swift']:
diff --git a/tempest/common/accounts.py b/tempest/common/accounts.py
index 35a1f86..dd8d498 100644
--- a/tempest/common/accounts.py
+++ b/tempest/common/accounts.py
@@ -17,7 +17,6 @@
import yaml
-from tempest import auth
from tempest.common import cred_provider
from tempest import config
from tempest import exceptions
@@ -123,7 +122,7 @@
if self.isolated_creds.get('primary'):
return self.isolated_creds.get('primary')
creds = self._get_creds()
- primary_credential = auth.get_credentials(**creds)
+ primary_credential = cred_provider.get_credentials(**creds)
self.isolated_creds['primary'] = primary_credential
return primary_credential
@@ -131,7 +130,7 @@
if self.isolated_creds.get('alt'):
return self.isolated_creds.get('alt')
creds = self._get_creds()
- alt_credential = auth.get_credentials(**creds)
+ alt_credential = cred_provider.get_credentials(**creds)
self.isolated_creds['alt'] = alt_credential
return alt_credential
@@ -189,7 +188,7 @@
return self.isolated_creds.get('primary')
if not self.use_default_creds:
creds = self.get_creds(0)
- primary_credential = auth.get_credentials(**creds)
+ primary_credential = cred_provider.get_credentials(**creds)
else:
primary_credential = cred_provider.get_configured_credentials(
'user')
@@ -201,7 +200,7 @@
return self.isolated_creds.get('alt')
if not self.use_default_creds:
creds = self.get_creds(1)
- alt_credential = auth.get_credentials(**creds)
+ alt_credential = cred_provider.get_credentials(**creds)
else:
alt_credential = cred_provider.get_configured_credentials(
'alt_user')
diff --git a/tempest/common/cred_provider.py b/tempest/common/cred_provider.py
index 07fd03f..f40ed7a 100644
--- a/tempest/common/cred_provider.py
+++ b/tempest/common/cred_provider.py
@@ -56,7 +56,7 @@
params[attr] = getattr(_section, prefix + "_" + attr)
# Build and validate credentials. We are reading configured credentials,
# so validate them even if fill_in is False
- credentials = auth.get_credentials(fill_in=fill_in, **params)
+ credentials = get_credentials(fill_in=fill_in, **params)
if not fill_in:
if not credentials.is_valid():
msg = ("The %s credentials are incorrectly set in the config file."
@@ -66,10 +66,18 @@
return credentials
+# Wrapper around auth.get_credentials to use the configured identity version
+# is none is specified
+def get_credentials(fill_in=True, identity_version=None, **kwargs):
+ identity_version = identity_version or CONF.identity.auth_version
+ return auth.get_credentials(fill_in=fill_in,
+ identity_version=identity_version,
+ **kwargs)
+
+
@six.add_metaclass(abc.ABCMeta)
class CredentialProvider(object):
- def __init__(self, name, interface='json', password='pass',
- network_resources=None):
+ def __init__(self, name, password='pass', network_resources=None):
self.name = name
@abc.abstractmethod
diff --git a/tempest/common/isolated_creds.py b/tempest/common/isolated_creds.py
index 5c2fa58..1cfb963 100644
--- a/tempest/common/isolated_creds.py
+++ b/tempest/common/isolated_creds.py
@@ -15,7 +15,6 @@
import netaddr
from tempest_lib import exceptions as lib_exc
-from tempest import auth
from tempest import clients
from tempest.common import cred_provider
from tempest.common.utils import data_utils
@@ -29,15 +28,12 @@
class IsolatedCreds(cred_provider.CredentialProvider):
- def __init__(self, name, interface='json', password='pass',
- network_resources=None):
- super(IsolatedCreds, self).__init__(name, interface, password,
- network_resources)
+ def __init__(self, name, password='pass', network_resources=None):
+ super(IsolatedCreds, self).__init__(name, password, network_resources)
self.network_resources = network_resources
self.isolated_creds = {}
self.isolated_net_resources = {}
self.ports = []
- self.interface = interface
self.password = password
self.identity_admin_client, self.network_admin_client = (
self._get_admin_clients())
@@ -49,7 +45,7 @@
identity
network
"""
- os = clients.AdminManager(interface=self.interface)
+ os = clients.AdminManager()
return os.identity_client, os.network_client
def _create_tenant(self, name, description):
@@ -130,7 +126,7 @@
return self._get_credentials(user, tenant)
def _get_credentials(self, user, tenant):
- return auth.get_credentials(
+ return cred_provider.get_credentials(
username=user['name'], user_id=user['id'],
tenant_name=tenant['name'], tenant_id=tenant['id'],
password=self.password)
diff --git a/tempest/exceptions.py b/tempest/exceptions.py
index 81db5d9..09f7016 100644
--- a/tempest/exceptions.py
+++ b/tempest/exceptions.py
@@ -63,6 +63,10 @@
message = "Invalid service tag"
+class InvalidIdentityVersion(TempestException):
+ message = "Invalid version %(identity_version) of the identity service"
+
+
class TimeoutException(TempestException):
message = "Request timed out"
diff --git a/tempest/manager.py b/tempest/manager.py
index 2b00e89..421d2de 100644
--- a/tempest/manager.py
+++ b/tempest/manager.py
@@ -64,5 +64,4 @@
'Credentials must be specified')
auth_provider_class = self.get_auth_provider_class(credentials)
return auth_provider_class(
- interface=getattr(self, 'interface', None),
credentials=credentials)
diff --git a/tempest/services/data_processing/v1_1/client.py b/tempest/services/data_processing/v1_1/data_processing_client.py
similarity index 97%
rename from tempest/services/data_processing/v1_1/client.py
rename to tempest/services/data_processing/v1_1/data_processing_client.py
index 8879373..04cf9a3 100644
--- a/tempest/services/data_processing/v1_1/client.py
+++ b/tempest/services/data_processing/v1_1/data_processing_client.py
@@ -15,20 +15,10 @@
import json
from tempest.common import service_client
-from tempest import config
-
-CONF = config.CONF
class DataProcessingClient(service_client.ServiceClient):
- def __init__(self, auth_provider):
- super(DataProcessingClient, self).__init__(
- auth_provider,
- CONF.data_processing.catalog_type,
- CONF.identity.region,
- endpoint_type=CONF.data_processing.endpoint_type)
-
def _request_and_check_resp(self, request_func, uri, resp_status):
"""Make a request using specified request_func and check response
status code.
diff --git a/tempest/services/database/json/limits_client.py b/tempest/services/database/json/limits_client.py
index 4daf028..6168bfd 100644
--- a/tempest/services/database/json/limits_client.py
+++ b/tempest/services/database/json/limits_client.py
@@ -15,11 +15,8 @@
import urllib
-from tempest import config
from tempest_lib.common import rest_client
-CONF = config.CONF
-
class DatabaseLimitsClientJSON(rest_client.RestClient):
diff --git a/tempest/services/identity/v3/json/identity_client.py b/tempest/services/identity/v3/json/identity_client.py
index f3d9d2d..95c52bf 100644
--- a/tempest/services/identity/v3/json/identity_client.py
+++ b/tempest/services/identity/v3/json/identity_client.py
@@ -17,11 +17,8 @@
import urllib
from tempest.common import service_client
-from tempest import config
from tempest.services.identity.v3.json import base
-CONF = config.CONF
-
class IdentityV3ClientJSON(base.IdentityV3Client):
diff --git a/tempest/services/volume/json/volumes_client.py b/tempest/services/volume/json/volumes_client.py
index b906cec..9ef1686 100644
--- a/tempest/services/volume/json/volumes_client.py
+++ b/tempest/services/volume/json/volumes_client.py
@@ -20,11 +20,8 @@
from tempest_lib import exceptions as lib_exc
from tempest.common import service_client
-from tempest import config
from tempest import exceptions
-CONF = config.CONF
-
class BaseVolumesClientJSON(service_client.ServiceClient):
"""
@@ -33,6 +30,12 @@
create_resp = 200
+ def __init__(self, auth_provider, service, region,
+ default_volume_size=1, **kwargs):
+ super(BaseVolumesClientJSON, self).__init__(
+ auth_provider, service, region, **kwargs)
+ self.default_volume_size = default_volume_size
+
def get_attachment_from_volume(self, volume):
"""Return the element 'attachment' from input volumes."""
return volume['attachments'][0]
@@ -79,10 +82,8 @@
snapshot_id: When specified the volume is created from this snapshot
imageRef: When specified the volume is created from this image
"""
- # for bug #1293885:
- # If no size specified, read volume size from CONF
if size is None:
- size = CONF.volume.volume_size
+ size = self.default_volume_size
post_body = {'size': size}
post_body.update(kwargs)
post_body = json.dumps({'volume': post_body})
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index 49fac3d..1c27815 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -19,8 +19,8 @@
from six import moves
-from tempest import auth
from tempest import clients
+from tempest.common import cred_provider
from tempest.common import ssh
from tempest.common.utils import data_utils
from tempest import config
@@ -148,9 +148,9 @@
password,
tenant['id'],
"email")
- creds = auth.get_credentials(username=username,
- password=password,
- tenant_name=tenant_name)
+ creds = cred_provider.get_credentials(username=username,
+ password=password,
+ tenant_name=tenant_name)
manager = clients.Manager(credentials=creds)
test_obj = importutils.import_class(test['action'])
diff --git a/tempest/test.py b/tempest/test.py
index 28e1e2c..0c9cbfd 100644
--- a/tempest/test.py
+++ b/tempest/test.py
@@ -359,7 +359,7 @@
level=None))
@classmethod
- def get_client_manager(cls, interface=None):
+ def get_client_manager(cls):
"""
Returns an OpenStack client manager
"""
@@ -373,12 +373,7 @@
)
creds = cls.isolated_creds.get_primary_creds()
- params = dict(credentials=creds, service=cls._service)
- if getattr(cls, '_interface', None):
- interface = cls._interface
- if interface:
- params['interface'] = interface
- os = clients.Manager(**params)
+ os = clients.Manager(credentials=creds, service=cls._service)
return os
@classmethod
@@ -394,8 +389,7 @@
"""
Returns an instance of the Identity Admin API client
"""
- os = clients.AdminManager(interface=cls._interface,
- service=cls._service)
+ os = clients.AdminManager(service=cls._service)
admin_client = os.identity_client
return admin_client
@@ -436,8 +430,7 @@
super(NegativeAutoTest, cls).setUpClass()
os = cls.get_client_manager()
cls.client = os.negative_client
- os_admin = clients.AdminManager(interface=cls._interface,
- service=cls._service)
+ os_admin = clients.AdminManager(service=cls._service)
cls.admin_client = os_admin.negative_client
@staticmethod
diff --git a/tempest/tests/common/test_service_clients.py b/tempest/tests/common/test_service_clients.py
index 2b31d6b..443b67e 100644
--- a/tempest/tests/common/test_service_clients.py
+++ b/tempest/tests/common/test_service_clients.py
@@ -43,6 +43,7 @@
from tempest.services.compute.json import tenant_usages_client
from tempest.services.compute.json import volumes_extensions_client \
as compute_volumes_extensions_client
+from tempest.services.data_processing.v1_1 import data_processing_client
from tempest.services.database.json import flavors_client as db_flavor_client
from tempest.services.database.json import versions_client as db_version_client
from tempest.services.messaging.json import messaging_client
@@ -117,6 +118,7 @@
services_client.ServicesClientJSON,
tenant_usages_client.TenantUsagesClientJSON,
compute_volumes_extensions_client.VolumesExtensionsClientJSON,
+ data_processing_client.DataProcessingClient,
db_flavor_client.DatabaseFlavorsClientJSON,
db_version_client.DatabaseVersionsClientJSON,
messaging_client.MessagingClientJSON,
diff --git a/tempest/tests/negative/test_negative_auto_test.py b/tempest/tests/negative/test_negative_auto_test.py
index fb1da43..7a127cd 100644
--- a/tempest/tests/negative/test_negative_auto_test.py
+++ b/tempest/tests/negative/test_negative_auto_test.py
@@ -21,7 +21,6 @@
class TestNegativeAutoTest(base.TestCase):
# Fake entries
- _interface = 'json'
_service = 'compute'
fake_input_desc = {"name": "list-flavors-with-detail",
diff --git a/tempest/tests/test_auth.py b/tempest/tests/test_auth.py
index 785880d..0317ad6 100644
--- a/tempest/tests/test_auth.py
+++ b/tempest/tests/test_auth.py
@@ -30,7 +30,7 @@
from tempest.tests import fake_identity
-def fake_get_credentials(fill_in=True, **kwargs):
+def fake_get_credentials(fill_in=True, identity_version='v2', **kwargs):
return fake_credentials.FakeCredentials()
@@ -81,11 +81,6 @@
def test_check_credentials_bad_type(self):
self.assertFalse(self.auth_provider.check_credentials([]))
- def test_instantiate_with_dict(self):
- # Dict credentials are only supported for backward compatibility
- auth_provider = self._auth(credentials={})
- self.assertIsInstance(auth_provider.credentials, auth.Credentials)
-
def test_auth_data_property_when_cache_exists(self):
self.auth_provider.cache = 'foo'
self.useFixture(mockpatch.PatchObject(self.auth_provider,
diff --git a/tempest/tests/test_credentials.py b/tempest/tests/test_credentials.py
index 3d0e171..7621f6e 100644
--- a/tempest/tests/test_credentials.py
+++ b/tempest/tests/test_credentials.py
@@ -15,8 +15,6 @@
import copy
-from oslo.config import cfg
-
from tempest import auth
from tempest.common import tempest_fixtures as fixtures
from tempest import config
@@ -78,6 +76,7 @@
identity_response = fake_identity._fake_v2_response
credentials_class = auth.KeystoneV2Credentials
tokenclient_class = v2_client.TokenClientJSON
+ identity_version = 'v2'
def setUp(self):
super(KeystoneV2CredentialsTests, self).setUp()
@@ -85,7 +84,9 @@
self.identity_response)
def _verify_credentials(self, credentials_class, creds_dict, filled=True):
- creds = auth.get_credentials(fill_in=filled, **creds_dict)
+ creds = auth.get_credentials(fill_in=filled,
+ identity_version=self.identity_version,
+ **creds_dict)
self._check(creds, credentials_class, filled)
def test_get_credentials(self):
@@ -156,15 +157,7 @@
credentials_class = auth.KeystoneV3Credentials
identity_response = fake_identity._fake_v3_response
tokenclient_class = v3_client.V3TokenClientJSON
-
- def setUp(self):
- super(KeystoneV3CredentialsTests, self).setUp()
- # Additional config items reset by cfg fixture after each test
- cfg.CONF.set_default('auth_version', 'v3', group='identity')
- # Identity group items
- for prefix in ['', 'alt_', 'admin_']:
- cfg.CONF.set_default(prefix + 'domain_name', 'fake_domain_name',
- group='identity')
+ identity_version = 'v3'
def test_is_not_valid(self):
# NOTE(mtreinish) For a Keystone V3 credential object a project name