`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.
The tests here run a series of commands on the vault client,
without waiting in between.
This is usually fine, but with the raft backend,
there can be delays between initialising, unsealing,
and the raft cluster settling.
During this time, most vault commands will return errors.
When Vault is running in a LXD container, test_vault_reload is expected
to fail because mlock cannot be enabled in LXD containers. Skip it when
running in containers is detected. It's useful for local development
environments with Juju's localhost/LXD provider. The test won't be
skipped in the OpenStack Charm CI since the Vault units will be run in
KVM, not in LXD containers.
Vault's runs its tests twice. In some circumstances the removal of the
vault key from the test_config dictionary can throw a KeyError. Do not
fail when this happens.
The test_vault_reload test was checking for running config without giving the
config-change time to complete. Simply adding an idle wait resolves the issue.
Closes Issue: #528
The test was failing for xenial-ha-mysql bundle
This fixes the issue for cluster vault
by picking the right vault cluster leader
to run the commands against.
Co-authored-by: Bartosz Woronicz <bartosz.woronicz@canonical.com>
The pause/resume test paused the lead unit, but then checked
the first unit. In an HA scenario, the lead unit may not be the
first unit. This PR changes the test to check the lead unit after
the pause/resume test.
Depends On: https://github.com/openstack-charmers/zaza/pull/327
These code snippets were using a hard-coded sleep time, wrapped by a for loop
to retry, which is bad code smell.
Use tenacity retries to simplify the code, and be consistent with the
established approach to similar needs in other tests.
Closes#46
Signed-off-by: Joe Guo <guoqiao@gmail.com>