Skip to content

Commit

Permalink
Merge "additional functional tests for identity providers"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Aug 22, 2015
2 parents 59d12a6 + 8fb19bc commit 3751dbf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions functional/tests/identity/v3/test_identity.py
Expand Up @@ -43,6 +43,7 @@ class IdentityTests(test.TestCase):
'Enabled', 'Interface', 'URL']

IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids']
IDENTITY_PROVIDER_LIST_HEADERS = ['ID', 'Enabled', 'Description']

@classmethod
def setUpClass(cls):
Expand Down
34 changes: 34 additions & 0 deletions functional/tests/identity/v3/test_idp.py
Expand Up @@ -11,10 +11,44 @@
# under the License.

from functional.tests.identity.v3 import test_identity
from tempest_lib.common.utils import data_utils


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

def test_idp_create(self):
self._create_dummy_idp()

def test_idp_delete(self):
identity_provider = self._create_dummy_idp(add_clean_up=False)
raw_output = self.openstack('identity provider delete %s'
% identity_provider)
self.assertEqual(0, len(raw_output))

def test_idp_show(self):
identity_provider = self._create_dummy_idp(add_clean_up=True)
raw_output = self.openstack('identity provider show %s'
% identity_provider)
items = self.parse_show(raw_output)
self.assert_show_fields(items, self.IDENTITY_PROVIDER_FIELDS)

def test_idp_list(self):
self._create_dummy_idp(add_clean_up=True)
raw_output = self.openstack('identity provider list')
items = self.parse_listing(raw_output)
self.assert_table_structure(items, self.IDENTITY_PROVIDER_LIST_HEADERS)

def test_idp_set(self):
identity_provider = self._create_dummy_idp(add_clean_up=True)
new_remoteid = data_utils.rand_name('newRemoteId')
raw_output = self.openstack('identity provider set '
'%(identity-provider)s '
'--remote-id %(remote-id)s '
% {'identity-provider': identity_provider,
'remote-id': new_remoteid})
self.assertEqual(0, len(raw_output))
raw_output = self.openstack('identity provider show %s'
% identity_provider)
updated_value = self.parse_show_as_object(raw_output)
self.assertIn(new_remoteid, updated_value['remote_ids'])

0 comments on commit 3751dbf

Please sign in to comment.