Commit Graph

164 Commits

Author SHA1 Message Date
Felipe Reyes
8adbceaf26 Retry when listing glance images.
Issue seen at the gate:

    glanceclient.exc.CommunicationError: [...] ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
2023-05-05 11:41:22 +02:00
Felipe Reyes
60cbdb9e96 Use CompareOpenStack to determine the keystone api version to use. 2023-03-28 15:08:39 -03:00
Bas de Bruijne
feb667206b make provider-router name variable 2023-01-11 15:39:15 +00:00
Bas de Bruijne
d3c9be2f84 make network and image names variable 2023-01-11 15:34:02 +00:00
James Page
bab65e8c2e k8s: use action to retrieve admin password
The Keystone K8S operator now uses generated passwords; make use
of the helper action to retrieve the admin password.
2022-10-11 11:43:01 +01:00
Felipe Reyes
a55f320c2a Add test for keystone-openidc (#925)
* Add keystone-openidc setup code.

The keystone-openidc charm requires 2 configuration steps:

1) Configure the oidc-client-id, oidc-client-secret and
   oidc-provider-metadata-url, this information is tightly related to
   the Identity Provider configured, which for testing purposes this is
   the openidc-test-fixture charm, the setup function
   zaza.openstack.charm_tests.openidc.setup.configure_keystone_openidc
   takes care of setting these values once the fixture charm is ready
   for service.
2) Create the OpenStack objects to correctly configure the federation,
   this is made by the setup function
   zaza.openstack.charm_tests.openidc.setup.keystone_federation_setup_site1
   which will create and configure the following resources:
   - Create a domain named 'federated_domain'.
   - Create a group named 'federated_users'.
   - Grant the 'Member' role to users in the 'federated_users' group.
   - Create an identity provider named 'openid'.
   - Create a mapping named 'openid_mapping'.
   - Create a federation protocol named 'openid' that relates the mapping
     and the identity provider.

* Add support for v3oidcpassword auth plugin.

get_keystone_session() uses the v3.OidcPassword class when the
OS_AUTH_TYPE is set to v3oidcpassword, this class expects the following
extra configuration options:

- OS_IDENTITY_PROVIDER
- OS_PROTOCOL
- OS_CLIENT_ID
- OS_CLIENT_SECRET
- OS_ACCESS_TOKEN_ENDPOINT (optional)
- OS_DISCOVERY_ENDPOINT (optional)

* Add test for keystone-openidc

This patch introduces a new testing class named CharmKeystoneOpenIDCTest
which interacts with keystone using users provided by
openidc-test-fixture via OpenID Connect.

* Add keystone_session argument to launch instances.

Adding the option to pass a keystone session allows callers to use
credentials different from the ones provided by
get_overcloud_keystone_session(), this is helpful when testing non
default keystone configurations (e.g. Federation).

* Add zaza.openstack.charm_tests.openidc.tests.TestLaunchInstance

This testing class configures a private network in the user's project defined by the mapping
rules during the setUpClass stage. Specifically this test performs the following steps:

- Create keypair named 'zaza' in the user's project
- Create a router for the project
- Attach the router to the external network
- Create a network
- Create a subnet attached to the previously create network
- Connect the subnet to the project's router

