aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpmikus <pmikus@cisco.com>2017-04-05 09:35:05 +0200
committerMatej Klotton <mklotton@cisco.com>2017-04-07 08:01:55 +0000
commitffd596f616dc9a65e113b25ba72b00ce6dd42a7b (patch)
treeec1c21921188a62b627d60347972d8b6dc123a94
parent0b7283e206789dc8864d15f255cc9677de0b3d97 (diff)
CSIT-553 Make QEMU bin configurable
Add option to set path for QEMU binary and make it configurable in perf testaces as global variable. Change-Id: I95f4b1ab790b576f1eca02ccdb86f7a6ced80630 Signed-off-by: pmikus <pmikus@cisco.com>
-rw-r--r--resources/libraries/python/QemuUtils.py16
-rw-r--r--resources/libraries/robot/performance.robot18
-rw-r--r--tests/perf/__init__.robot6
3 files changed, 29 insertions, 11 deletions
diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py
index 675f074570..f926d63caf 100644
--- a/resources/libraries/python/QemuUtils.py
+++ b/resources/libraries/python/QemuUtils.py
@@ -26,10 +26,10 @@ from resources.libraries.python.topology import NodeType
class QemuUtils(object):
"""QEMU utilities."""
- __QEMU_BIN = '/usr/bin/qemu-system-x86_64'
-
def __init__(self, qemu_id=1):
self._qemu_id = qemu_id
+ # Path to QEMU binary
+ self._qemu_bin = '/usr/bin/qemu-system-x86_64'
# QEMU Machine Protocol socket
self._qmp_sock = '/tmp/qmp{0}.sock'.format(self._qemu_id)
# QEMU Guest Agent socket
@@ -69,8 +69,16 @@ class QemuUtils(object):
self._node = None
self._socks = [self._qmp_sock, self._qga_sock]
+ def qemu_set_bin(self, path):
+ """Set binary path for QEMU.
+
+ :param path: Absolute path in filesystem.
+ :type path: str
+ """
+ self._qemu_bin = path
+
def qemu_set_smp(self, cpus, cores, threads, sockets):
- """Set SMP option for QEMU
+ """Set SMP option for QEMU.
:param cpus: Number of CPUs.
:param cores: Number of CPU cores on one socket.
@@ -520,7 +528,7 @@ class QemuUtils(object):
# Run QEMU
cmd = '{0} {1} {2} {3} {4} {5} {6} {7} {8} {9}'.format(
- self.__QEMU_BIN, self._qemu_opt.get('smp'), mem, ssh_fwd,
+ self._qemu_bin, self._qemu_opt.get('smp'), mem, ssh_fwd,
self._qemu_opt.get('options'),
drive, qmp, serial, qga, graphic)
(ret_code, _, stderr) = self._ssh.exec_command_sudo(cmd, timeout=300)
diff --git a/resources/libraries/robot/performance.robot b/resources/libraries/robot/performance.robot
index 707b266d5e..47c43d2a5c 100644
--- a/resources/libraries/robot/performance.robot
+++ b/resources/libraries/robot/performance.robot
@@ -1689,6 +1689,7 @@
| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
+| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
@@ -1697,8 +1698,8 @@
| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
| | Run keyword | ${vm_name}.Qemu Set Scheduler Policy
| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4
-| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True} | pmd_txd=${256}
-| | ... | pmd_rxd=${256}
+| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True}
+| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
| | Return From Keyword | ${vm}
| '${nr}' Guest VMs with dpdk-testpmd connected via vhost-user is setup in a 3-node circular topology
@@ -1765,6 +1766,7 @@
| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
+| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
@@ -1773,8 +1775,8 @@
| | Run keyword | ${vm_name}.Qemu Set Affinity | @{qemu_cpus}
| | Run keyword | ${vm_name}.Qemu Set Scheduler Policy
| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f | eal_mem_channels=4
-| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True} | pmd_txd=${256}
-| | ... | pmd_rxd=${256}
+| | ... | pmd_fwd_mode=io | pmd_disable_hw_vlan=${True}
+| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
| | Return From Keyword | ${vm}
| Guest VM with dpdk-testpmd-mac connected via vhost-user is setup
@@ -1825,6 +1827,7 @@
| | ... | skip_cnt=${skip_cnt} | cpu_cnt=${count} | smt_used=${False}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
+| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
@@ -1835,7 +1838,7 @@
| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f
| | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac}
| | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True}
-| | ... | pmd_txd=${256} | pmd_rxd=${256}
+| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
| | Return From Keyword | ${vm}
| '${nr}' Guest VMs with dpdk-testpmd-mac connected via vhost-user is setup in a 3-node circular topology
@@ -1909,6 +1912,7 @@
| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
+| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
@@ -1919,7 +1923,7 @@
| | Dpdk Testpmd Start | ${vm} | eal_coremask=0x1f
| | ... | eal_mem_channels=4 | pmd_fwd_mode=mac | pmd_eth_peer_0=0,${eth0_mac}
| | ... | pmd_eth_peer_1=1,${eth1_mac} | pmd_disable_hw_vlan=${True}
-| | ... | pmd_txd=${256} | pmd_rxd=${256}
+| | ... | pmd_txd=${perf_qemu_qsz} | pmd_rxd=${perf_qemu_qsz}
| | Return From Keyword | ${vm}
| Guest VM with Linux Bridge connected via vhost-user is setup
@@ -1952,6 +1956,7 @@
| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${False}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
+| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
@@ -1998,6 +2003,7 @@
| | ... | skip_cnt=${skip} | cpu_cnt=${count} | smt_used=${True}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock1}
| | Run keyword | ${vm_name}.Qemu Add Vhost User If | ${sock2}
+| | Run keyword | ${vm_name}.Qemu Set Bin | ${perf_qemu_bin}
| | Run keyword | ${vm_name}.Qemu Set Node | ${dut_node}
| | Run keyword | ${vm_name}.Qemu Set Smp | ${count} | ${count} | 1 | 1
| | Run keyword | ${vm_name}.Qemu Set Mem Size | 2048
diff --git a/tests/perf/__init__.robot b/tests/perf/__init__.robot
index 845716780f..107892685c 100644
--- a/tests/perf/__init__.robot
+++ b/tests/perf/__init__.robot
@@ -29,12 +29,16 @@
| | ... | Setup suite Variables. Variables are used across performance testing.
| | ...
| | ... | _NOTE:_ This KW sets following suite variables:
-| | ... | - perf_trial_duration - Duration of traffic run [s].
+| | ... | - perf_trial_duration - Duration of traffic run [s]
| | ... | - perf_pdr_loss_acceptance - Loss acceptance treshold
| | ... | - perf_pdr_loss_acceptance_type - Loss acceptance treshold type
| | ... | - perf_vm_image - Guest VM disk image
+| | ... | - perf_qemu_bin - Path to QEMU binary
+| | ... | - perf_qemu_qsz - QEMU virtio queue size
| | ...
| | Set Global Variable | ${perf_trial_duration} | 10
| | Set Global Variable | ${perf_pdr_loss_acceptance} | 0.5
| | Set Global Variable | ${perf_pdr_loss_acceptance_type} | percentage
| | Set Global Variable | ${perf_vm_image} | /var/lib/vm/csit-nested-1.6.img
+| | Set Global Variable | ${perf_qemu_bin} | /usr/bin/qemu-system-x86_64
+| | Set Global Variable | ${perf_qemu_qsz} | 256