Fix octavia services test on jobs with networker nodes

On OSP deployments that use networker nodes, such as composable or
upgrade, some Octavia services run on the networker nodes instead
of the controller nodes.

So far, the method _start_octavia_main_services tried to start all
octavia services for each node, because of a typo.

This patch fixes the issue by making sure that for each node, only the
stopped Octavia services will be rerun.

Change-Id: Icaa50052435628d0c977c8acf9d183ec9312479a
This commit is contained in:
Omer 2022-08-01 18:03:27 +02:00 committed by Eduardo Olivares
parent 757da8c052
commit a3d3c41017
1 changed files with 9 additions and 6 deletions

View File

@ -121,7 +121,7 @@ class OctaviaServicesFaultTest(testtools.TestCase):
self._stop_octavia_main_services(services_to_stop)
finally:
self._start_octavia_main_services()
self._start_octavia_main_services(services_to_stop)
def _get_services_to_stop(self) -> dict:
"""Return the running octavia services on controller & networker nodes.
@ -226,7 +226,7 @@ class OctaviaServicesFaultTest(testtools.TestCase):
if attempt.is_last:
raise
def _start_octavia_main_services(self):
def _start_octavia_main_services(self, services_to_stop: dict):
"""Start the octavia services.
@ -236,10 +236,13 @@ class OctaviaServicesFaultTest(testtools.TestCase):
It then sends traffic to validate the Octavia's functionality
"""
for ssh_client in self.ssh_clients:
sh.start_systemd_units(*octavia.OCTAVIA_SERVICES,
ssh_client=ssh_client,
sudo=True)
for service, ssh_clients in services_to_stop.items():
for ssh_client in ssh_clients:
sh.start_systemd_units(service,
ssh_client=ssh_client,
sudo=True)
LOG.debug(f'We started {service} on {ssh_client.host}')
octavia.check_members_balanced(
pool_id=self.listener_stack.pool_id,