summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelvin Lui <kelvinlittle@yahoo.com>2015-07-30 14:04:31 -0400
committerKelvin Lui <kelvinlittle@yahoo.com>2015-08-01 01:38:20 -0400
commitcd98e063eb3bbf5e2e574f61f1062f611707321d (patch)
treed76aa0eee2561b8983315c21b5b40ad73221e876
parent149ce526143265d1d265761a9fb57bb66ee7a75a (diff)
downloadpython-openstackclient-cd98e063eb3bbf5e2e574f61f1062f611707321d.tar.gz
Introduce functional test for Identity Provider
Identity Provider currently doesn't have test coverage. Change-Id: Iea2e705f9d2303f58516f08a7526135988032025
-rw-r--r--functional/tests/identity/v3/test_identity.py19
-rw-r--r--functional/tests/identity/v3/test_idp.py20
2 files changed, 39 insertions, 0 deletions
diff --git a/functional/tests/identity/v3/test_identity.py b/functional/tests/identity/v3/test_identity.py
index cd11e200..bf3da167 100644
--- a/functional/tests/identity/v3/test_identity.py
+++ b/functional/tests/identity/v3/test_identity.py
@@ -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
diff --git a/functional/tests/identity/v3/test_idp.py b/functional/tests/identity/v3/test_idp.py
new file mode 100644
index 00000000..6a07f158
--- /dev/null
+++ b/functional/tests/identity/v3/test_idp.py
@@ -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()