Commit Graph

1413 Commits

Author SHA1 Message Date
Liam Young f806b2aa7a Add test to scale application out and in
Add test that scales an application out and in and checks each
stage with tempest.
2023-03-07 17:04:20 +00:00
Luciano Lo Giudice 1e12a7a6a1 This fixes flakyness with iscsi tests. There was a previous fix that
did mostly the same, but this PR makes it more similar to what we
have pending for the stable branches.

This PR is being tested in this gerrit patchset:
https://review.opendev.org/c/openstack/charm-ceph-iscsi/+/871154
2023-03-03 13:37:21 -03:00
Felipe Reyes 4c414c25d0 Merge pull request #1005 from ajkavanagh/feature/test-rotate-service-user-password
Test the keystone rotate-service-user-password action
2023-02-28 15:30:32 -03:00
Felipe Reyes a81376183f Skip test_930_scaleback on crmsh-4.4.0-1ubuntu1
The crmsh package available in kinetic fails to put a cluster node in
maintenance mode, this is part of the scaleback process, more details on
the failure available at the related bug.

This change introduces a new decorator skipVersion() that allows to
provide a list of package versions with an operation flag on how dpkg
should compare the version(s).

The test HaclusterTest.test_930_scaleback() is disabled when running
crmsh-4.4.0-1ubuntu1, at the moment this would be kinetic, although if
any new package gets released this test will be re-enabled automatically
allowing us catch early if the test got fixed or not.

Related-Bug: http://pad.lv/1972730
2023-02-27 15:36:04 -03:00
Alex Kavanagh eb4224284f Fix pep8 error in .../keystone/tests.py 2023-02-22 17:05:01 +00:00
Alex Kavanagh d19a540641 Fix mistake in which section to use for password 2023-02-21 18:38:00 +00:00
Alex Kavanagh 3bb64912e7 Another silly error - read from string rather that file. 2023-02-21 17:16:40 +00:00
Alex Kavanagh 544d0d5a7c Ensure that the ondisk glance passwords change in the conf file 2023-02-21 16:17:55 +00:00
Alex Kavanagh 4f1b0fc09f Get the password from keystone, not glance for leader-settings. 2023-02-21 15:57:37 +00:00
Alex Kavanagh 120a495f6f Switch sync_deployed to zaza.model 2023-02-21 12:58:45 +00:00
Alex Kavanagh 59632ec6f9 Fix pep8 tests 2023-02-21 12:01:14 +00:00
Alex Kavanagh 7e626bcf86 Test the keystone rotate-service-user-password action
This test, added as part of the default keystone tests, tests that the
service user password can be rotated for the glance application.
2023-02-21 11:53:00 +00:00
Felipe Reyes 618fb7b6e9 Retry when checking ceph pool compression mode.
The compression mode after it's set via config-changed might take a
while to fully propagate to the whole cluster, hence the hook may be
done before the cluster is fully configured with the new compression
mode. This is more noticeable in the gate when there are many jobs
running in parallel.

This patch modes the check to its own method wrapped with a
tenacity.retry decorator to make the test more robust.

Closes #946
2023-02-20 11:31:45 -03:00
Felipe Reyes 2cd18b484d Replace assertEquals with assertEqual.
DeprecationWarning: Please use assertEqual instead.
2023-02-14 14:45:20 -03:00
Felipe Reyes 535275750e Add magnum section to tempest.conf template
The magnum section is used to declare configuration specific information
used by magnum-tempest-plugin

The keys used are:

- nic_id, to indicate the external network
- image_id, to indicate the fedora-coreos image to be used
- flavor_id, the flavor id to use when creating clusters
- dns_nameserver, the upstream dns server IP.
- network_driver, the network driver to test (flannel).
- labels, to pass a custom (local) image registry.
- insecure_registry, to mark the custom image registry as http (instead
  of https).
2023-02-14 14:45:20 -03:00
Felipe Reyes fa09a20b4b Add support for Magnum to use different images per release.
OpenStack Magnum relies on specific versions of Fedora CoreOS, this
patch addresses this maintaining a map of images per release according
to the upstream documentation[0]

The images are expected to be stored in the object store pointed out by
TEST_SWIFT_IP[1] environment variable in a container named 'magnum'. A
bash script to upload images can be found at
./zaza/openstack/charm_tests/magnum/upload_fedora_coreos_images.sh

[0] https://docs.openstack.org/magnum/latest/user/index.html#supported-versions
[1] https://github.com/openstack-charmers/zosci-config/pull/262
2023-02-14 14:45:11 -03:00
Corey Bryant d054d3e695 Add lunar and antelope identifiers for OpenStack 2023-02-02 16:07:08 -05:00
Felipe Reyes 46b53253db test_300_default_soa_config_option: Change logging statements from debug to info
This test is unstable, increasing the logging from debug to info allows
to the CI runs to expose more information and understand what part of
the test is staying blocked and leading the CI job to time out.

