Commit Graph

53 Commits

Author SHA1 Message Date
Felipe Reyes 449164284f Fix version and nova_api_version data types declared in docstring 2023-08-25 12:44:30 -04:00
Felipe Reyes be6ba2a02b launch_instance: expose nova api version and target host
This change exposes two new parameters in the launch_instance()
function:

- nova_api_version: Set the microversion the novaclient should use.
- host: Request to launch the instance on a specific hypervisor host.
2023-08-24 19:38:11 -04:00
Dmitrii Shcherbakov 3e289d2f00 Use the name attribute of a unit
get_units returns a unit objects the name of which needs to be accessed
by using the .name attribute.
2023-06-21 03:09:00 +04:00
Dmitrii Shcherbakov 4b80d0db76 Add a workaround for LP: #2024481
Due to the race condition described in LP: #2024481, before adding
networks to the speaker we need to wait until it gets scheduled,
otherwise it may not advertise some routes that are attempted to be
advertised before the speaker is scheduled to a dragent service causing
a non-fatal service error.
2023-06-20 22:16:04 +04:00
Dmitrii Shcherbakov e6d215119e Be specific about a FIP to be checked in CP tests
The configure step for the DRAgent tests configures a name for a
floating IP to be checked for at the peer side. Since the data plane
tests add one as well for an instance, make sure the control plane-only
tests rely on the FIP that has a specific name. This can be useful if
the tests are run in a different order.
2023-06-17 14:59:03 +04:00
Dmitrii Shcherbakov 77aeb7300f Allow skipping instance connectivity checks
For the NDR data plane testing case those checks cannot be performed
from the node that runs Zaza and instead need to be performed from a
unit that receives dynamic routes from the BGP speaker.

In order to allow for that case an additional argument is introduced.
2023-06-15 06:50:53 +04: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
Dmitrii Shcherbakov c48c939859 Make net and subnet name customization optional
https://github.com/openstack-charmers/zaza-openstack-tests/commit/ad16b5a7fc3a0971b168b133fbf0b5cbd55115fd

ad16b5a7fc introduced an option to
customize network and subnet names, however, not all modules were
updated to pass it into the setup_sdn method. Specificatlly, the
dragent now breaks with a KeyError during the configure step.

(Pdb) network_config["project_net_name"]
*** KeyError: 'project_net_name'

