Commit Graph

142 Commits

Author SHA1 Message Date
Rodrigo Barbieri
e0498d6a16 Convert images to raw if ceph image backend (#1078)
Convert images to raw if ceph image backend

We are currently uploading qcow2 images, and
Nova is converting them to raw when running
the tests, sometimes timing out the tests.

With this change we are pre-converting the
images and uploading them as raw, so Nova
does not have to convert them.
2023-08-21 14:15:51 +01:00
Felipe Reyes
7205e31753 Add CompareOpenStack class.
The CompareOpenStack class allows the comparison of OpenStack codenames.
2023-03-28 15:01:56 -03:00
Felipe Reyes
2cd18b484d Replace assertEquals with assertEqual.
DeprecationWarning: Please use assertEqual instead.
2023-02-14 14:45:20 -03:00
Bas de Bruijne
9fb488efef Update series upgrade automation (#952)
* update series upgrade test

* bug fixes

* bug fixes
2023-01-23 12:39:10 +00:00
Alex Kavanagh
22e0311243 Try to get tests to pass with assertions 2023-01-11 13:48:29 +00:00
Alex Kavanagh
b53c782ed0 Fix bad asserting in Series Upgrade test 2023-01-11 13:01:32 +00:00
Liam Young
99186a6651 Add k8s compatible method for keystone auth (#945)
* Add k8s compatible method for keystone auth

* Mock out is_k8s_deployment
2022-10-03 18:27:56 +01:00
Liam Young
65cc55a5db Remove liberty special case (#944)
* Remove liberty special case

* Update unit test
2022-10-03 12:52:30 +01:00
Liam Young
17234c9e15 Respect model in get_swift_storage_topology
Change 0af4c93d causes the target model to be ignored when a
model_name was specified. This in turn is causing the swift
cmr tests to fail as an ip of None is being recorded for
units in a different model.
2022-09-02 14:17:07 +00:00
Liam Young
b4b645ab9a Add fallback ubuntu image location 2022-09-02 14:09:57 +00:00
Frode Nordahl
e8aacf959b Write private SSH key with appropriate permissions
Fixes #583
2022-05-25 15:32:54 +02:00
Frode Nordahl
3f711ff6da openstack: Add update subnet DHCP helper 2022-04-21 14:08:55 +02:00
Alex Kavanagh
70ae1ab605 Remove commented out line. 2022-01-14 15:40:41 +00:00
Alex Kavanagh
1d415da690 Update test_get_keystone_ip__from_unit() test
Update the test to mock zaza.model.get_unit_public_address() to match
the associated changes in zaza for getting public address with juju 2.9
2022-01-14 15:21:32 +00:00
Alex Kavanagh
0af4c93d52 Switch unit.public_address to unit.get_public_address()
Due to the bug [1] on OpenStack providers, unit.public_address doesn't
actually work reliably.  The fix [2] is only for the async function
unit.get_public_address().  Sadly, zaza relied on unit.public_address
and so it needs this patch for juju 2.9 support on OpenStack providers.

This patch relies on an associated patch in zaza [3]; thus this will
fails its tests until that passes.

[1]: https://github.com/juju/python-libjuju/issues/551
[2]: https://github.com/juju/python-libjuju/pull/600
[3]: https://github.com/openstack-charmers/zaza/pull/468
2022-01-14 15:21:32 +00:00
Alex Kavanagh
1fbd505e27 Enable get_keystone_ip() to work with multiple vips config
The keystone charm allows multiple VIP addresses to be configured via
the 'vip' config parameter.  Unfortunately, get_keystone_ip() didn't
support this.  This patch adds that support, plus the missing tests.

Closes: #689
2022-01-07 16:56:22 +00:00
Aurelien Lourot
0e13f606be Merge pull request #679 from ajkavanagh/filter-percona-at-focal
Ensure that series upgrades ignore percona at focal
2021-12-08 10:15:50 +01:00
hemanthnakkina
1a1dc0a79e Add glance tests for Cinder Storage backend (#680)
Add zaza tests for charm glance when cinder is configured
as storage backend.

Related-Bug: LP#1905042

Co-authored-by: Hemanth Nakkina <hemanth.nakkina@canonical.com>
2021-12-01 10:20:08 +00:00
Alex Kavanagh
d4d415c859 Ensure that series upgrades ignore percona at focal
When doing a series upgrade from bionic to focal, the percona-cluster
charm needs to be avoided.  This filters the applications for percona if
the target is focal.  Note if percona is placed on the same unit as
something else that needs to be upgraded (bad idea) then it may still
get 'upgraded' and the operation will fail.
2021-11-30 18:50:14 +00:00
coreycb
6c834770ed Add neutron setup for VLAN provider network (#639)
This adds a new setup function that will setup a VLAN provider network.
It can be called by tests.yaml after basic_overcloud_network:
- zaza.openstack.charm_tests.neutron.setup.basic_overcloud_network
- zaza.openstack.charm_tests.neutron.setup.vlan_provider_overcloud_network
2021-10-08 16:05:36 +02:00
Frode Nordahl
6e8201f696 Only configure one interface on MAAS provider
The Zaza MAAS code selects interfaces that are attached to the
provided CIDR, set up as unconfigured and has link.

In the event a machine has multiple unconfigured interfaces
attached to the same physical network, adding them all to the
configuration might lead to undesired side effects such as network
loops.
2021-08-13 08:46:27 +02:00
Hernan Garcia
e67b0ea1e1 added glance functional test for image-conversion config 2021-05-31 03:45:45 -05:00
Corey Bryant
0b401de17f Get OpenStack codename from /etc/openstack-release
In newer versions of Ubuntu and the Cloud Archive (currently Hirsute,
Wallaby, and above), there is an openstack-release package that, if
installed, specifies the current OpenStack release in
/etc/openstack-release.

Also adds wallaby definitions to non-version definitions in
os_versions.py.

Fixes #560
2021-04-20 10:31:04 -04:00
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