From 0fff346db8336498bbefc3d443363d1e016032c6 Mon Sep 17 00:00:00 2001 From: Pablo Saavedra Date: Fri, 24 Jan 2025 22:49:48 +0100 Subject: [PATCH] ci: TestUtils.py: Fix process matching in ssh_force_kill method * Updated `pgrep` to use the `-f` option for matching the full command line instead of just the process name. * Ensures more reliable process identification, especially for cases where only part of the command line matches the specified text. --- .ci/robot_framework/libs/TestUtils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/robot_framework/libs/TestUtils.py b/.ci/robot_framework/libs/TestUtils.py index 849527e..28d6292 100755 --- a/.ci/robot_framework/libs/TestUtils.py +++ b/.ci/robot_framework/libs/TestUtils.py @@ -62,7 +62,7 @@ def ssh_command_in_background(self, ip, command): def ssh_force_kill(self, ip, text): """Force kill all related process.""" print(f"RUN: Killing all '{text}' related processes ...") - command = f"pgrep {text} && pgrep {text} | xargs kill -9 || echo '{text} not running'" + command = f"pgrep -f {text} && pgrep -f {text} | xargs kill -9 || echo '{text} not running'" return self.ssh_command(ip, command, quiet=True) def ssh_reboot_force_reboot(self, ip):