From 5cfd8ce686f8b539d01a3e7e009e7d5a18b8228f Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Fri, 23 Jun 2017 05:11:31 +0000 Subject: Use glance to list images 1. Images list is not supported by novaclient 8.0.0 2. It moves images list out of nova and into glance Change-Id: I2a2d40a2ca3a0cf1ebfb55697b3c58af8748a805 Signed-off-by: Linda Wang --- functest/tests/unit/utils/test_openstack_clean.py | 3 ++- functest/tests/unit/utils/test_openstack_snapshot.py | 3 ++- functest/tests/unit/utils/test_openstack_utils.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'functest/tests') diff --git a/functest/tests/unit/utils/test_openstack_clean.py b/functest/tests/unit/utils/test_openstack_clean.py index fe7b50d4..5feed167 100644 --- a/functest/tests/unit/utils/test_openstack_clean.py +++ b/functest/tests/unit/utils/test_openstack_clean.py @@ -672,6 +672,7 @@ class OSCleanTesting(unittest.TestCase): RegexMatch(" Removing " "\s*\S+...")) + @mock.patch('functest.utils.openstack_clean.os_utils.get_glance_client') @mock.patch('functest.utils.openstack_clean.os_utils.get_cinder_client') @mock.patch('functest.utils.openstack_clean.os_utils' '.get_keystone_client') @@ -684,7 +685,7 @@ class OSCleanTesting(unittest.TestCase): @mock.patch('functest.utils.openstack_clean.logger.debug') def test_main_default(self, mock_logger_debug, mock_logger_info, mock_creds, mock_nova, mock_neutron, - mock_keystone, mock_cinder): + mock_keystone, mock_cinder, mock_glance): with mock.patch('functest.utils.openstack_clean.remove_instances') \ as mock_remove_instances, \ diff --git a/functest/tests/unit/utils/test_openstack_snapshot.py b/functest/tests/unit/utils/test_openstack_snapshot.py index d3f93994..8b3635ea 100644 --- a/functest/tests/unit/utils/test_openstack_snapshot.py +++ b/functest/tests/unit/utils/test_openstack_snapshot.py @@ -186,6 +186,7 @@ class OSTackerTesting(unittest.TestCase): mock_logger_debug.assert_called_once_with("Getting tenants...") self.assertDictEqual(resp, {'tenants': {}}) + @mock.patch('functest.utils.openstack_clean.os_utils.get_glance_client') @mock.patch('functest.utils.openstack_snapshot.os_utils.get_cinder_client') @mock.patch('functest.utils.openstack_snapshot.os_utils' '.get_keystone_client') @@ -197,7 +198,7 @@ class OSTackerTesting(unittest.TestCase): @mock.patch('functest.utils.openstack_snapshot.logger.debug') def test_main_default(self, mock_logger_debug, mock_logger_info, mock_creds, mock_nova, mock_neutron, - mock_keystone, mock_cinder): + mock_keystone, mock_cinder, mock_glance): with mock.patch('functest.utils.openstack_snapshot.get_instances', return_value=self.update_list), \ mock.patch('functest.utils.openstack_snapshot.get_images', diff --git a/functest/tests/unit/utils/test_openstack_utils.py b/functest/tests/unit/utils/test_openstack_utils.py index 0f06b1e1..8dab87bb 100644 --- a/functest/tests/unit/utils/test_openstack_utils.py +++ b/functest/tests/unit/utils/test_openstack_utils.py @@ -1472,7 +1472,7 @@ class OSUtilsTesting(unittest.TestCase): def test_get_images_default(self): self.assertEqual(openstack_utils. - get_images(self.nova_client), + get_images(self.glance_client), [self.image]) @mock.patch('functest.utils.openstack_utils.logger.error') -- cgit 1.2.3-korg