Add config flags to control zone migration test execution

Add configuration checks to conditionally skip zone migration
tests that require specific setup or code. This allows
better control over which tests run in different CI environments.

Changes:
- Add run_zone_migration_extra_tests flag check to skip
  zone migration for instances without dst_node tests when disabled
- Add run_zone_migration_storage_tests flag check to skip
  storage-related zone migration tests when disabled

Generated-By: claude-code
Change-Id: I362a8c3e9edefe21e46e3836d5b86f151c5fb446
Signed-off-by: jgilaber <jgilaber@redhat.com>
This commit is contained in:
jgilaber
2025-12-02 14:42:53 +01:00
parent acd50f8569
commit 0b81f2b911
2 changed files with 19 additions and 0 deletions

View File

@@ -144,4 +144,15 @@ OptimizationGroup = [
"`watcher_cluster_data_model_collectors` period configuration is "
"less than 300 seconds."
),
cfg.BoolOpt(
"run_zone_migration_extra_tests",
default=False,
help="Whether or not to run extra zone migration tests that test"
"migration without specified destination nodes."
),
cfg.BoolOpt(
"run_zone_migration_storage_tests",
default=False,
help="Whether or not to run storage zone migration tests."
),
]

View File

@@ -81,6 +81,10 @@ class TestExecuteZoneMigrationStrategy(TestZoneMigrationStrategyBase):
@decorators.idempotent_id('e4f192ca-26d4-4e38-bb86-4be4aeaabb24')
@decorators.attr(type=['strategy', 'zone_migration'])
def test_execute_zone_migration_without_destination_host(self):
if not CONF.optimize.run_zone_migration_extra_tests:
raise self.skipException(
"Extra tests for zone migration are not enabled."
)
# This test requires metrics injection
self.check_min_enabled_compute_nodes(2)
self.addCleanup(self.wait_delete_instances_from_model)
@@ -116,6 +120,10 @@ class TestExecuteZoneMigrationStrategyVolume(TestZoneMigrationStrategyBase):
super().skip_checks()
if not CONF.service_available.cinder:
raise cls.skipException("Cinder is not available")
if not CONF.optimize.run_zone_migration_storage_tests:
raise cls.skipException(
"Storage tests for zone migration are not enabled."
)
def get_host_for_volume(self, volume_id):
"""Gets host of volume"""