Commit Graph

231 Commits

Author SHA1 Message Date
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
Aurelien Lourot
b7e4bbf0fc Allow several tempest runs with different config
This deprecates:

    configure:
      - zaza.openstack.charm_tests.tempest.setup.render_tempest_config_keystone_v3
    tests:
      - zaza.openstack.charm_tests.tempest.tests.TempestTest

by allowing multiple runs with different config:

    tests:
      - zaza.openstack.charm_tests.tempest.tests.TempestTestWithKeystoneV2
      - zaza.openstack.charm_tests.openstack_upgrade.tests.OpenStackUpgradeTestsByOption
      - zaza.openstack.charm_tests.tempest.tests.TempestTestWithKeystoneV3
2021-09-16 10:00:06 +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
ec63732974 Support configuring networknig charms on MAAS
When on MAAS support doing charm based configuration of OVS by
retrieving MAC address of ports attached to external network
from MAAS.

Note that we should extend the MAAS support to also work with
deployments where MAAS does the OVS configuration for us.
2021-01-13 18:47:08 +01: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
Aurelien Lourot
44e62803e5 Merge pull request #458 from rodrigogansobarbieri/improve_keystone_ldap
Update Keystone LDAP tests
2020-11-23 23:20:15 +01:00
Rodrigo Barbieri
7404b0cb9b Update Keystone LDAP tests
- Reversed ldap-config-flags vs charm configs precedence
  for https://review.opendev.org/748364
- Added new functional test to validate the precedence
- Added zaza helper function to assist handling charm configs
  that do not accept "" (like booleans and ints), and reverting
  to unset values through config_change()
- Fixed zaza reset helper function that apparently never
  worked ({}.keys() returns dict_keys which is not a sequence)
2020-11-23 12:33:32 -03: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
Chris MacNaughton
7bf624b007 Update tempest config files to use newly renamed test_name_server variable 2020-09-25 12:53:13 +02:00
Frode Nordahl
18e8df8eac Do not attempt to restore configuration when equal
The fix for the config_change helpers short cut on config restore
in c5a3f832d0 introduced a
regression for consumers that use the helper to set but not
restore config.

Re-introduce the shortcut when the caller passes in equal settings
for default and alternate configuration.

Fixes #427
2020-09-25 08:20:04 +02:00
Chris MacNaughton
70e758be05 Break out required environment variables
Instead of printing out the list of all required environment
variables when one is missing, only print out the missing
variables.
2020-09-24 15:18:49 +02:00
Frode Nordahl
8a8178738d Add support for resetting back to charm default on config_change
Due to python-libjuju's requirement for coercing every config
value into strings, some configuration type/values are not
possible to specify the default for.

Allow the config_change helper to optionally use reset back to
charm default instead of specifying default config values in a
dictionary.
2020-09-15 15:31:28 +02:00
Frode Nordahl
5b2a2fee9c unit_tests: Replace patch decorators with BaseTestCase helpers 2020-09-15 15:31:25 +02:00
Frode Nordahl
52a2aabf57 utilities/ceph: Add helper for retrieving pools from broker req 2020-09-15 15:31:20 +02:00
David Ames
23b24a5501 Merge pull request #365 from openstack-charmers/ovn-charm
Add OVS to OVN migration tests
2020-09-11 08:48:20 -07: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
Chris MacNaughton
c75f2fcb6d Ensure that zaza-openstack-tests can talk to an IPv6 Keystone
When configuring the address to use to talk to Keystone,
the format_addr helper should be used to ensure that an
IPv4 or IPv6 address can be correctly handled.
2020-09-08 11:11:13 +02:00
Frode Nordahl
fe329c1824 Add helper to retrieve tests_options for specific test
This is done by building a prefix for options key from dot-notated
absolute path to calling method or function.
2020-09-07 10:35:18 +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