From 9e395f69b76e6a70f053c2a35cf4741a7dfca7f0 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 13 Jul 2020 14:42:43 +0000 Subject: [PATCH 1/2] Add ceph_ready config step Add a ceph_ready config step which just checks that the ceph units are in a 'active' 'Unit is Ready.*' state. This is useful when encryption at rest is being used and the tests.yaml assumes that the units are going to come up blocked. Once vault is ready the tests then need to wait for the ceph units to become unblocked. --- zaza/openstack/charm_tests/ceph/setup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/zaza/openstack/charm_tests/ceph/setup.py b/zaza/openstack/charm_tests/ceph/setup.py index c53ff3c..c93fec8 100644 --- a/zaza/openstack/charm_tests/ceph/setup.py +++ b/zaza/openstack/charm_tests/ceph/setup.py @@ -14,7 +14,23 @@ """Setup for ceph-osd deployments.""" +import logging +import zaza.model + def basic_setup(): """Run basic setup for ceph-osd.""" pass + + +def ceph_ready(): + """Wait for ceph to be ready. + + Wait for ceph to be ready. This is useful if the target_deploy_status in + the tests.yaml is expecting ceph to be in a blocked state. After ceph + has been unblocked the deploy may need to wait to be ceph to be ready. + """ + logging.info("Waiting for ceph units to settle") + zaza.model.wait_for_application_states() + zaza.model.block_until_all_units_idle() + logging.info("Ceph units settled") From c4176881d00b1191b290f882e245f9ed1b4f4e31 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Mon, 13 Jul 2020 14:56:04 +0000 Subject: [PATCH 2/2] Fix spelling typo --- zaza/openstack/charm_tests/ceph/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/ceph/setup.py b/zaza/openstack/charm_tests/ceph/setup.py index c93fec8..87f213d 100644 --- a/zaza/openstack/charm_tests/ceph/setup.py +++ b/zaza/openstack/charm_tests/ceph/setup.py @@ -28,7 +28,7 @@ def ceph_ready(): Wait for ceph to be ready. This is useful if the target_deploy_status in the tests.yaml is expecting ceph to be in a blocked state. After ceph - has been unblocked the deploy may need to wait to be ceph to be ready. + has been unblocked the deploy may need to wait for ceph to be ready. """ logging.info("Waiting for ceph units to settle") zaza.model.wait_for_application_states()