Merge "Introduce functional test for Identity Provider"

This commit is contained in:
Jenkins 2015-08-03 20:39:15 +00:00 committed by Gerrit Code Review
commit 2039011097
2 changed files with 39 additions and 0 deletions
functional/tests/identity/v3

@ -42,6 +42,8 @@ class IdentityTests(test.TestCase):
ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type',
'Enabled', 'Interface', 'URL']
IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids']
@classmethod
def setUpClass(cls):
if hasattr(super(IdentityTests, cls), 'setUpClass'):
@ -253,3 +255,20 @@ class IdentityTests(test.TestCase):
self.openstack,
'endpoint delete %s' % endpoint['id'])
return endpoint['id']
def _create_dummy_idp(self, add_clean_up=True):
identity_provider = data_utils.rand_name('IdentityProvider')
description = data_utils.rand_name('description')
raw_output = self.openstack(
'identity provider create '
' %(name)s '
'--description %(description)s '
'--enable ' % {'name': identity_provider,
'description': description})
items = self.parse_show(raw_output)
self.assert_show_fields(items, self.IDENTITY_PROVIDER_FIELDS)
if add_clean_up:
self.addCleanup(
self.openstack,
'identity provider delete %s' % identity_provider)
return identity_provider

@ -0,0 +1,20 @@
# 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 functional.tests.identity.v3 import test_identity
class IdentityProviderTests(test_identity.IdentityTests):
# Introduce functional test case for command 'Identity Provider'
def test_idp_create(self):
self._create_dummy_idp()