From 7ec9b9198c2d133de57384f85644dd6bcc86f3f3 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Fri, 17 Mar 2023 16:49:13 -0300 Subject: [PATCH] Make CephProxyTest wait on the defined states in tests.yaml --- zaza/openstack/charm_tests/ceph/tests.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index 6842f50..d271841 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -29,6 +29,7 @@ import urllib3 import tenacity +import zaza.charm_lifecycle.utils as lifecycle_utils import zaza.openstack.charm_tests.test_utils as test_utils import zaza.model as zaza_model import zaza.openstack.utilities.ceph as zaza_ceph @@ -1204,10 +1205,14 @@ class CephProxyTest(unittest.TestCase): """Run class setup for running tests.""" super(CephProxyTest, cls).setUpClass() + test_config = lifecycle_utils.get_charm_config(fatal=False) + cls.target_deploy_status = test_config.get('target_deploy_status', {}) + def test_ceph_health(self): """Make sure ceph-proxy can communicate with ceph.""" logging.info('Wait for idle/ready status...') - zaza_model.wait_for_application_states() + zaza_model.wait_for_application_states( + states=self.target_deploy_status) self.assertEqual( zaza_model.run_on_leader("ceph-proxy", "sudo ceph health")["Code"], @@ -1217,7 +1222,8 @@ class CephProxyTest(unittest.TestCase): def test_cinder_ceph_restrict_pool_setup(self): """Make sure cinder-ceph restrict pool was created successfully.""" logging.info('Wait for idle/ready status...') - zaza_model.wait_for_application_states() + zaza_model.wait_for_application_states( + states=self.target_deploy_status) pools = zaza_ceph.get_ceph_pools('ceph-mon/0') if 'cinder-ceph' not in pools: