From aae3366fc9aececf81e0e8d3c97036ec7ec89097 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Thu, 19 Sep 2019 14:14:00 +0200 Subject: [PATCH] Add further disable tests --- zaza/openstack/charm_tests/policyd/tests.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zaza/openstack/charm_tests/policyd/tests.py b/zaza/openstack/charm_tests/policyd/tests.py index dd418e5..2dee9bb 100644 --- a/zaza/openstack/charm_tests/policyd/tests.py +++ b/zaza/openstack/charm_tests/policyd/tests.py @@ -118,8 +118,20 @@ class PolicydTest(test_utils.OpenStackBaseTest): for k, v in app_status['units'].items() if k.split('/')[0] == self.application_name] logging.info("App status is: {}".format(wl_stats)) + self.assertTrue(all(s.startswith("PO:") for s in wl_stats)) + logging.info("App status is valid") # disable the policy override - # verify that the file no longer exists + logging.info("Disabling policy override ...") + self._set_config_and_wait(False) # check that the status no longer has "PO:" on it. + app_status = zaza_juju.get_application_status(self.application_name) + wl_stats = [v['workload-status']['info'] + for k, v in app_status['units'].items() + if k.split('/')[0] == self.application_name] + self.assertFalse(any(s.startswith("PO:") for s in wl_stats)) + logging.info("... done") + + # verify that the file no longer exists logging.info("...done") +