From 0614ff5ad60db931fef4a0ee0b95565ff1d457b9 Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Fri, 24 Jan 2020 12:59:58 -0600 Subject: [PATCH] integrate comments from @thedac to improve waiting for stable, and some documentation issues --- zaza/openstack/charm_tests/keystone/tests.py | 13 +++++-------- zaza/openstack/charm_tests/test_utils.py | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/zaza/openstack/charm_tests/keystone/tests.py b/zaza/openstack/charm_tests/keystone/tests.py index 9959b2b..fd81736 100644 --- a/zaza/openstack/charm_tests/keystone/tests.py +++ b/zaza/openstack/charm_tests/keystone/tests.py @@ -23,7 +23,7 @@ import zaza.model import zaza.openstack.utilities.exceptions as zaza_exceptions import zaza.openstack.utilities.juju as juju_utils import zaza.openstack.utilities.openstack as openstack_utils - +import zaza.charm_lifecycle.utils as lifecycle_utils import zaza.openstack.charm_tests.test_utils as test_utils from zaza.openstack.charm_tests.keystone import ( BaseKeystoneTest, @@ -432,13 +432,10 @@ class LdapTests(BaseKeystoneTest): logging.info( 'Waiting for users to become available in keystone...' ) - states = { - 'keystone': { - 'workload-status': 'idle', - 'workload-status-messages': 'Unit is ready' - } - } - zaza.model.wait_for_application_states(states=states) + test_config = lifecycle_utils.get_charm_config(fatal=False) + zaza.model.wait_for_application_states( + states=test_config.get("target_deploy_status", {}) + ) # NOTE(jamespage): Test fixture should have johndoe and janedoe # accounts diff --git a/zaza/openstack/charm_tests/test_utils.py b/zaza/openstack/charm_tests/test_utils.py index 48835f5..c787055 100644 --- a/zaza/openstack/charm_tests/test_utils.py +++ b/zaza/openstack/charm_tests/test_utils.py @@ -151,8 +151,8 @@ class OpenStackBaseTest(unittest.TestCase): _app_config = model.get_application_config(application_name) # convert the more elaborate config structure from libjuju to key-value keys = keys or _app_config.keys() - # note that conversion to string for all values is due to - # attempting to set any config with other types lead to Traceback + # note the conversion to str for all values is due to + # attempting to set any config with other type leads to Traceback return { str(k): str(_app_config.get(k, {}).get('value', '')) for k in keys