From 9b193b8c2561c2a92fadef3eead8709d5fe3dc4b Mon Sep 17 00:00:00 2001 From: Shirisha G Date: Wed, 14 Feb 2024 10:56:32 +0530 Subject: [PATCH] Fixed smt.py and cpu_fold.py stop testcases cpu_fold and smt stop testcases are not killing properly. So added support to kill the process properly Signed-off-by: Shirisha G --- workload/cpu_fold.py | 4 ++-- workload/smt.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/workload/cpu_fold.py b/workload/cpu_fold.py index f9b0a937d..e08d76624 100644 --- a/workload/cpu_fold.py +++ b/workload/cpu_fold.py @@ -52,8 +52,8 @@ def test_cpu_stop(self): Kill the CPU workload """ self.grep_cmd = "grep -i {}".format("cpu.sh") - self.process_kill = 'ps aux | {} | awk "{{ print $2 }}" | \ - xargs kill'.format(self.grep_cmd) + self.awk_cmd = "awk '{print $2}'" + self.process_kill = "ps aux | {} | {} | head -1 | xargs kill".format(self.grep_cmd, self.awk_cmd) process.run(self.process_kill, ignore_status=True, sudo=True, shell=True) self.log.info("CPU Workload killed successfully--!!") diff --git a/workload/smt.py b/workload/smt.py index 9b31c630f..72d15c3ec 100644 --- a/workload/smt.py +++ b/workload/smt.py @@ -65,8 +65,8 @@ def test_smt_stop(self): Kill the SMT workload """ grep_cmd = "grep -i {}".format("smt.sh") - process_kill = 'ps aux | {} | awk "{{ print $2 }}" | \ - xargs kill'.format(grep_cmd) + awk_cmd = "awk '{print $2}'" + process_kill = "ps aux | {} | {} | head -1 | xargs kill".format(grep_cmd, awk_cmd) process.run(process_kill, ignore_status=True, sudo=True, shell=True) self.log.info("SMT Workload killed successfully--!!")