Skip to content

Commit 13e27c3

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "use env vars to specify OS_IDENTITY_API_VERSION"
2 parents 28f261e + cb28fb5 commit 13e27c3

22 files changed

Lines changed: 62 additions & 61 deletions

functional/tests/identity/v2/test_identity.py renamed to functional/tests/identity/v2/common.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13+
import os
14+
1315
from tempest.lib.common.utils import data_utils
1416

1517
from functional.common import test
@@ -39,8 +41,11 @@ class IdentityTests(test.TestCase):
3941

4042
@classmethod
4143
def setUpClass(cls):
42-
if hasattr(super(IdentityTests, cls), 'setUpClass'):
43-
super(IdentityTests, cls).setUpClass()
44+
# prepare v2 env
45+
os.environ['OS_IDENTITY_API_VERSION'] = '2.0'
46+
auth_url = os.environ.get('OS_AUTH_URL')
47+
auth_url = auth_url.replace('v3', 'v2.0')
48+
os.environ['OS_AUTH_URL'] = auth_url
4449

4550
# create dummy project
4651
cls.project_name = data_utils.rand_name('TestProject')

functional/tests/identity/v2/test_catalog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13-
from functional.tests.identity.v2 import test_identity
13+
from functional.tests.identity.v2 import common
1414

1515

16-
class CatalogTests(test_identity.IdentityTests):
16+
class CatalogTests(common.IdentityTests):
1717

1818
def test_catalog_list(self):
1919
raw_output = self.openstack('catalog list')

functional/tests/identity/v2/test_ec2_credentials.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13-
from functional.tests.identity.v2 import test_identity
13+
from functional.tests.identity.v2 import common
1414

1515

16-
class EC2CredentialsTests(test_identity.IdentityTests):
16+
class EC2CredentialsTests(common.IdentityTests):
1717

1818
def test_ec2_credentials_create(self):
1919
self._create_dummy_ec2_credentials()

functional/tests/identity/v2/test_endpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13-
from functional.tests.identity.v2 import test_identity
13+
from functional.tests.identity.v2 import common
1414

1515

16-
class EndpointTests(test_identity.IdentityTests):
16+
class EndpointTests(common.IdentityTests):
1717

1818
def test_endpoint_create(self):
1919
self._create_dummy_endpoint()

functional/tests/identity/v2/test_project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
from tempest.lib.common.utils import data_utils
1414

15-
from functional.tests.identity.v2 import test_identity
15+
from functional.tests.identity.v2 import common
1616

1717

18-
class ProjectTests(test_identity.IdentityTests):
18+
class ProjectTests(common.IdentityTests):
1919

2020
def test_project_create(self):
2121
project_name = data_utils.rand_name('TestProject')
@@ -49,7 +49,7 @@ def test_project_delete(self):
4949
def test_project_list(self):
5050
raw_output = self.openstack('project list')
5151
items = self.parse_listing(raw_output)
52-
self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
52+
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
5353

5454
def test_project_set(self):
5555
project_name = self._create_dummy_project()

functional/tests/identity/v2/test_role.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13-
from functional.tests.identity.v2 import test_identity
13+
from functional.tests.identity.v2 import common
1414

1515

16-
class RoleTests(test_identity.IdentityTests):
16+
class RoleTests(common.IdentityTests):
1717

1818
def test_role_create(self):
1919
self._create_dummy_role()
@@ -27,7 +27,7 @@ def test_role_list(self):
2727
self._create_dummy_role()
2828
raw_output = self.openstack('role list')
2929
items = self.parse_listing(raw_output)
30-
self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
30+
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
3131

3232
def test_role_list_with_user_project(self):
3333
project_name = self._create_dummy_project()
@@ -58,7 +58,7 @@ def test_role_list_with_user_project(self):
5858
'' % {'project': project_name,
5959
'user': username})
6060
items = self.parse_listing(raw_output)
61-
self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
61+
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
6262
self.assertEqual(1, len(items))
6363

6464
def test_role_show(self):

functional/tests/identity/v2/test_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13-
from functional.tests.identity.v2 import test_identity
13+
from functional.tests.identity.v2 import common
1414

1515

16-
class ServiceTests(test_identity.IdentityTests):
16+
class ServiceTests(common.IdentityTests):
1717

1818
def test_service_create(self):
1919
self._create_dummy_service()
@@ -27,7 +27,7 @@ def test_service_list(self):
2727
self._create_dummy_service()
2828
raw_output = self.openstack('service list')
2929
items = self.parse_listing(raw_output)
30-
self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
30+
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
3131

3232
def test_service_show(self):
3333
service_name = self._create_dummy_service()

functional/tests/identity/v2/test_token.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
# License for the specific language governing permissions and limitations
1111
# under the License.
1212

13-
from functional.tests.identity.v2 import test_identity
13+
from functional.tests.identity.v2 import common
1414

1515

16-
class TokenTests(test_identity.IdentityTests):
16+
class TokenTests(common.IdentityTests):
1717

1818
def test_token_issue(self):
1919
self._create_dummy_token()

functional/tests/identity/v2/test_user.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
from tempest.lib.common.utils import data_utils
1414
from tempest.lib import exceptions
1515

16-
from functional.tests.identity.v2 import test_identity
16+
from functional.tests.identity.v2 import common
1717

1818

19-
class UserTests(test_identity.IdentityTests):
19+
class UserTests(common.IdentityTests):
2020

2121
def test_user_create(self):
2222
self._create_dummy_user()
@@ -29,7 +29,7 @@ def test_user_delete(self):
2929
def test_user_list(self):
3030
raw_output = self.openstack('user list')
3131
items = self.parse_listing(raw_output)
32-
self.assert_table_structure(items, test_identity.BASIC_LIST_HEADERS)
32+
self.assert_table_structure(items, common.BASIC_LIST_HEADERS)
3333

3434
def test_user_set(self):
3535
username = self._create_dummy_user()

functional/tests/identity/v3/test_identity.py renamed to functional/tests/identity/v3/common.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,11 @@ class IdentityTests(test.TestCase):
5151

5252
@classmethod
5353
def setUpClass(cls):
54-
if hasattr(super(IdentityTests, cls), 'setUpClass'):
55-
super(IdentityTests, cls).setUpClass()
56-
5754
# prepare v3 env
55+
os.environ['OS_IDENTITY_API_VERSION'] = '3'
5856
auth_url = os.environ.get('OS_AUTH_URL')
5957
auth_url = auth_url.replace('v2.0', 'v3')
6058
os.environ['OS_AUTH_URL'] = auth_url
61-
os.environ['OS_IDENTITY_API_VERSION'] = '3'
62-
os.environ['OS_AUTH_TYPE'] = 'v3password'
6359

6460
# create dummy domain
6561
cls.domain_name = data_utils.rand_name('TestDomain')

0 commit comments

Comments
 (0)