Commit Graph

16 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 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
Bas de Bruijne d3c9be2f84 make network and image names variable 2023-01-11 15:34:02 +00: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
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 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 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 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
Aurelien Lourot 83246a9305 Print stderr when failing to ping new instance 2020-04-14 14:50:31 +02:00
Chris MacNaughton a5b618d08b refactor tests a bit 2019-11-07 15:13:06 +08:00
Frode Nordahl b036e5d487 Allow passing userdata when launching instance (#22)
With help from ``cloud-init`` this allows a test author to tailor
guests for use in payload testing.
2019-06-21 09:02:03 +02:00
Chris MacNaughton dd434e281e Add zaza namespacing, starting with openstack 2019-04-25 17:46:03 +02:00