From b0e46fc16af7f282bac90764d005b62ec7eaffc4 Mon Sep 17 00:00:00 2001 From: Roman Safronov Date: Wed, 14 Aug 2024 14:33:04 +0300 Subject: [PATCH] Use 'oc exec' when retrieving ovsdb command string It was found that sometimes an unexpected output returned when using 'oc rsh' on attempt to get ovsdb command string from db pod. This was causing an AssertingError and a test failure. Compared to 'oc rsh' the issue does not happen when using 'oc exec' command. Also running ps in the background using setsid helps to avoid sporadic errors due to [1]. [1] https://github.com/kubevirt/kubevirt/issues/10240 Change-Id: I77530691613ca352ce5e5650b3a2450a7003f459 --- whitebox_neutron_tempest_plugin/tests/scenario/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/whitebox_neutron_tempest_plugin/tests/scenario/base.py b/whitebox_neutron_tempest_plugin/tests/scenario/base.py index 963db95..cdc6881 100644 --- a/whitebox_neutron_tempest_plugin/tests/scenario/base.py +++ b/whitebox_neutron_tempest_plugin/tests/scenario/base.py @@ -1243,11 +1243,13 @@ class BaseTempestTestCaseOvn(BaseTempestWhiteboxTestCase): command_items.append('--db="{}"'.format(all_db_addresses)) # obtain the ovsdb-server command running on this pod - # `|| true` added to prevent the following issue: + # setsid added to prevent the following issue: # https://github.com/kubevirt/kubevirt/issues/10240 + # `||true` ensures a safe exit. cmd = ' '.join((cls.OC, - 'rsh', + 'exec', db_pod, + '-- setsid', 'ps -o command -C ovsdb-server --no-headers -ww', '|| true')) ovsdb_server_cmd = cls.proxy_host_client.exec_command(cmd)