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
This commit is contained in:
Abhishek Kekane 2019-06-07 06:24:36 +00:00
parent be13eb05a0
commit 0182868be5
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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)