Add comprehensive tests for action precondition
This patch adds a new test suite
TestExecuteSkippedActionsthat validates the precondition checking logic for various Watcher actions. These tests ensure that actions are properly skipped when preconditions are not met (resulting inSKIPPEDstate withSUCCEEDEDaction plan) or fail appropriately when invalid parameters are provided (resulting inFAILEDstate for both action and action plan).The test suite covers 14 scenarios across 5 action types:
- https://docs.openstack.org/watcher/latest/actions/migrate.html
- https://docs.openstack.org/watcher/latest/actions/change_nova_service_state.html
- https://docs.openstack.org/watcher/latest/actions/resize.html
- https://docs.openstack.org/watcher/latest/actions/stop.html
- https://docs.openstack.org/watcher/latest/actions/volume_migration.html
All tests follow a consistent pattern using a helper method
execute_actions_and_validate_states()that:
- Creates audit templates and audits with custom actions
- Optionally executes pre-execution hooks (e.g., deleting resources)
- Executes action plans and waits for completion
- Validates expected action states and action plan final state
- Returns action details for additional verification
As this feature is not backported, skipped actions have to be excluded from 2025* and 2024* branches on watcher project zuul jobs definition
Change-Id: Ifaf9ed0b00d9a38031a824e0a11aa91b04e06ec4 Assisted-By: Claude Signed-off-by: morenod dsanzmor@redhat.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号