From 05f108f9bf0a036565af444f5ae709dc12ac2967 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Mon, 12 Feb 2018 14:20:45 +0000 Subject: trex: Tests with T-Rex in VM Patch introduces a set of testcases with T-Rex running inside VM. JIRA: VSPERF-560 Change-Id: I5b0a0220a2d72428ae1210ee9590d39abdfb9c1d Signed-off-by: Martin Klozik Signed-off-by: RadoslawX Glombiowski Reviewed-by: Al Morton Reviewed-by: Christian Trautman Reviewed-by: Sridhar Rao --- vnfs/qemu/qemu.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'vnfs/qemu') diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py index 8e3d44de..a0128f44 100644 --- a/vnfs/qemu/qemu.py +++ b/vnfs/qemu/qemu.py @@ -222,7 +222,13 @@ class IVnfQemu(IVnf): stdin=proc.stdout) proc.wait() - for cpu in range(0, int(S.getValue('GUEST_SMP')[self._number])): + # calculate the number of CPUs in SMP topology specified by GUEST_SMP + # e.g. "sockets=2,cores=3", "4", etc. + cpu_nr = 1 + for i in re.findall(r'\d', S.getValue('GUEST_SMP')[self._number]): + cpu_nr = cpu_nr * int(i) + # pin each GUEST's core to host core based on configured BINDING + for cpu in range(0, cpu_nr): match = None guest_thread_binding = S.getValue('GUEST_THREAD_BINDING')[self._number] if guest_thread_binding is None: -- cgit 1.2.3-korg