From f8136a6c1579c5ef27b9fa4af10cc2716796dcec Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Thu, 25 Apr 2024 11:30:08 -0300 Subject: [PATCH] Use a different waiting strategy for ceph-fs tests --- zaza/openstack/charm_tests/ceph/tests.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 1bca97355..638a31fe8 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -1770,7 +1770,7 @@ def _get_all_keys(self, unit, entity_filter): ret.add((data[ix - 1], data[ix + 1])) return ret - def _check_key_rotation(self, entity, unit, states=None): + def _check_key_rotation(self, entity, unit, wait_for_unit=None): def entity_filter(name): return name.startswith(entity) @@ -1781,7 +1781,11 @@ def entity_filter(name): action_params={'entity': entity} ) zaza_utils.assertActionRanOK(action_obj) - zaza_model.wait_for_application_states(states=states) + if wait_for_unit is None: + # Wait for all applications + zaza_model.wait_for_application_states() + else: + zaza_model.wait_for_unit_idle(wait_for_unit) new_keys = self._get_all_keys(unit, entity_filter) self.assertNotEqual(old_keys, new_keys) diff = new_keys - old_keys @@ -1817,14 +1821,11 @@ def test_key_rotate(self): zaza_model.get_application('ceph-fs') fs_svc = self._get_all_keys(unit, lambda x: x.startswith('mds.')) if fs_svc is not None: - ubuntu_states = { - 'ubuntu': { - 'workload-status': 'active', - 'workload-status-message': '' - } - } + # Only wait for ceph-fs, as this model includes 'ubuntu' + # units, and those don't play nice with zaza (they don't + # set the workload-status-message correctly). self._check_key_rotation(next(iter(fs_svc))[0], unit, - ubuntu_states) + 'ceph-fs/0') else: logging.info('ceph-fs units present, but no MDS service') except KeyError: