Commit Graph

128 Commits

Author SHA1 Message Date
Ionut Balutoiu
2fefca5a40 Code cleanup
* Move general function out of the testing class. This will make them
  easy to be reused.
* Properly organize the tests, and add tons of docstrings and comments
  to have them as clear as possible.
* Add `failover_cinder_volume_host` to the Zaza `utilities/openstack.py`,
  since this is a general purpose function.
2021-03-03 13:56:36 +02: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
Liam Young
5be8fc3771 Fix docstring and bug 2021-01-25 11:41:39 +00:00
Liam Young
e047150f5b Add unit tests 2021-01-25 09:21:00 +00:00
Liam Young
401829f0a7 Code tidy and docstrings 2021-01-24 17:24:20 +00:00
Liam Young
d637646a9e Fix typo 2021-01-24 16:19:45 +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
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
Chris MacNaughton
ebc51b490e Make the get_os_release default match get_current_os_release_pair 2021-01-06 17:19:56 +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
Frode Nordahl
38767da01d Merge pull request #464 from openstack-charmers/lourot/ovn-codename-major-minor
Support 'major.minor' when determining OS release of OVN packages
2020-11-19 12:46:51 +01:00
David Ames
910516c3bd Merge pull request #465 from ajkavanagh/bug/460
Add placement-common versions for train->ussuri upgrade
2020-11-18 14:13:15 -08: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
Alex Kavanagh
b07afac21a Add placement-common versions for train->ussuri upgrade 2020-11-18 14:33:37 +00:00
Liam Young
817473675d Numbers are imutable so safe to have as default argument 2020-11-18 14:12:13 +00:00
Aurelien Lourot
c5c11194a1 Support 'major.minor' when determining OS release of OVN packages 2020-11-18 14:49:12 +01: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
Aurelien Lourot
d1dbefa6ec Merge branch 'master' into lourot/bug/1877076 2020-11-05 11:31:52 +01:00
Alex Kavanagh
79e43c7f68 bionic-train -> ussuri needs to upgrade placement
For the openstack upgrade of train to ussuri, the placement charm needs
to be upgraded.  Add it to the UPGRADE_SERVICES.  Related launchpad bug:
LP:1724174 [1]

[1]: https://bugs.launchpad.net/openstack-mojo-specs/+bug/1724174
2020-10-22 15:28:16 +01:00
Gabriel Adrian Samfira
7c2f5cdf24 Add Ironic tests 2020-10-06 06:06:57 +00:00
Aurelien Lourot
49268243ba Improve logging 2020-09-25 14:17:38 +02:00
James Page
018f1eac96 Merge pull request #398 from openstack-charmers/ceph-bluestore-compression
Ceph bluestore compression
2020-09-24 11:30:50 +01:00
Frode Nordahl
ced5b3dd13 Retry scp/ssh operations in add_interface_to_netplan helper
Fixes #420
2020-09-21 08:18:08 +02:00
Frode Nordahl
a1f3a8710f Teach Zaza to determine release pair for Ceph deployments
As Ceph is distributed as part of Ubuntu Cloud Archive, the
pockets lend their name from the accompanying OpenStack release.
2020-09-18 09:08:33 +02:00
Alex Kavanagh
17bad029a5 Fix network setup for mojo
A recent change introduced a configuration option in the
./tests/test.yaml file (default location) which allows juju wait to be
used rather than waiting on various workload messages.  This,
unfortunately, breaks mojo tests as they don't use a tests.yaml.  This
change refactors that code, and enables a 'use_juju_wait' to be passed
into the relevant functions, and a new command line option (default
true) to disable using juju wait.
2020-09-15 09:55:09 +01: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
Frode Nordahl
8f2e3463cc Allow add_interface_to_netplan to find ovn-dedicated-chassis units 2020-09-08 12:38: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
4d8c509133 Make the use of juju_wait configurable
For compatibility with existing scenario tests the
`configure_gateway_ext_port` helper currently make use of
`juju_wait` when configuring the deployed cloud.

This does not work well if the model you are testing has
applications with non-standard workload status messaging.

Allow to override the behaviour through config step options.
2020-09-07 10:35:18 +02:00
Alex Kavanagh
59d68e49a5 Ensure that the tests directory exists for the local cacert (#373)
A recent change to allow multiple zazas to run at the same time fixed
the cacert file into a local 'tests/' directory.  Unfortunately, that
doesn't exist for every environment where zaza runs (e.g. mojo) and so
this patch ensures that the path exists prior to trying to download into
it.
2020-07-23 15:07:21 +02: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
Andrew McLeod
a670e274fa add image arch and properties specification 2020-07-15 16:56:06 +02: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
a829b372e0 Use model tmpdor for key storage
Use the model specific tmp dir to store the test ssh private key.
This avoids the key being overwritten in CMR tests.

Depends-On: https://github.com/openstack-charmers/zaza/pull/371
2020-07-07 09:56:25 +00:00
Frode Nordahl
520830905b Increase wait time for cloud_init_complete
We often see test runs being killed prematurely due to slow to
complete cloud-init step on a loaded CI cloud.

Related issue #311
2020-07-02 13:03:42 +02:00
Aurelien Lourot
670292c683 Remove more deprecation warnings 2020-07-02 12:11:23 +02:00
Aurelien Lourot
defa4c542c Merge pull request #278 from ajkavanagh/fix-auth-domain
Fix broken dictionary assignment for domain
2020-07-01 16:16:43 +02:00
Frode Nordahl
537473ad3a Store local overcloud CACERT copy in relative path
At present the overcloud CACERT is copied to /tmp and as such it
is not possbile to run multiple tests at once without them
stepping on each other.

Store the copy in a path relative to where the test is executed,
in line with how the SSH keys are stored etc.

Fixes #331
2020-06-19 09:50:28 +02:00
Frode Nordahl
95eb158e7e Support undercloud running TLS (#330)
Consume the `OS_CACERT` environment variable when setting up
undercloud auth.

Fixes #329
2020-06-19 08:28:18 +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
Alex Kavanagh
21655a3741 Fix broken dictionary assignment for domain 2020-05-16 18:52:35 +01:00
Frode Nordahl
78e992ac87 Merge pull request #260 from ajkavanagh/multi-lts-image-for-octavia
The octavia tests require multiple LTS images
2020-05-14 06:24:24 +02:00
Frode Nordahl
8edff98f94 Add OVN charm tests 2020-05-08 12:34:21 +02:00
Alex Kavanagh
c8ea324ccb Add focal template to image list 2020-05-07 20:09:02 +01:00