Skip to content

Commit 3751dbf

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "additional functional tests for identity providers"
2 parents 59d12a6 + 8fb19bc commit 3751dbf

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

functional/tests/identity/v3/test_identity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class IdentityTests(test.TestCase):
4343
'Enabled', 'Interface', 'URL']
4444

4545
IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids']
46+
IDENTITY_PROVIDER_LIST_HEADERS = ['ID', 'Enabled', 'Description']
4647

4748
@classmethod
4849
def setUpClass(cls):

functional/tests/identity/v3/test_idp.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,44 @@
1111
# under the License.
1212

1313
from functional.tests.identity.v3 import test_identity
14+
from tempest_lib.common.utils import data_utils
1415

1516

1617
class IdentityProviderTests(test_identity.IdentityTests):
1718
# Introduce functional test case for command 'Identity Provider'
1819

1920
def test_idp_create(self):
2021
self._create_dummy_idp()
22+
23+
def test_idp_delete(self):
24+
identity_provider = self._create_dummy_idp(add_clean_up=False)
25+
raw_output = self.openstack('identity provider delete %s'
26+
% identity_provider)
27+
self.assertEqual(0, len(raw_output))
28+
29+
def test_idp_show(self):
30+
identity_provider = self._create_dummy_idp(add_clean_up=True)
31+
raw_output = self.openstack('identity provider show %s'
32+
% identity_provider)
33+
items = self.parse_show(raw_output)
34+
self.assert_show_fields(items, self.IDENTITY_PROVIDER_FIELDS)
35+
36+
def test_idp_list(self):
37+
self._create_dummy_idp(add_clean_up=True)
38+
raw_output = self.openstack('identity provider list')
39+
items = self.parse_listing(raw_output)
40+
self.assert_table_structure(items, self.IDENTITY_PROVIDER_LIST_HEADERS)
41+
42+
def test_idp_set(self):
43+
identity_provider = self._create_dummy_idp(add_clean_up=True)
44+
new_remoteid = data_utils.rand_name('newRemoteId')
45+
raw_output = self.openstack('identity provider set '
46+
'%(identity-provider)s '
47+
'--remote-id %(remote-id)s '
48+
% {'identity-provider': identity_provider,
49+
'remote-id': new_remoteid})
50+
self.assertEqual(0, len(raw_output))
51+
raw_output = self.openstack('identity provider show %s'
52+
% identity_provider)
53+
updated_value = self.parse_show_as_object(raw_output)
54+
self.assertIn(new_remoteid, updated_value['remote_ids'])

0 commit comments

Comments
 (0)