Commit Graph

24 Commits

Author SHA1 Message Date
Alex Kavanagh 752e643c33 Add vault cachine of secrets on relation test
This specific test is for the certificates relation to ensure that the
data presented to units related to vault have a consistent set of data.
2023-07-20 12:17:57 +01:00
Liam Young 33edff6360 Revert "Test get-csr with existing CA (#974)"
This reverts commit 58f2b88365.
2023-01-16 20:40:32 +00:00
Liam Young 58f2b88365 Test get-csr with existing CA (#974)
Check that if an existing CA is present then get-csr requires the
force flag. Test using new action name regenerate-intermediate-ca
2023-01-11 15:19:40 +00:00
Samuel Walladge 8fe6f9078f 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.
2022-09-09 15:07:18 +09:30
Samuel Walladge a2d8e96d8e Fix test to work with vault with raft backend (#827)
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.
2022-08-24 14:04:47 +01:00
Aurelien Lourot 66d08c0866 Make vault/setup/validate_ca() more robust 2021-08-16 13:59:45 +02:00
Aurelien Lourot 65d9d78420 Merge branch 'master' into retry-with-tenacity
Change-Id: Ifac26ffb6d53d75b9dbd314693252ad8b3364c5d
2021-07-16 11:54:08 +02:00
David Ames e9cb5aea5a Retry request on test csr for Vault 2021-06-14 20:49:22 +00:00
Nobuto Murata dee6032fc3 Skip test_vault_reload with enabling/disabling mlock in LXD
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.
2021-06-13 16:57:02 +09:00
David Ames 6645c60e93 Handle Vault running tests twice (#588)
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.
2021-06-09 11:20:53 +01:00
David Ames e5d2acc88c Fix test_vault_reload race condition
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
2021-03-26 16:58:08 +00:00
Bartosz Woronicz d7ec4fd0b8 fix formatting issues and docstring
That fixes the issues introduced in PR #512 #517
Now flake8 should not complain
2021-03-08 16:18:52 +01:00
Bartosz "mastier" Woronicz 79a78c2ca0 fix reload test for vault (#517)
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>
2021-03-08 08:59:23 +01:00
Bartosz Woronicz 73c78a0db3 add reload and restart action tests for vault 2021-03-04 11:58:32 +01:00
Liam Young 24fbc068c9 Correct args to block_until_ca_exists 2021-01-24 15:27:06 +00:00
Liam Young a20733cd14 Refactor ca functions 2021-01-24 14:31:29 +00:00
Liam Young a828774c48 Handle change of CA cert.
Closes issue #487
2021-01-23 16:17:54 +00:00
Chris MacNaughton 80995ccf23 Vault tests should leave Vault unsealed
When cleaning up after a Vault test case, Vault should be left
in the same state we found it, unsealed.

Closes-Bug: #379
2020-08-10 09:09:02 +02:00
Alex Kavanagh 1919000fa4 Fix the vault pause/resume test
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
2020-02-07 10:56:52 +00:00
Sahid Orentino Ferdjaoui 70282da7c1 vault: add pause/resume test case
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-11-21 16:38:29 +00:00
Joe Guo 09ee55efb1 use tenacity for retries
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>
2019-09-05 00:07:21 +12:00
Ryan Beisner 9333b47a86 Flag existing time.sleep usage for refactor
https://github.com/openstack-charmers/zaza-openstack-tests/issues/46
2019-08-30 15:41:28 -05:00
Liam Young 278107e391 Merge pull request #229 from ChrisMacNaughton/bug/1826542
ensure we have a secret KV backend
2019-04-30 11:28:26 +02:00
Chris MacNaughton dd434e281e Add zaza namespacing, starting with openstack 2019-04-25 17:46:03 +02:00