Commit Graph

65 Commits

Author SHA1 Message Date
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
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 2cd18b484d Replace assertEquals with assertEqual.
DeprecationWarning: Please use assertEqual instead.
2023-02-14 14:45:20 -03: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
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 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 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
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
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 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
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 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 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
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 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
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
Aurelien Lourot 59ec82f542 Make ssh_test() more robust 2020-05-07 14:25:47 +02:00
Aurelien Lourot 83246a9305 Print stderr when failing to ping new instance 2020-04-14 14:50:31 +02:00
David Ames 40e9c86df4 Test the condition not the implementation 2019-12-10 08:36:22 -08:00
David Ames c109abbe25 Fix unit test 2019-12-09 09:22:01 -08:00
Liam Young 9c34bc42da Expose model_name option in get_keystone_session_from_relation 2019-11-25 17:40:03 +00:00
Frode Nordahl 8e8544bab7 Fix ovn_present for ovn-dedicated-chassis
Add missing unit test.
2019-11-02 10:31:30 +01:00
Frode Nordahl 7d1d04a742 Deduce whether DVR is enabled from neutron-api config
Add helper to detect presence of OVN in deployment
2019-11-01 06:39:17 +01:00
Frode Nordahl 85927e20c6 Add helper to get uuids of machines w/OVN chassis
Refactor get_machines_for_application as generator function instead
of building and passing on static List.
2019-11-01 06:39:07 +01:00
Chris MacNaughton 045c50637b Add a new SSH function
It is likely that there are other commands that we
would like to run in our tests, so this is a new SSH
command runner that the existing SSH check has been
updated to use.
2019-06-06 13:46:06 +02:00
Liam Young 648ac9262b Expose resource_removeds retry options (#11)
resource_removed is used in many places to monitor removal of
different kinds of OpenStack resource. It is reasonable to expect a
flavor to be removed in a few seconds where as an image based instance
may take minutes to be removed. With that in mind this change
exposes the retry options used by tenacity allowing the caller to
set reasonable expectations for the resource removal.
2019-05-23 11:16:03 +02:00
Liam Young 6b2c1d26eb Add function for getting keystone auth from relation 2019-05-13 09:06:40 +00:00
Chris MacNaughton dd434e281e Add zaza namespacing, starting with openstack 2019-04-25 17:46:03 +02:00
Liam Young d90da772d2 Expose resource_reaches_status' retry options (#206)
* Expose resource_reaches_status' retry options

resource_reaches_status is used in many places to monitor many
different kinds of OpenStack resource. It is reasonable to expect a
flavor to be created in a few seconds where as an image based instance
may take minutes to become active. With that in mind this change
exposes the retry options used by tenacity allowing the caller to
set reasonable expectations for the resource state change.

In addition the image based instance creation call is updated
to retry for longer as this has been timing out.

* Remove swap files
2019-03-27 13:02:47 +01:00
David Ames 02180fb178 Unit tests 2019-03-14 08:55:26 -07:00
Liam Young e9c7690af4 Enable masakari instance monitor tests
Add helpers and a test to test a guest dying and being resurrected
by masakari instance monitor.
2019-03-07 16:03:42 +00:00
Liam Young 3118f122b4 Misc methods to support vm migration tests
Misc methods to support vm migration tests.
2019-03-05 19:30:57 +00:00
Alex Kavanagh 4bf09fc45a Change the image download to download to tmpdir as a default
This is to prevent (as far as possible) putting the image into the
module under test.
2018-09-19 14:24:51 +02:00