Related-Bug: http://pad.lv/2003775
2023-01-30 10:31:48 -03:00
coreycb a381f910c3 Merge pull request #983 from openstack-charmers/bug/ceph-tests-without-openstack
Migrate several Ceph test cases to not use the openstack base
2023-01-23 14:09:20 -05:00
Chris MacNaughton 1a529276df Migrate several Ceph test cases to not use the openstack base 2023-01-23 09:43:23 -05:00
Bas de Bruijne 9fb488efef Update series upgrade automation (#952)
* update series upgrade test

* bug fixes

* bug fixes
2023-01-23 12:39:10 +00:00
Liam Young 33edff6360 Revert "Test get-csr with existing CA (#974)"
This reverts commit 58f2b88365.
2023-01-16 20:40:32 +00:00
Felipe Reyes 8feaf396bd Merge pull request #980 from Basdbruijne/sqa_integration
Make network, images, and keypair names envars
2023-01-16 12:12:51 -03:00
Bas de Bruijne feb667206b make provider-router name variable 2023-01-11 15:39:15 +00:00
Liam Young bf2273c59a Add retry logic around Trilio CRUD commands (#770) 2023-01-11 15:36:59 +00:00
Bas de Bruijne d3c9be2f84 make network and image names variable 2023-01-11 15:34:02 +00:00
Liam Young 58f2b88365 Test get-csr with existing CA (#974)
Check that if an existing CA is present then get-csr requires the
force flag. Test using new action name regenerate-intermediate-ca
2023-01-11 15:19:40 +00:00
coreycb 41fbc20583 Add kinetic support (#977) 2023-01-11 15:18:01 +00:00
Alex Kavanagh 9ad7e55a5f Fix race in test 408 for rabbitmq
There is a race in the 408 test for rabbitmq where the config-change to
enable ssl causes a leader-settings-changed hook in the non-leader units
which results in a rabbitmq service restart.  This can happen at exactly
the same time as the test attempts to establish a connection with the
that unit. This patch retries the connection attempt.

Note that this may only be a partial fix as it's possible that a restart
will happen just after the connection is made, which would then result
in a test failure.

Related-Bug: LP#2002156
2023-01-06 20:12:08 +00:00
Martin Kalcok dadac36ccf Determine OVN leader/follower status based on cluster-status action. 2022-11-22 14:30:10 +01:00
Martin Kalcok 574d8d91d2 Merge remote-tracking branch 'upstream/master' into ovn-downscale 2022-11-22 12:59:49 +01:00
Chris MacNaughton d0193e3817 Add new required dns.nameservers config 2022-11-21 14:31:24 +00:00
Felipe Reyes d083dde10c Retry check of service IP configured (#970)
There are scenarios where the config-changed hook can complete, yet the
service IP get configured many seconds after, because a relation-changed
hook execution needs to be triggered on the hacluster side of the
relation.

This change adds a retry to the check (10 times with a 2 seconds wait
time).

This issue was found at the gate https://review.opendev.org/c/openstack/charm-designate-bind/+/861417
2022-10-28 16:30:26 +01:00
Peter Sabaini 74bca90a6f Ceph: also check ceph-mgr (#973)
In the ceph lowlevel test, also check for ceph-mgr process and
service.
2022-10-27 13:46:08 +02:00
coreycb c8ae6cdc55 Add retry decorator to masakari segment creation (#972)
The create_segment() function is often failing in the gate
due to being unable to establish a connection to the masakari
endpoint. This will allow some more time for the endpoint to
become available when this error occurs.
2022-10-27 13:19:34 +02:00
jneo8 db21233890 test(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Add HTTP metrics query check 2022-10-26 22:13:12 +08:00
jneo8 f079b9cddb fix(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Fix snap naming and configure to fit new snap release 2022-10-26 22:13:12 +08:00
jneo8 f39ea121a4 style(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Update docstring style 2022-10-26 22:13:12 +08:00
jneo8 788fd77137 test(zaza/openstack/charm_tests/mysql/test_prometheus_mysql_exporter.py): Add tests for mysql prometheus exporter 2022-10-26 22:13:12 +08:00
Martin Kalcok a0abb64826 Run update-status before searching for OVN leader 2022-10-24 11:49:12 +02:00
Martin Kalcok 570a9f1a57 Include fix for race condition when using wait_for_application_states
In some testing environment, `wait_for_application_states()` can
execute before juju starts actually performing changes on the
units, causing it to return immediately.
2022-10-21 14:29:55 +02:00
Liam Young 827d81fc12 Allow tempest to run in minimal mode (#956)
Add test class that runs tempest in miminal mode. This is useful
for testing that the OpenStack apis are responding but there are
components not configured like an external network. In addtion
some missing doc strings were added and support for neutron
tempest configuration pre ussuri removed as there is a branch
for that.
2022-10-20 11:18:04 +01:00
Corey Bryant 9eac7470a7 Update masakari test to launch jammy instance 2022-10-18 19:25:36 +00:00
Liam Young 89fd74c5db Add method to check OpenStack endpoints (#953)
* Add method to check OpenStack endpoints

Add method to check OpenStack endpoints are returning acceptable
http codes. This should be used with caution as a charm whould
indicate if its payload is not ready via workload status and
workload status messages

* Fix dox string
2022-10-14 12:59:26 +01:00
Martin Kalcok 9e72765731 Updated tests to add their own unit for destruction and added test for downscaling. 2022-10-13 04:41:36 +02:00
Chris MacNaughton 98a1c8948a [ceph] remove white-box testing migrated from amulet (#951) 2022-10-12 15:34:14 +01: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
Guilherme Maluf Balzana 98faf67846 Add glance-simplestreams-sync set_latest_property config functest (#853)
When creating Openstack VMs the user has to specify the image it wants
to use. sstream-mirror-glance adds a date to the image name, so they
always have to recheck which is the current latest image.

This commit tests the usage of the `set_latest_property` configuration.

When --set-latest-property is given sstream-mirror-glance will set the
recently synced image with the `latest=true` property and then remove
the `latest` property from all the os_version/architecture matching
images.

Closes-bug: LP #1933130
2022-10-07 18:35:36 +00:00
Billy Olsen 6fdccd680c Merge pull request #929 from hernandanielg/test-cloudkitty
Add test for cloudkitty charm
2022-10-05 15:14:41 -07: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