summaryrefslogtreecommitdiff
path: root/functional/tests/identity/v2
diff options
context:
space:
mode:
authorSteve Martinelli <s.martinelli@gmail.com>2016-06-20 17:12:44 -0400
committerSteve Martinelli <s.martinelli@gmail.com>2016-06-20 17:16:20 -0400
commitcb28fb55884a9be7cd70c37343181116cf000a42 (patch)
treea40977c0410d1414a9586e0d7144a79df3d35a07 /functional/tests/identity/v2
parentf5ae23ab86c662e2f75952e6aa62c02ab3855b9b (diff)
downloadpython-openstackclient-cb28fb55884a9be7cd70c37343181116cf000a42.tar.gz
use env vars to specify OS_IDENTITY_API_VERSION
If the default identity API version were to change in devstack, the v2.0 tests would fail today, resulting in a broken OSC gate. Change-Id: Id634ea7e0fab9f3772383b5512ccac19f5119ac0
Diffstat (limited to 'functional/tests/identity/v2')
-rw-r--r--functional/tests/identity/v2/common.py (renamed from functional/tests/identity/v2/test_identity.py)9
-rw-r--r--functional/tests/identity/v2/test_catalog.py4
-rw-r--r--functional/tests/identity/v2/test_ec2_credentials.py4
-rw-r--r--functional/tests/identity/v2/test_endpoint.py4
-rw-r--r--functional/tests/identity/v2/test_project.py6
-rw-r--r--functional/tests/identity/v2/test_role.py8
-rw-r--r--functional/tests/identity/v2/test_service.py6
-rw-r--r--functional/tests/identity/v2/test_token.py4
-rw-r--r--functional/tests/identity/v2/test_user.py6
9 files changed, 28 insertions, 23 deletions
diff --git a/functional/tests/identity/v2/test_identity.py b/functional/tests/identity/v2/common.py
index 9adbe49f..9d6a7bb5 100644
--- a/functional/tests/identity/v2/test_identity.py
+++ b/functional/tests/identity/v2/common.py
@@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+import os
+
from tempest.lib.common.utils import data_utils
from functional.common import test
@@ -39,8 +41,11 @@ class IdentityTests(test.TestCase):
@classmethod
def setUpClass(cls):
- if hasattr(super(IdentityTests, cls), 'setUpClass'):
- super(IdentityTests, cls).setUpClass()
+ # prepare v2 env
+ os.environ['OS_IDENTITY_API_VERSION'] = '2.0'
+ auth_url = os.environ.get('OS_AUTH_URL')
+ auth_url = auth_url.replace('v3', 'v2.0')
+ os.environ['OS_AUTH_URL'] = auth_url
# create dummy project
cls.project_name = data_utils.rand_name('TestProject')
diff --git a/functional/tests/identity/v2/test_catalog.py b/functional/tests/identity/v2/test_catalog.py
index 3a1f7e11..b6291e05 100644
--- a/functional/tests/identity/v2/test_catalog.py
+++ b/functional/tests/identity/v2/test_catalog.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class CatalogTests(test_identity.IdentityTests):
+class CatalogTests(common.IdentityTests):
def test_catalog_list(self):
raw_output = self.openstack('catalog list')
diff --git a/functional/tests/identity/v2/test_ec2_credentials.py b/functional/tests/identity/v2/test_ec2_credentials.py
index 86702c0c..319bd11a 100644
--- a/functional/tests/identity/v2/test_ec2_credentials.py
+++ b/functional/tests/identity/v2/test_ec2_credentials.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class EC2CredentialsTests(test_identity.IdentityTests):
+class EC2CredentialsTests(common.IdentityTests):
def test_ec2_credentials_create(self):
self._create_dummy_ec2_credentials()
diff --git a/functional/tests/identity/v2/test_endpoint.py b/functional/tests/identity/v2/test_endpoint.py
index 8064365e..0682e6b4 100644
--- a/functional/tests/identity/v2/test_endpoint.py
+++ b/functional/tests/identity/v2/test_endpoint.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class EndpointTests(test_identity.IdentityTests):
+class EndpointTests(common.IdentityTests):
def test_endpoint_create(self):
self._create_dummy_endpoint()
diff --git a/functional/tests/identity/v2/test_project.py b/functional/tests/identity/v2/test_project.py
index e9580ecf..7fb1a98d 100644
--- a/functional/tests/identity/v2/test_project.py
+++ b/functional/tests/identity/v2/test_project.py
@@ -12,10 +12,10 @@
from tempest.lib.common.utils import data_utils
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class ProjectTests(test_identity.IdentityTests):
+class ProjectTests(common.IdentityTests):
def test_project_create(self):
project_name = data_utils.rand_name('TestProject')
@@ -49,7 +49,7 @@ class ProjectTests(test_identity.IdentityTests):
def test_project_list(self):
raw_output = self.openstack('project list')
items = self.parse_listing(raw_output)
- self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
+ self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
def test_project_set(self):
project_name = self._create_dummy_project()
diff --git a/functional/tests/identity/v2/test_role.py b/functional/tests/identity/v2/test_role.py
index 9ee60069..0f8d5ed4 100644
--- a/functional/tests/identity/v2/test_role.py
+++ b/functional/tests/identity/v2/test_role.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class RoleTests(test_identity.IdentityTests):
+class RoleTests(common.IdentityTests):
def test_role_create(self):
self._create_dummy_role()
@@ -27,7 +27,7 @@ class RoleTests(test_identity.IdentityTests):
self._create_dummy_role()
raw_output = self.openstack('role list')
items = self.parse_listing(raw_output)
- self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
+ self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
def test_role_list_with_user_project(self):
project_name = self._create_dummy_project()
@@ -58,7 +58,7 @@ class RoleTests(test_identity.IdentityTests):
'' % {'project': project_name,
'user': username})
items = self.parse_listing(raw_output)
- self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
+ self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
self.assertEqual(1, len(items))
def test_role_show(self):
diff --git a/functional/tests/identity/v2/test_service.py b/functional/tests/identity/v2/test_service.py
index bd982be1..219ed33f 100644
--- a/functional/tests/identity/v2/test_service.py
+++ b/functional/tests/identity/v2/test_service.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class ServiceTests(test_identity.IdentityTests):
+class ServiceTests(common.IdentityTests):
def test_service_create(self):
self._create_dummy_service()
@@ -27,7 +27,7 @@ class ServiceTests(test_identity.IdentityTests):
self._create_dummy_service()
raw_output = self.openstack('service list')
items = self.parse_listing(raw_output)
- self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
+ self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
def test_service_show(self):
service_name = self._create_dummy_service()
diff --git a/functional/tests/identity/v2/test_token.py b/functional/tests/identity/v2/test_token.py
index bac2b0ac..ca9b7d68 100644
--- a/functional/tests/identity/v2/test_token.py
+++ b/functional/tests/identity/v2/test_token.py
@@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class TokenTests(test_identity.IdentityTests):
+class TokenTests(common.IdentityTests):
def test_token_issue(self):
self._create_dummy_token()
diff --git a/functional/tests/identity/v2/test_user.py b/functional/tests/identity/v2/test_user.py
index 34cabf7b..ef4defac 100644
--- a/functional/tests/identity/v2/test_user.py
+++ b/functional/tests/identity/v2/test_user.py
@@ -13,10 +13,10 @@
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions
-from functional.tests.identity.v2 import test_identity
+from functional.tests.identity.v2 import common
-class UserTests(test_identity.IdentityTests):
+class UserTests(common.IdentityTests):
def test_user_create(self):
self._create_dummy_user()
@@ -29,7 +29,7 @@ class UserTests(test_identity.IdentityTests):
def test_user_list(self):
raw_output = self.openstack('user list')
items = self.parse_listing(raw_output)
- self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
+ self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
def test_user_set(self):
username = self._create_dummy_user()