-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Watcher Test Case #1101
Add Watcher Test Case #1101
Conversation
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.
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.
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.
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')
This simplifies when developing new tests and the programmer is not too familiar with the different attributes an object has.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; one minor comment on a docstring.
zaza/openstack/configure/guest.py
Outdated
:param host: Requested host to create servers | ||
:type host: str | ||
:param nova_api_version: Nova API version to use | ||
:type nova_api_version: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be:
:type nova_api_version: str | None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4491642 - this commit addresses this.
@freyes just pending a gerrit review that exercises this; please could you link one into the description for posterity' sake? |
this PR is being exercised by this gerrit review:
https://review.opendev.org/c/openstack/charm-watcher/+/891195
…On Fri, 2023-08-25 at 09:39 -0700, Alex Kavanagh wrote:
@freyes just pending a gerrit review that exercises this; please could you link one into the
description for posterity' sake?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This change expands the testing bundles to deploy a fully functional cloud and run the testing class WatcherTests which uses the vm_workload_consolidation strategy[0]. [0] https://docs.openstack.org/watcher/latest/strategies/basic-server-consolidation.html Func-Test-Pr: openstack-charmers/zaza-openstack-tests#1101 Change-Id: I5a1d9ef50ce16d553a06382e0825fcbb2d12e887
* Update charm-watcher from branch 'master' to 27c563dd5e90af4371a5124f7358b186a8a45d02 - Add zaza-openstack-tests testing. This change expands the testing bundles to deploy a fully functional cloud and run the testing class WatcherTests which uses the vm_workload_consolidation strategy[0]. [0] https://docs.openstack.org/watcher/latest/strategies/basic-server-consolidation.html Func-Test-Pr: openstack-charmers/zaza-openstack-tests#1101 Change-Id: I5a1d9ef50ce16d553a06382e0825fcbb2d12e887
This PR introduces a new test case for OpenStack Watcher which uses the vm_workload_consolidation strategy[0]
Used/verified by this gerrit review:
https://review.opendev.org/c/openstack/charm-watcher/+/891195
[0] https://docs.openstack.org/watcher/latest/strategies/basic-server-consolidation.html