mirror of https://github.com/apache/cloudstack.git
test: fix test failure on ubuntu 24.04: "top: unknown option 'n'" (#9262)
This commit is contained in:
parent
5ab23cd9c9
commit
ded7b4dbe5
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Reference in New Issue