The testing method launches an instance using a keystone session
associated with a user backed by OpenID Connect.
2022-10-05 13:34:18 +01: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
b4b645ab9a Add fallback ubuntu image location 2022-09-02 14:09:57 +00:00
Samuel Walladge
bb3d93b00a Add test for online extending lvm volume in cinder (#854) 2022-09-01 09:23:57 +01:00
Samuel Walladge
c396608daa Fix pep8 lint errors
One of the pep8 target dependencies must have updated,
causing a bunch of new lint errors in these categories:
- line length > 79 chars
- no whitespace after keyword
2022-08-03 13:44:22 +09:30
Alex Kavanagh
9dc87efdb5 Revert "Add test for online extending lvm volume in cinder (#776)"
This reverts commit e21909717e.
2022-07-28 10:20:12 +01:00
Oprin Marius
243435883f Add Magnum tests (#515)
- Add Heat domain-setup action as a setup configuration option which can be used in other charms
  - test_100_domain_setup is being deprecated if the new configuration option is being used
- Add Magnum tests
  - test create magnum cluster template
  - test create magnum cluster
  - test config changes
  - test pause and resume
- TEST_MAGNUM_QCOW2_IMAGE_URL environment variable is required in the CI
  - The value of this variable should be a link to a fedora-coreos QCOW2 image
2022-07-05 12:06:02 +01:00
Samuel Walladge
e21909717e Add test for online extending lvm volume in cinder (#776)
* Add test for online extending lvm volume in cinder

* Fix pep8 issues

Co-authored-by: Samuel Walladge <samuel.walladge@canonical.com>
2022-07-01 15:37:55 +01:00
Frode Nordahl
e8aacf959b Write private SSH key with appropriate permissions
Fixes #583
2022-05-25 15:32:54 +02:00
Frode Nordahl
7a192e56c9 dvr_enabled: Avoid KeyError when Neutron not present 2022-04-26 11:48:38 +02:00
Frode Nordahl
3f711ff6da openstack: Add update subnet DHCP helper 2022-04-21 14:08:55 +02:00
Aurelien Lourot
7338af093e Add NovaComputeNvidiaVgpuWithHardwareTest 2022-03-17 13:55:47 +01:00
Felipe Reyes
7d5d34b7c4 Retry find_cirros_image() on URLError (#695)
There are situations where the DNS infrastructure hasn't been stable and
many CI jobs have failed with the error:

  urllib.error.URLError: <urlopen error [Errno -3] Temporary failure in name resolution>

This change decorates the function find_cirros_image() to retry and give
the job more chances of recovering from the DNS failures.
2022-01-20 14:15:50 +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
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
Corey Bryant
1eaa2233c1 Authenticate with cinder v3 endpoint by default
The v3 endpoint has been supported by the charms since Pike,
and the V2 endpoint was removed in Xena, therefore it makes
to use the v3 endpoint by default at this point.
2021-11-22 09:56:16 -05:00
Aurelien Lourot
50353b4625 Support 'to-be-set' value for 'data-port'
See https://github.com/openstack-charmers/openstack-bundles/pull/228
2021-11-04 14:59:23 +01: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
c32a6d420b Fix various typos 2021-09-24 14:20:01 +02:00
Aurelien Lourot
f8a88a98a6 Set timeout on juju_wait() (#630)
* Set timeout on juju_wait()

* Remove leftover traces

Traces should be made with logging.debug(). These traces
are probably leftovers from the development phase.
2021-09-09 09:27:20 +01:00
coreycb
c759a23962 Do not update external network data port if already set (#625) 2021-08-24 15:48:55 +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
Aurelien Lourot
797e505f84 Add connection timeout to CirrOS image download (#604)
Without this timeout it has been observed that Zaza
may hang forever on open(). It is better to fail
faster and save time and resources.
2021-07-20 09:37:51 +01:00
Hernan Garcia
e67b0ea1e1 added glance functional test for image-conversion config 2021-05-31 03:45:45 -05:00
Aurelien Lourot
03ddaf0079 Add more logging around downloading/caching test images 2021-05-10 13:57:26 +02:00
Corey Bryant
d70ff79b1e Change log to debug to create less noise 2021-04-20 13:05:18 -04:00
Corey Bryant
9a48757d5e Fix version fallback path when /etc/openstack-release doesn't exist 2021-04-20 12:32:07 -04: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
Ionut Balutoiu
7e56813885 Add Manila NetApp tests
These Zaza tests are meant to be used with the new `manila-netapp` charm.
2021-03-15 15:11:38 +02:00
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