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>
When configuring the address to use to talk to Keystone,
the format_addr helper should be used to ensure that an
IPv4 or IPv6 address can be correctly handled.
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
During testing the vault credentials are stored on the lead unit.
Unfortunatly which unit is the designated leader can change during
the life of the test (particularly if the test involves rebooting
vault units). This change adds a function to search the units for
the credentials file rather than assuming its on the lead unit.
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>