Add config dict dataplane_podified_services

Method reset_node_service uses "grep" to find the name of the services
that tests restart with systemctl. We have identified some scenarios
where this is not valid. Due to that, this patch adds a configurable
dictionary with the name of those services. If a service is not
included in this dictionary, the grep method is used.

Closes-Bug: #2095404

Change-Id: I131207361e093deb02f71d98a69602f4368a6413
This commit is contained in:
Eduardo Olivares 2025-01-17 10:54:24 +01:00
parent c644e48d61
commit 46e40755d4
2 changed files with 12 additions and 2 deletions

View File

@ -203,5 +203,12 @@ WhiteboxNeutronPluginOptions = [
cfg.IntOpt('servers_count',
default=12,
help='How many tenant VMs should be tested when many needed '
'(default value meant for cirros image).')
'(default value meant for cirros image).'),
cfg.DictOpt('dataplane_podified_services',
default={'ovn controller': 'edpm_ovn_controller',
'ovn metadata agent': 'edpm_ovn_metadata_agent',
'ovs vswitchd': 'ovs-vswitchd'},
help='configurable names for dataplane services running on '
'podified setups')
]

View File

@ -581,7 +581,10 @@ class BaseTempestWhiteboxTestCase(base.BaseTempestTestCase):
def reset_node_service(cls, service_alias, ssh_client,
wait_until_active=True, timeout=30):
host_ip = ssh_client.host
service_name = ssh_client.exec_command(
service_name = (None if WB_CONF.openstack_type != 'podified'
else WB_CONF.dataplane_podified_services.get(
service_alias))
service_name = service_name or ssh_client.exec_command(
"systemctl list-unit-files --type service | grep {}.service | "
"cut -d' ' -f1".format(
service_alias.replace(" ", ".*"))).strip()