Merge "Introduce functional test for Identity Provider"
This commit is contained in:
commit
2039011097
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
|
||||
|
20
functional/tests/identity/v3/test_idp.py
Normal file
20
functional/tests/identity/v3/test_idp.py
Normal file
@ -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()
|
Loading…
x
Reference in New Issue
Block a user