From 0182868be5a3d07755a5039d77ff53ff3d770147 Mon Sep 17 00:00:00 2001 From: Abhishek Kekane Date: Fri, 7 Jun 2019 06:24:36 +0000 Subject: [PATCH] Unit tests fails with new glance_store version 0.29.0 Around 11 unit tests are failing [1] with a recent patch [2] merged in glance_store. The reason behind the failure is glance unit tests are loading rbd store which is not supported in gate. Earlier these tests were passing because they were not trying to connect to rados while loading the store, but after merging of recent patch [1] it tries to connect to rados via configure_add method of rbd driver. To avoid these kind of failures in near future we should drop using rbd store in tests as we know it is not supported in gate. NOTE: Also corrected the naming conventions of store identifiers, instead of using file1 etc., used appropriate names. [1] http://logs.openstack.org/40/663740/1/check/cross-glance-py27/50a9a9c/ [2] https://review.opendev.org/660340 Change-Id: I18add352238e93c5d4ade8b3e8d967b2f639cdad Closes-Bug: #1831963 --- glance/tests/unit/base.py | 6 +++--- glance/tests/unit/v2/test_discovery_stores.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/glance/tests/unit/base.py b/glance/tests/unit/base.py index f865cf75df..0f34e7a38b 100644 --- a/glance/tests/unit/base.py +++ b/glance/tests/unit/base.py @@ -72,15 +72,15 @@ class MultiStoreClearingUnitTest(test_utils.BaseTestCase): :param passing_config: making store driver passes basic configurations. :returns: the number of how many store drivers been loaded. """ - self.config(enabled_backends={'file1': 'file', 'ceph1': 'rbd', + self.config(enabled_backends={'fast': 'file', 'cheap': 'file', 'readonly_store': 'http'}) store.register_store_opts(CONF) - self.config(default_backend='file1', + self.config(default_backend='fast', group='glance_store') self.config(filesystem_store_datadir=self.test_dir, - group='file1') + group='fast') store.create_multi_stores(CONF) diff --git a/glance/tests/unit/v2/test_discovery_stores.py b/glance/tests/unit/v2/test_discovery_stores.py index 6afbf748a1..4de7976051 100644 --- a/glance/tests/unit/v2/test_discovery_stores.py +++ b/glance/tests/unit/v2/test_discovery_stores.py @@ -39,7 +39,7 @@ class TestInfoControllers(base.MultiStoreClearingUnitTest): req) def test_get_stores(self): - available_stores = ['ceph1', 'file1', 'readonly_store'] + available_stores = ['cheap', 'fast', 'readonly_store'] req = unit_test_utils.get_fake_request() output = self.controller.get_stores(req) self.assertIn('stores', output) @@ -48,7 +48,7 @@ class TestInfoControllers(base.MultiStoreClearingUnitTest): self.assertIn(stores['id'], available_stores) def test_get_stores_read_only_store(self): - available_stores = ['ceph1', 'file1', 'readonly_store'] + available_stores = ['cheap', 'fast', 'readonly_store'] req = unit_test_utils.get_fake_request() output = self.controller.get_stores(req) self.assertIn('stores', output)