diff options
author | Steven Pisarski <s.pisarski@cablelabs.com> | 2017-04-27 14:33:09 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-04-27 14:33:09 +0000 |
commit | 56817298a585791f9c49a162434831062142d41d (patch) | |
tree | 8f3aaa9653c7b43ac9c74cda605cf31a824fa675 | |
parent | bf245990d5b2d5d1e9593957b28457401934f54f (diff) | |
parent | 92600cb6f60283b63c4ce5e3e676c99d566abc6b (diff) |
Merge "Fixed test for security groups when checking for project/tenant ID"
-rw-r--r-- | snaps/openstack/tests/create_project_tests.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/snaps/openstack/tests/create_project_tests.py b/snaps/openstack/tests/create_project_tests.py index 9d53467..4e1d254 100644 --- a/snaps/openstack/tests/create_project_tests.py +++ b/snaps/openstack/tests/create_project_tests.py @@ -193,10 +193,12 @@ class CreateProjectUserTests(OSComponentTestCase): self.assertIsNotNone(sec_grp) self.sec_grp_creators.append(sec_grp_creator) - if self.keystone.version == keystone_utils.V2_VERSION: + if 'tenant_id' in sec_grp['security_group']: self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['tenant_id']) - else: + elif 'project_id' in sec_grp['security_group']: self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['project_id']) + else: + self.fail('Cannot locate the project or tenant ID') def test_create_project_sec_grp_two_users(self): """ @@ -225,4 +227,10 @@ class CreateProjectUserTests(OSComponentTestCase): sec_grp = sec_grp_creator.create() self.assertIsNotNone(sec_grp) self.sec_grp_creators.append(sec_grp_creator) - self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['tenant_id']) + + if 'tenant_id' in sec_grp['security_group']: + self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['tenant_id']) + elif 'project_id' in sec_grp['security_group']: + self.assertEquals(self.project_creator.get_project().id, sec_grp['security_group']['project_id']) + else: + self.fail('Cannot locate the project or tenant ID') |