Always run background snat ping test from VM

When the check_or_start_background_vm_ping function is called with an
ssh_client, it means the background ping test has to be executed from
a VM instance, not from a pod, regardless of the
run_background_services_in_pod value.

Change-Id: Ie4dbc7f3799d42ab2016f29ccbc01afe38791a97
This commit is contained in:
Eduardo Olivares 2025-04-07 18:12:01 +02:00
parent 96e4901eb5
commit c2bc120b59

@ -190,14 +190,19 @@ class TripleoTopology(rhosp.RhospTopology):
"name: '%s'", node.name) "name: '%s'", node.name)
return subgroups return subgroups
def check_or_start_background_vm_ping(self, server_ip): def check_or_start_background_vm_ping(
if CONF.tobiko.tripleo.run_background_services_in_pod: self,
server_ip: typing.Union[str, netaddr.IPAddress],
ssh_client: ssh.SSHClientType = None):
if (not ssh_client and
CONF.tobiko.tripleo.run_background_services_in_pod):
# this fails if `oc` (openshift client) is not available # this fails if `oc` (openshift client) is not available
# so, if `run_background_services_in_pod` is true, make sure # so, if `run_background_services_in_pod` is true, make sure
# `oc` is available # `oc` is available
_openshift.check_or_start_tobiko_ping_command(server_ip) _openshift.check_or_start_tobiko_ping_command(server_ip)
else: else:
tripleo_nova.check_or_start_background_vm_ping(server_ip) tripleo_nova.check_or_start_background_vm_ping(
server_ip, ssh_client=ssh_client)
def check_or_start_background_iperf_connection( def check_or_start_background_iperf_connection(
self, self,