Commit Graph

119 Commits

Author SHA1 Message Date
Alex Kavanagh
e9f11da5df Fix typo and rename class for better understanding
Fixes a typo (None -> not None) and renames the class from
ObjectRetrier -> ObjectRetrierWraps to make it clearer that the class
instantiation is to wrap and object with the retrier code rather than do
retries at that moment.
2021-03-25 14:47:42 +00:00
Alex Kavanagh
c041042fe2 Add function to just retry on keystone ConnectFailure
The main failure that seems to occur with clients is the
ConnectFailure, which according to the docs, is retry-able.  Thus
provide a function that adds that exception condition automatically.
Also fix the import problem in octavia test for the object retrier that
is being used to validate the ObjectRetrier feature.
2021-03-10 09:41:10 +00:00
Alex Kavanagh
45146b6c45 Add ObjectRetrier to perform retries on openstack client calls
This adds a wrapper class that detects if a callable object in any of
the descendent objects raises an Exception.  If so, then it retries that
exception.

This is to attempt to make the zaza tests a little more robust in the
face of small network failures or strange restarts.  This is a test, and
robust logging a reporting should be used to determine whether it is
covering up actual bugs rather than CI system issues.

Related Bug: (zot repo)#348
2021-03-10 09:40:03 +00:00
Frode Nordahl
2ab9cebbf6 Use per-model tmp-dir to store local copy of CA cert (#493)
The current approach of storing the deployment CA certificate in
the 'test/' relative path does not allow for executing tests for
multiple targets from the same environment.

We have previously moved (7a90110) the local copy of the SSH
private key for similar reasons.

Remove the global constants as we cannot build them without making
function calls, and we'd rather avoid doing that at module import
time. Code using the location of the local CA certificate has
already been changed to use helper functions.
2021-02-04 08:48:17 +01:00
Garrett Thompson
7878523e34 Rename zaza_juju to be consistent with all of repo 2021-02-03 18:01:28 +00:00
Liam Young
93a9aff927 Fix context manager mock 2021-01-25 11:47:42 +00:00
Liam Young
e047150f5b Add unit tests 2021-01-25 09:21:00 +00:00
Frode Nordahl
ee0dd80cec Split configure_gateway_ext_port function
The function does three separate things today, and two of its
tasks are useful for other provider types such as MAAS.

Also fix create_additional_port_for_machines idempotency.

We previously added a run time assertion to fail early when
attempting to configure networking for an invalid bundle. The
check had the side effect of prohibiting subsequent runs on
already configured models.
2021-01-13 18:47:05 +01: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
Liam Young
a35ba0917e Allow an app to be set when calling get_os_release (#477)
Ceph deployments may not contain a keystone service which causes
calls to get_os_release to fail as it calls get_current_os_release_pair
without sepecifying an application (keystone is the default).
2021-01-06 12:26:01 +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
Alex Kavanagh
f94f2be31d Merge pull request #462 from gnuoy/nova-client-version
Support nova client micro versions
2020-11-18 16:00:05 +00:00
Liam Young
dfecc58f5a Extend resource_reaches_status
The resource_reaches_status assumes that the attribute to be checked
is called 'status' but this can vary between resource types so allow
the name of the attribute to specified.
2020-11-18 12:13:59 +00:00
Liam Young
b23d9e285b Support nova client micro versions
Support micro versions when requesting a nova client.
2020-11-18 09:36:44 +00:00
Gabriel Adrian Samfira
7c2f5cdf24 Add Ironic tests 2020-10-06 06:06:57 +00:00
Frode Nordahl
52a2aabf57 utilities/ceph: Add helper for retrieving pools from broker req 2020-09-15 15:31:20 +02:00
Frode Nordahl
5a10779e45 Re-order checks in networking auto-detection
To support OVS to OVN migration checks we want the basic overcloud
configure job to set up N-OVS and/or N-GW when present and the
OVN pre migration configure job will copy the configuration for us.
2020-09-08 16:11:39 +02:00
Alex Kavanagh
056e29cbdc Remove commented out code sections
These were left over from the refactor.
2020-08-20 11:15:16 +01:00
Alex Kavanagh
5ad5f85f99 Fix the charm-upgrade tests as used by CoT
The biggest change is that the upgrade_groups() is a list of tuples ...
[()] ... rathern than a collections.OrderedDict().  This tends to make
more sense as they are processed in order and don't actually need to be
indexed.

Also excludes easyrsa (as it's not an upgrade target) and adds a
"Database Services" which upgrades mysql or percona FIRST before moving
on to rabbitmq and other stateful services.  This is because some charms
really need to talk to mysql if one of the other stateful services does
a relation changed hook.  This makes it more likely that the system will
ugprade correctly.
2020-08-19 20:47:00 +01:00
Liam Young
59b6c1bd35 Merge pull request #341 from openstack-charmers/lourot/keystone
Minor improvements to keystone tests
2020-07-16 13:26:09 +01:00
Aurelien Lourot
0287664d92 Fix paramiko.ssh_exception.BadAuthenticationType (#355)
Fix paramiko.ssh_exception.BadAuthenticationType when SSHing to a new Ubuntu instance.

Note that paramiko still has a few issues around authentication:
https://github.com/paramiko/paramiko/pull/1106/files

This paramiko PR also shows that password='' isn't the same as
password=None
2020-07-09 16:35:00 +02:00
Liam Young
7f122b8611 Last unit test fix (passing locally, was failing in travis) 2020-07-07 12:38:18 +00:00
Liam Young
ed2aded7f9 Fix another unit test 2020-07-07 12:32:54 +00:00
Liam Young
9b706b8eaa Remove swap files 2020-07-07 12:24:32 +00:00
Liam Young
76fdb61e0f Fix up unit tests 2020-07-07 12:18:01 +00:00
Aurelien Lourot
670292c683 Remove more deprecation warnings 2020-07-02 12:11:23 +02:00
Liam Young
58182b86b8 Deprecate zaza.openstack.utilities.juju (#340)
This is the 3rd change in the effort to deprecate
zaza.openstack.utilities.juju in favour of zaza.utilities.juju.
All functions now just wrap their equivalents in
zaza.utilities.juju and a decorator has been added which logs a
warning if the function is used.
2020-07-01 14:38:19 +02:00
Corey Bryant
de893b66b8 Drop OS_ prefix from OS_TEST_HTTP_PROXY
As part of this change also switch to using deployment_env.
2020-06-12 02:35:35 +00:00
Frode Nordahl
8c747390d3 Fail early when no units found for external port creation
Fixes #298
2020-05-28 13:24:14 +02:00
Aurelien Lourot
59ec82f542 Make ssh_test() more robust 2020-05-07 14:25:47 +02:00
Chris MacNaughton
f49259e426 Set some apt config to accept package defaults
Because the OpenStack charms re-render their config
whenever things are incorrect, we can accept any new
package defaults as a part of the upgrade and
resolve incorrect config after the upgrade
2020-04-17 13:45:47 +02:00
Liam Young
3245a6646f Merge pull request #224 from ChrisMacNaughton/feature/parallel-series-upgrade-refactor
Series upgrade can be done in massively parallel batches
2020-04-16 12:31:10 +01:00
Chris MacNaughton
2bc2234cad Update to migrate bits out to Zaza 2020-04-16 11:53:35 +02:00
Chris MacNaughton
fa4587f366 Ensure that origin is set only after the first machine is rebooting 2020-04-15 16:38:42 +02:00
Chris MacNaughton
592622935c tidy up and add more debugability 2020-04-15 10:06:41 +02:00
Aurelien Lourot
83246a9305 Print stderr when failing to ping new instance 2020-04-14 14:50:31 +02:00
Chris MacNaughton
27e5f7d8bc We must have async functions for the before/after callables 2020-04-10 16:51:41 +02:00
Chris MacNaughton
208439cdf1 Add unit tests for pre and post-app upgrade functions 2020-04-10 11:42:21 +02:00
Chris MacNaughton
e2d6a5c081 Add test coverage for follower-first upgrades 2020-04-10 10:50:43 +02:00
Chris MacNaughton
7649bcb10e Skip the async unit tests on py35 2020-04-10 10:50:43 +02:00
Chris MacNaughton
74652f2523 Add unit test coverage for series upgrades
This also includes some tidying
2020-04-10 10:50:43 +02:00
Chris MacNaughton
cf1ea4c71b First pass at batched parallel series upgrade 2020-04-10 10:50:43 +02:00
Liam Young
a822f6995b Added unit tests 2020-04-01 13:45:47 +00:00
Chris MacNaughton
42b0f5fcb1 Secondary first upgrades should also support the origin argument
Closes #210
2020-04-01 09:31:03 +02:00
Chris MacNaughton
540e0ea4fc tidy up style things, add docstring 2020-03-25 08:44:41 +01:00
Chris MacNaughton
f73b4c1d6d fix up unit tests and assumptions 2020-03-25 08:44:41 +01:00
Chris MacNaughton
0a94b97cf4 update for style bits 2020-03-25 08:44:41 +01:00
Chris MacNaughton
8450216f72 Create parallel (async) series upgrade 2020-03-25 08:44:41 +01:00
Chris MacNaughton
93fd631b1a Split up and re-organize upgrade helpers 2020-03-25 08:44:41 +01:00
Alex Kavanagh
7538791b52 Merge pull request #145 from gnuoy/add-openstack-upgrade-lib
Add functions for performing OpenStack upgrades
2020-02-04 11:42:54 +00:00