Skip to content

[stable/antelope] Add watcher tests - #1449

Open
xtrusia wants to merge 9 commits into
openstack-charmers:stable/antelopefrom
xtrusia:watcher-tests-stable-antelope
Open

xtrusia wants to merge 9 commits into
openstack-charmers:stable/antelopefrom
xtrusia:watcher-tests-stable-antelope

Conversation

@xtrusia

@xtrusia xtrusia commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Backport the watcher functional test support from master (#1101) to stable/antelope, so the charm-watcher stable/2023.1 branch can run its watcher tests.

This is #1175 rebased onto the current stable/antelope. The only conflict was in launch_instance(): it keeps the branch default userdata or get_default_userdata() and adds the new host argument.

pep8 and py3 unit tests pass locally.

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.

(cherry picked from commit fd82476)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
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.

(cherry picked from commit 3283ed4)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
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.

(cherry picked from commit be6ba2a)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
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')

(cherry picked from commit 11c3f80)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
This simplifies when developing new tests and the programmer is not too
familiar with the different attributes an object has.

(cherry picked from commit 55b3145)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
This test launches 1 instance per hypervisor, and then launches a new
audit to optimize the use of hypervisors and consolidate the instances
in a single hypervisor, but also disabling the nova-compute service to
avoid new instances get allocated.

(cherry picked from commit 6787c84)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
(cherry picked from commit 1d42b64)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
(cherry picked from commit 4491642)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
(cherry picked from commit b087c0c)
Signed-off-by: Seyeong Kim <seyeong.kim@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants