Commit Graph

25 Commits

Author SHA1 Message Date
Liam Young 14999ca1a1 Add two more auto initialise options (#664) 2021-10-28 11:16:58 +01:00
Liam Young 5b2ef5df9b Add auto_initialize_opportunistic
Add a method which will init vault if its present and skip if it
is not. This allows much simpler tests.yaml if all test and
config steps are the same for TLS and non-TLS test cases apart
from initialising vault.
2021-10-28 08:08:19 +00:00
Aurelien Lourot 66d08c0866 Make vault/setup/validate_ca() more robust 2021-08-16 13:59:45 +02:00
Liam Young 401829f0a7 Code tidy and docstrings 2021-01-24 17:24:20 +00: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
Alex Kavanagh 282b8be577 Update openstack upgrade tests for focal (#476)
This patch modifies the existing openstack upgrade tests so that they
work with focal (by explicitly supporting mysql-innodb-cluster), and are
also interruptable and resumable (at a charm level).  It also makes them
work with the udpated 'get_upgrade_groups()' that ultimately gets a List
of Tuples rather than a dictionary.
2021-01-06 14:09:41 +01:00
Alex Kavanagh 7ced54b382 Concurrent series upgrade updates (#466)
* Updates to concurrent series upgrade

Updates to make it run more in parallel and spend less time waiting on
the whole model when updating machines.

* Make the concurrent series upgrade tests work

This is a number of changes to get the concurrent (here called
'parallel' historically) series upgrade tests to work.  A number of
changes were required which included limiting the number of concurrent
async co-routines (futures) that could be run as with large models it
hits the limits of the Py3 runtime.

* Fix the tests and change pause order in maybe_pause_things

Due to an additional model helper call, an additional model AsyncMock is
required.  Also the pause order had changed, and this is restored to
ensure the original design is retained (for pause order).

Clean up some commented out code and sort out a few PEP8 errors.

* Update comment to reflect code (3 -> 4)

* Fix tests that fail on bionic but pass on focal

Essentially, asyncio.gather has different behaviour on bionic that
focal.  Although this doesn't affect testing, it does affect the unit
tests.  These changes are simply to normalise the behaviour of unit
tests on focal and bionic.
2020-12-02 11:22:00 +01:00
Liam Young d0981d64af Add auto_initialize_no_validation_no_wait
When vault is in its own model with no clients then vault needs
to be initialised without waiting for clients to start executing
and without validating a client has recieved the cert. To achieve
this, this PR adds auto_initialize_no_validation_no_wait.
2020-07-07 08:57:40 +00:00
Liam Young 2f6d6be3ef Update doc strings 2020-05-28 09:35:25 +00:00
Liam Young 362be92006 Retrieve ssl-ca from vault when using vault api
If the ssl-{key,chain,ca} charm config option have been set than
retrieve the ssl-ca from the vault charm and use it when making
called to the vault api.
2020-05-28 09:19:12 +00:00
Chris MacNaughton 27e5f7d8bc We must have async functions for the before/after callables 2020-04-10 16:51:41 +02:00
Liam Young 5fdde89be0 Tidyup docstring and method name 2020-02-04 12:48:00 +00:00
Liam Young 9c8a18b66f Fix path to get_unit_name_from_ip_address 2020-02-04 11:05:23 +00:00
Liam Young 5927878a03 Tidyup mojo cert unseal 2020-02-04 10:10:50 +00:00
Liam Young cac2f4c4a7 Fix MOJO_LOCAL_DIR name 2020-02-03 16:03:42 +00:00
Liam Young 83982a7aec Add unseal function for mojo use.
* Add an unseal function for mojo to use.
* Switch mojo to use new function after series upgrade reboot.
* Add fallback if vip client is unavailable (the case if all
  hacluster units are paused for series upgrade).
2020-02-03 13:39:17 +00:00
Frode Nordahl 9108059f71 vault: Extend workaround for LP: #1826382
We also need to restart consumers of the placement API on the
'nova-cloud-controller' unit.
2019-11-12 17:40:25 +01:00
Frode Nordahl 8d676bf9fa Make non-existent tests/tests.yaml non-fatal where possible
Not all test environments or runners are equal, don't crash on
non-existent test config.
2019-11-05 16:38:06 +01:00
Frode Nordahl a82979d145 vault: Await execution prior to validation step
Make it possible for consumers of the ``auto_initialize_no_validation``
function to execute subsequent setup and test code that require vault
and the consumers of the ``certificates`` relation to be ready.

With the current order of execution, it is not possible to use the
configure function in models where ``keystone`` application is not
present.
2019-10-18 11:05:18 +02:00
Liam Young 79a149bfc5 Facade for vault & basic_setup_and_unseal
Add a facade for interacting with vault and a function which
unseals vault units (useful when vault units have been rebooted).
2019-10-14 08:56:35 +00:00
Liam Young 025e1f4830 Ensure nova-compute is restarted when certs change
This is a temporary fix to work around a bug in nova-compute.
The bug causes nova-compute to cache the placement api endpoint
which causes placement api calls to fail when the endpoint switches
from http to https
2019-07-22 08:09:54 +00:00
Liam Young 11b55d5b4c Support initializing vault with no clients
Currently when vault auto_inititialize [sic] is called a validation
step is run at the end to check that clients connected to vault
have the correct setup. However in sometimes there are no clients
to run validation with (as with cross model relation testing). To
facilitate this expose a new method 'auto_initialize_no_validation'
which skip the client validation.

Also correct the spelling of auto_inititialize but add a partial
to support tests that are already using the old spelling.
2019-06-11 15:27:03 +00:00
Chris MacNaughton dd434e281e Add zaza namespacing, starting with openstack 2019-04-25 17:46:03 +02:00