From ded7b4dbe5a93baecad719fd6727698691456188 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 21 Jun 2024 07:16:06 +0200 Subject: [PATCH] test: fix test failure on ubuntu 24.04: "top: unknown option 'n'" (#9262) --- test/integration/smoke/test_service_offerings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_service_offerings.py b/test/integration/smoke/test_service_offerings.py index 62e39e195c2..c6a14a64471 100644 --- a/test/integration/smoke/test_service_offerings.py +++ b/test/integration/smoke/test_service_offerings.py @@ -1043,7 +1043,7 @@ class TestCpuCapServiceOfferings(cloudstackTestCase): #Get host CPU usage from top command before and after VM consuming 100% CPU find_pid_cmd = "ps -ax | grep '%s' | head -1 | awk '{print $1}'" % self.vm.id pid = ssh_host.execute(find_pid_cmd)[0] - cpu_usage_cmd = "top -b n 1 p %s | tail -1 | awk '{print $9}'" % pid + cpu_usage_cmd = "top -b -n 1 -p %s | tail -1 | awk '{print $9}'" % pid host_cpu_usage_before_str = ssh_host.execute(cpu_usage_cmd)[0] host_cpu_usage_before = round(float(host_cpu_usage_before_str))