summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-04-25 14:37:24 +0200
committerSteven Pisarski <s.pisarski@cablelabs.com>2017-04-26 13:48:49 +0000
commit0b569386b2234d938299c00de8b4d7b25f8ef7e8 (patch)
tree7a367c7e92cf10766eec9ef3a9955b64268956b6
parentbecbbabc63b0eff15ed6979947aeb75ddf6819c9 (diff)
Fixed the Glance connection test routines.
test_glance_connect_success gave a false positive and test_glance_connect_fail gave a false negative. Both were calling incorrect APIs due to copying from the equivalent nova_utils.py test. JIRA: SNAPS-57 Change-Id: I1246d535f8bd376c163315dc889ff5bacebb12ec Signed-off-by: spisarski <s.pisarski@cablelabs.com>
-rw-r--r--snaps/openstack/utils/tests/glance_utils_tests.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/snaps/openstack/utils/tests/glance_utils_tests.py b/snaps/openstack/utils/tests/glance_utils_tests.py
index ba7f6cf..37b14a5 100644
--- a/snaps/openstack/utils/tests/glance_utils_tests.py
+++ b/snaps/openstack/utils/tests/glance_utils_tests.py
@@ -36,9 +36,9 @@ 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)
+ nova = nova_utils.nova_client(self.os_creds)
+ image = glance_utils.get_image(nova, glance, 'foo')
+ self.assertIsNone(image)
def test_glance_connect_fail(self):
"""
@@ -47,8 +47,9 @@ 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'))
+ nova = nova_utils.nova_client(self.os_creds)
+ glance_utils.get_image(nova, glance, 'foo')
class GlanceUtilsTests(OSComponentTestCase):