Files
zaza-openstack-tests/zaza/charm_tests/vault/setup.py
T
Liam Young 2dfa16751f Update vault tests for VIP testing
Update vault tests to support an explicit client pointing at the
vip. Also, switch to using a namedtuple for managing the clients
to allow client metadata to be stored along with the hvac client.
2018-04-13 13:09:57 +00:00

21 lines
673 B
Python

#!/usr/bin/env python3
import zaza.charm_tests.vault.utils as vault_utils
def basic_setup():
clients = vault_utils.get_clients()
vip_client = vault_utils.get_vip_client()
if vip_client:
unseal_client = vip_client
else:
unseal_client = clients[0]
initialized = vault_utils.is_initialized(unseal_client)
# The credentials are written to a file to allow the tests to be re-run
# this is mainly useful for manually working on the tests.
if initialized:
vault_creds = vault_utils.get_credentails()
else:
vault_creds = vault_utils.init_vault(unseal_client)
vault_utils.store_credentails(vault_creds)