Commit Graph

180 Commits

Author SHA1 Message Date
Frode Nordahl
a5ad00acf1 undercloud_and_charm_setup: Add support for LXD.
This adds basic LXD support that allows adding second NIC to
instances hosting networking charms as well as populating said
charms configuration with the second NIC MAC address.

Signed-off-by: Frode Nordahl <fnordahl@ubuntu.com>
2024-10-14 09:00:01 +02:00
Alex Kavanagh
32bcda1cc2 Add octavia to UPGRADE_SERVICES 2024-09-19 11:10:35 +01:00
Billy Olsen
a64d2c6b03 Use zaza.model.run_on_unit for ca checks
Existing code uses the python libjuju unit.run in order to execute
a wait check for ca readiness across the units. The behavior of libjuju
changed between 2.x and 3.x and causes this functionality to break. This
is abstracted and handled in the zaza library, so use that code instead
as it properly handles the differences.

Signed-off-by: Billy Olsen <billy.olsen@canonical.com>
2024-03-18 12:27:04 -07:00
Liam Young
7fe5b88a69 Move wait_for_url and rename wait_for_client 2023-12-04 13:18:08 +00:00
Alex Kavanagh
def0148642 Add a retrier-wrap to the nova client for octavia tests
The nova service may not be quite ready after vault initialisation for
the basic network configuration, so add a retrier wrapper around the
client for every test to make sure that it retries.
2023-10-31 19:44:49 +00:00
Alex Kavanagh
054e2fe849 Merge pull request #1119 from freyes/content-too-short
Retry on ContentTooShort
2023-09-08 08:42:46 +01:00
Felipe Reyes
91c1cc3c33 Retry on ContentTooShortError
This patch makes the download_image() to retry automatically on
ContentTooShortError exception, this is an issue that has been seen on
the gate, see [0].

[0] https://openstack-ci-reports.ubuntu.com/artifacts/3ae/891712/3/check/focal-wallaby-pacemaker-remote-ssl_masakari/3ae840c/job-output.txt
2023-09-07 10:19:28 -03:00
Felipe Reyes
449164284f Fix version and nova_api_version data types declared in docstring 2023-08-25 12:44:30 -04:00
Felipe Reyes
55b3145865 Log available attributes on AttributeError
This simplifies when developing new tests and the programmer is not too
familiar with the different attributes an object has.
2023-08-24 19:38:11 -04:00
Felipe Reyes
11c3f80d5e resource_reaches_status: add new parameter stop_status
The stop_status parameter allows callers to ask stop retrying based on a
list of statuses that are known to be final (and error) states, this
saves time failing earlier.

Usage example for fail early when an instance reaches to ERROR status:

    openstack_utils.resource_reaches_status(self.nova_client.servers,
                                            instance_uuid,
                                            resource_attribute='state',
                                            expected_status='ACTIVE',
                                            stop_status='ERROR')
2023-08-24 19:38:11 -04:00
Felipe Reyes
3283ed47ba Use None as get_nova_session_client() version default
This allows callers to pass None and let get_nova_session_client() to
use a sane default API, specifically this allows intermediate users
(e.g. launch_guest() ) to proxy values passed by the caller.
2023-08-24 19:38:11 -04:00
Felipe Reyes
fd824768b5 Add Watcher client support
Add get_watcher_session_client() helper function to build a
watcherclient.v1.Client instance authenticated with a keystone session
that uses admin credentials by default.
2023-08-24 19:37:56 -04:00
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
Dmitrii Shcherbakov
110242796c Allow an optional FIP service subnet to be set up
A separate service subnet for FIPs is useful in making sure that
connectivity based on the advertised routes really works as opposed to
relying on directly connected routes to FIPs in the undercloud network
subnet used as an external network.
2023-06-12 21:35:57 +04:00
Felipe Reyes
b453a85013 Improve logging of _resource_removed()
On failures there is no information of the state of the objects that
couldn't be removed, maybe there are on their way to be removed and this
is a failure visible on slow clouds and not an actual issue, this will
help with troubleshooting.
2023-05-26 15:41:27 -04:00
Dmitrii Shcherbakov
842637477c Switch from Quagga to FRR
A charm that uses FRR instead of Quagga is now published under:
https://charmhub.io/osci-frr

For our purposes FRR is a drop-in replacement of Quagga but the point
of a change is to remove Quagga references for clarity.
2023-05-23 21:31:44 +03:00
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