https://github.com/openstack-charmers/zaza-openstack-tests/blob/fdaf43f52c31656e445561477a7b7c468a73b89a/zaza/openstack/charm_tests/dragent/configure.py#L35-L46
2023-05-24 17:03:36 +03: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
Bas de Bruijne d3c9be2f84 make network and image names variable 2023-01-11 15:34:02 +00: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
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
Nobuto Murata b07fd0b2dc Support LTS_IMAGE_NAME(jammy) in guest.launch_instance
Follow-up of #860 and #791 to fix:

 File "./zaza/openstack/charm_tests/test_utils.py", line 798, in launch_guest
   return configure_guest.launch_instance(
 File "./zaza/openstack/configure/guest.py", line 128, in launch_instance
   image_name = image_name or boot_tests[instance_key]['image_name']
KeyError: 'jammy'
2022-09-04 10:00:40 +09: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
Liam Young b829fae632 Fix VM retryer (#812)
I recently added an option to have zaza delete and relaunch a
guest if it failed to be provisioned or failed a connectivity
test. However, in the code to remove the an instance I
accidentaly called the method that checks that a resource has
gone and not the method that actually does the removal. This
patch fixes that. NOTE: Only the Trilio tests use this
retryer function atm
2022-07-05 12:37:28 +01:00
Liam Young 90915d9c8e Add launch_instance_retryer (#787)
Add a method called launch_instance_retryer which will attempt
to launch an instance. In the event that it fails the instance
will be removed and another attempt to launch an instance will
be attempted.
2022-06-15 14:41:37 +01:00
Frode Nordahl 7984d783fa Add undercloud_and_charm_setup configure step
The neutron ``basic_overcloud_network`` setup job performs both
undercloud and charm configuration prior to configuring the
overcloud network.  The undercloud and charm configuration steps
are useful outside the context of OpenStack Neutron.

Split undercloud and charm setup into a new configure step.
2022-04-26 11:48:33 +02:00
Frode Nordahl ba0dc0232d Support connectivity check without FIPs 2022-04-21 17:22:47 +02:00
Frode Nordahl ad16b5a7fc Make project network and subnet configurable 2022-04-21 16:03:54 +02:00
Frode Nordahl 3ec64703ed Support launch instance on external provider network
Allow launching an instance and attaching it directly to the
external provider network.  This is useful in its own right and
is also a requirement in order to successfully test some
configurations.
2022-04-21 16:03:48 +02:00
Billy Olsen c7e7443c63 Add vtpm functional tests
Add functional tests for vTPM enablement within guests.

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
2022-04-01 15:37:38 -07:00
Aurelien Lourot a0b4d15dc6 Remove deprecation warnings (#676)
Change-Id: I354d1a62c77aa1fa38f4be4615f264bc08f7795b
2021-11-29 09:27:06 +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
Aurelien Lourot eeebe68117 Increase timeout on instance creation
See https://bugs.launchpad.net/charm-nova-compute/+bug/1945991

Change-Id: I2e66e22258fce4b0fcd5443b104fad6a5a720b0b
2021-10-04 15:16:14 +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
Liam Young 0fe56cbc33 Switch pre_deploy_certs from OS_ to TEST_ vars 2020-07-03 10:48:12 +00:00
Liam Young 3a6002b61f Port aodh server alarm test from mojo
Port over the aodh alarm test from mojo. Mojo source is here: *1

*1: https://github.com/openstack-charmers/openstack-mojo-specs/blob/master/helper/tests/validate_aodh.py
2020-05-30 16:56:25 +00:00
Liam Young 8434827f5c Add methods for creating pre-deploy certs 2020-05-27 10:31:14 +00:00
Alex Kavanagh 215e5accef Add retries to instance pinging
It's a bit too optimistic to expect an instance to respond to the first
ping.  This patch gives the instance up to 8 retries with increasingly
lengthened waits to respond to a ping.  This should help with Juju
storage backed nova instances.

Fixes: #265
2020-05-17 21:19:14 +01:00
Liam Young 52ee23927c Make masakari wait longer for hosts to online
A recent functional test of masakari monitors failed due to a
tenacity retry missing the host coming online by 10s, so wait
longer. FWIW that this affects the post-test cleanup rather than
the test itself.

*1 https://openstack-ci-reports.ubuntu.com/artifacts/test_charm_pipeline_func_full/openstack/charm-masakari-monitors/726808/1/5655/consoleText.test_charm_func_full_8812.txt
`
2020-05-15 13:54:01 +00:00
Liam Young 9df7157989 Masakari testing fixes
* Add method for deleteing pacemaker nodes.
* Due to LP #1874719 use above to delete node1
* During test cleanup the tests re-enable hosts from a masakari pov,
  if that host still has outstanding notifications it will fail so
  retry the enable.
* pacemakerd process name has changed on focal so account for that
  when killing it.
2020-04-25 09:52:53 +00:00
Aurelien Lourot 8e9ecc53e8 Openstack -> OpenStack 2020-04-16 18:59:07 +02:00
Aurelien Lourot 83246a9305 Print stderr when failing to ping new instance 2020-04-14 14:50:31 +02:00
Liam Young 9a3a716f6f Remove rogue single quote 2020-03-12 06:42:14 +00:00
Liam Young f1168aa36d Fixes for masakari tests
* Deal with hypervisors now using fqdn
* Skip instant restart tests until bug is resolved
2020-03-10 10:21:14 +00:00
David Ames b5e250513b Fix for NDR testing race condition
Previous attempts to fix LP Bug#1784083 added a workaround (commit
820ed808) which is being removed here.

The root cause seems to be upstream in the dragent. It may never have
been envisioned to run the agent by itself the way the charm does.

So that even if neutron-api completes its amqp relation first,
neutron-dynamic-routing can still see
oslo_messaging.exceptions.MessagingTimeout errors. Some operation
must occur against neutron before dragent is truly ready. i.e. some post
deploy openstack command. So it is outside the purview of the charm.

This change adds a service restart late.

Partial-Bug: #1841459
2020-01-21 10:07:01 -08:00
Chris MacNaughton a5b618d08b refactor tests a bit 2019-11-07 15:13:06 +08:00
Frode Nordahl 675b109d54 Optionally limit number of units to get port attached
This is useful for validating deployments with OVN where it is not
required to have external networking attached to every chassis.

Any chassis that does not have external networking directly
attached will forward traffic destined for the external network
through a tunnel to a chassis that does.
2019-11-02 17:16:39 +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
David Ames addee58dd8 Do set DNS on overcloud subnets
It turns out we do need to set DNS on the overcloud subnet. It should be
the .2 of the CIDR under test and not the _admin_net's .2. There seems
there are security group rules in the way.
2019-10-22 16:12:26 -07:00
David Ames a207fea389 Stop setting external DNS
Use neutron DNS by not setting a DNS server on the subnet.
Also correct TEST_NAME_SERVER for potential future use.
2019-10-21 16:08:35 -07:00
Frode Nordahl 959d81370a Merge pull request #64 from gnuoy/aodh
Add support for aodh tests
2019-09-26 17:20:17 +02:00
Liam Young d7e2976f22 Merge pull request #62 from openstack-charmers/add_plumb_dataport
add plumb_dataport_method
2019-09-26 13:25:21 +01:00
Andrew McLeod 028602f365 change terminology from plumb 2019-09-26 13:47:19 +02:00
Liam Young 2a15116868 Add aodh api test 2019-09-25 17:44:14 +00:00
Andrew McLeod ab89054847 enable guest interface plumbing for bionic-queens and later 2019-09-25 16:08:20 +02:00
Andrew McLeod 19306d6600 WIP - add plumb_dataport_method 2019-09-24 16:25:53 +02:00
Liam Young 022102ab91 Add security actions 2019-09-24 08:19:19 +01:00
Liam Young 8b60351be5 Fix ceilometer action 2019-09-22 07:28:08 +01:00
Liam Young 274b644c95 First cut 2019-09-20 19:09:02 +01:00