Skip to content

Commit cd98e06

Browse files
committed
Introduce functional test for Identity Provider
Identity Provider currently doesn't have test coverage. Change-Id: Iea2e705f9d2303f58516f08a7526135988032025
1 parent 149ce52 commit cd98e06

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

functional/tests/identity/v3/test_identity.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class IdentityTests(test.TestCase):
4242
ENDPOINT_LIST_HEADERS = ['ID', 'Region', 'Service Name', 'Service Type',
4343
'Enabled', 'Interface', 'URL']
4444

45+
IDENTITY_PROVIDER_FIELDS = ['description', 'enabled', 'id', 'remote_ids']
46+
4547
@classmethod
4648
def setUpClass(cls):
4749
if hasattr(super(IdentityTests, cls), 'setUpClass'):
@@ -253,3 +255,20 @@ def _create_dummy_endpoint(self, interface='public', add_clean_up=True):
253255
self.openstack,
254256
'endpoint delete %s' % endpoint['id'])
255257
return endpoint['id']
258+
259+
def _create_dummy_idp(self, add_clean_up=True):
260+
identity_provider = data_utils.rand_name('IdentityProvider')
261+
description = data_utils.rand_name('description')
262+
raw_output = self.openstack(
263+
'identity provider create '
264+
' %(name)s '
265+
'--description %(description)s '
266+
'--enable ' % {'name': identity_provider,
267+
'description': description})
268+
items = self.parse_show(raw_output)
269+
self.assert_show_fields(items, self.IDENTITY_PROVIDER_FIELDS)
270+
if add_clean_up:
271+
self.addCleanup(
272+
self.openstack,
273+
'identity provider delete %s' % identity_provider)
274+
return identity_provider
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
2+
# not use this file except in compliance with the License. You may obtain
3+
# a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10+
# License for the specific language governing permissions and limitations
11+
# under the License.
12+
13+
from functional.tests.identity.v3 import test_identity
14+
15+
16+
class IdentityProviderTests(test_identity.IdentityTests):
17+
# Introduce functional test case for command 'Identity Provider'
18+
19+
def test_idp_create(self):
20+
self._create_dummy_idp()

0 commit comments

Comments
 (0)