From 8fe6f9078fcf8f04931cfea727f4a3fbb9831ecb Mon Sep 17 00:00:00 2001 From: Samuel Walladge Date: Fri, 9 Sep 2022 11:34:04 +0930 Subject: [PATCH] Reload all vault units in reload test `get_unit_name_from_ip_address` along with the ip from vault client has proven flaky in this situation. Not sure why. But better to reload all vault units anyway, so we can take a simpler route here. --- zaza/openstack/charm_tests/vault/tests.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/zaza/openstack/charm_tests/vault/tests.py b/zaza/openstack/charm_tests/vault/tests.py index c31a06b..99f3872 100644 --- a/zaza/openstack/charm_tests/vault/tests.py +++ b/zaza/openstack/charm_tests/vault/tests.py @@ -31,7 +31,6 @@ import zaza.openstack.charm_tests.vault.utils as vault_utils import zaza.openstack.utilities.cert import zaza.openstack.utilities.openstack import zaza.model -import zaza.utilities.juju as juju_utils @tenacity.retry( @@ -306,12 +305,16 @@ class VaultTest(BaseVaultTest): logging.info("Waiting for model to be idle ...") zaza.model.block_until_all_units_idle(model_name=self.model_name) - logging.info("Testing action reload on {}".format(lead_client)) - zaza.model.run_action( - juju_utils.get_unit_name_from_ip_address( - lead_client.addr, 'vault'), - 'reload', - model_name=self.model_name) + # Reload all vault units to ensure the new value is loaded. + # Note that charm-vault since 4fccd710 will auto-reload + # vault on config change, so this will be unecessary. + for unit in zaza.model.get_units( + application_name="vault", + model_name=self.model_name + ): + zaza.model.run_action( + unit.name, 'reload', + model_name=self.model_name) logging.info("Getting new value ...") new_value = vault_utils.get_running_config(lead_client)[