diff options
-rw-r--r-- | snaps/openstack/tests/create_project_tests.py | 14 | ||||
-rw-r--r-- | snaps/openstack/utils/tests/glance_utils_tests.py | 9 |
2 files changed, 15 insertions, 8 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') diff --git a/snaps/openstack/utils/tests/glance_utils_tests.py b/snaps/openstack/utils/tests/glance_utils_tests.py index ba7f6cf..23c741a 100644 --- a/snaps/openstack/utils/tests/glance_utils_tests.py +++ b/snaps/openstack/utils/tests/glance_utils_tests.py @@ -36,9 +36,8 @@ class GlanceSmokeTests(OSComponentTestCase): Tests to ensure that the proper credentials can connect. """ glance = glance_utils.glance_client(self.os_creds) - - users = glance.images.list() - self.assertIsNotNone(users) + image = glance_utils.get_image(glance, 'foo') + self.assertIsNone(image) def test_glance_connect_fail(self): """ @@ -47,8 +46,8 @@ class GlanceSmokeTests(OSComponentTestCase): from snaps.openstack.os_credentials import OSCreds with self.assertRaises(Exception): - neutron = glance_utils.glance_client(OSCreds('user', 'pass', 'url', 'project')) - neutron.list_networks() + glance = glance_utils.glance_client(OSCreds('user', 'pass', 'url', 'project')) + glance_utils.get_image(glance, 'foo') class GlanceUtilsTests(OSComponentTestCase): |