aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/QemuUtils.py
AgeCommit message (Collapse)AuthorFilesLines
2019-04-07FIX: Qemu set affinity bugPeter Mikus1-39/+30
Change-Id: If1df58628b2150b1ea3f2f56b1e3d442176b0750 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-03-20CSIT-1386 KernelVM - Part IIPeter Mikus1-74/+186
- Implementation of KernelVM (ThinVM) - nf_density tests for KernelVM with VPP as VNF. Change-Id: Ife5c2e1ab419c55cbcd442792f940db3a41da471 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-03-18CSIT-1386 KernelVM - Part IPeter Mikus1-435/+330
- Refactor QemuUtils Full refactor of QemuUtils to prepare for thinner VMs. Change-Id: I171ba11a9e6e9faec582bd58df6819598b0ed0b5 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2019-03-04Rename to Constants.pyVratko Polak1-1/+1
Motivation: Make the constants available also for Robot. Restraint: Robotframework user guide says: Because variable files are always imported using a file system path, creating them as classes has some restrictions: Python classes must have the same name as the module they are located. Change-Id: I638ef3fe045db132e366de2e2699638b8637e45e Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2019-01-10VPP_Device - add baseline tests - part IIa)Jan Gelety1-2/+5
CSIT-1372 Add following baseline tests to VPP_Device: - ip4 eth2p-ethip4-ip4base-eth-2vhost-1vm-dev - ip6 eth2p-ethip6-ip6base-eth-2vhost-1vm-dev - l2bd eth2p-eth-l2bdbasemaclrn-eth-2vhost-1vm-dev - l2xc eth2p-eth-l2xcbase-eth-2vhost-1vm-dev + fix doc strings in all vpp_device tests Change-Id: Icc5ed801f3e8f6dedaa611779bd86fc20102fa74 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2019-01-02VHOST vectors.Peter Mikus1-4/+7
Change-Id: I5e17c5ab5cb99af0ac3d063ffc911bf95457d3e4 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-09-26Fix jumbo framesTibor Frank1-1/+1
Change-Id: I8aa557fe75133d20eef9832e314357af71f1d19a Signed-off-by: Tibor Frank <tifrank@cisco.com>
2018-08-20Refactor VHOST codePeter Mikus1-291/+239
CSIT-1164 Create VM vhost tests for 2-node topology CSIT-1173 Implement VM vhost KWs for 2-node topology - Cleanup QemuUtils.py Library (PEP8, some TODOs, readability, multi queue, ring size, qemu version detection) - Cleanup VHOST KWs perf (Unify running QEMU on N-node topology) - Add ability to configure Queues, Hyperthreading, automatically compute number of CPU for VM/Testpmd and RXQ for Testpmd workload. - Partial cleanup of configuration KWs (l2xc, l2bd) for 2-node - Create IPv4 2-node KW Change-Id: I8aae1355bafa651de715cd438fe706c443ea1d88 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-05-04Fix various pylint 1.5.4 warningsVratko Polak1-2/+2
+ DUTSetup.py:424 Else clause on loop without a break statement + InterfaceUtil.py:400 Else clause on loop without a break statement + QemuUtils.py:564 Wrong continued indentation + SetupDPDKTest.py: Locally enabling broad-except + VatExecutor.py: Catching too general exception Exception + ssh.py:95 No exception type(s) specified. + HTTPRequest.py: Tolerate HTTPCodes.OK + multiple: Drop ":returns: None" from docstrings. There are still several warnings present: - R0902(too-many-instance-attributes) - R0912(too-many-branches) - R0913(too-many-arguments) - R0914(too-many-locals) - R0915(too-many-statements) - R0401(cyclic-import) And there are multiple blocks of similar lines, mainly across various Setup*Test.py files: - R0801(duplicate-code) Change-Id: I582575cb52b85d69d268e6374852f6e74bb71052 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2018-04-25Fix warnings reported by gen_doc.shVratko Polak1-11/+12
+ Docstring warnings fixed. + Multiline param descriptions indented by 4 spaces. - Except the PacketVerifier.py one - I have tried several quote-like blocks, nothing works. - Rst warnings not fixed. - How can I fix them? They refer to temporarily created files. + Other improvements: + Python lines no longer than 80 characters. + :return: -> :returns: + Notes before params. + :raises + closing colon after exception class. + Description is a sentence. + Present tense in conditional sentences. + Bumped copyright year in edited files. Change-Id: I462c194eeecb666dc146e26858486a07c990be9b Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2018-03-26Optimize Qemu installation to speed up vhost testsPeter Mikus1-0/+4
Currently Qemu is being installed if there is a change of qsz parameter between tests/suites. Qemu is installed always into the same directory. This patch changes the default behavior to install qemu over and install pathced version to separate directory. It also disables force install. Change-Id: I0d7493a02b026a6ae4a5ea8bacf54656de9db567 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-03-20Add max-pkt-len parameter to dpdk testpmd startTibor Frank1-3/+10
Change-Id: I114c187f007c10223502669c2ba85c63d09cd84a Signed-off-by: Tibor Frank <tifrank@cisco.com>
2018-02-23FIX: Qemu path overridePeter Mikus1-8/+12
Currently there is bug that Qemu path is not correctly composed and cannot be properly overriden due to race condition in code. This patch is fixing functions to properly work with path. Change-Id: I276458d2d23c7a14441a4de4a56eff6431242ab9 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2018-01-10add new topology parameter: archGabriel Ganne1-4/+9
if unset, arch variable will default to "x86_64" * Note on "arm64" vs "aarch64" debian-based uses arm64 rhel-based uses aarch64 qemu binaries of both distribs uses aarch64 dpdk uses arm64 vpp uses aarch64 python machine modules uses aarch64 => prefer aarch64 to use the same nomenclature as vpp * add ARCH argument to: init_dpdk.sh, install_dpdk.sh, run_l2fwd.sh, install_tldk.sh, run_tldk.sh. default to x86_64 converts "aarch64" if needed for dpdk naming convention * fixed terminal end detection to allow "~]# " add dut node arch as param to all robot set bin calls * add --target-list flag to qemu_build.sh defaults to x86_64-softmmu * add arch flag to all the topology files * topologies/available/ (and example file) * resources/tools/virl/topologies/ * set _qemu_bin path using node['arch'] in qemu_set_node() Change-Id: If46d88d064d213d3e4c6fc584bb8e0d4b6428cb8 Signed-off-by: Gabriel Ganne <gabriel.ganne@enea.com>
2018-01-02FIX: Force kill QEMU in case of failed initializationPeter Mikus1-7/+6
Change-Id: Ib9c243b1bd379cf33a2b7747b7f97a8533000d60 Signed-off-by: Peter Mikus <pmikus@cisco.com>
2017-12-12More reliable connection with nested qemu image.Thomas F Herbert1-2/+16
Under some circumstances on a busy server, the qga channel between the host and hte virtual guest has some garbage characters that cause the communications to fail. This has been seen on Centos 7.4 on a slow or busy server. This change sends a flush to qemu guest via the qga socket at 5 second intervals until there is a non empty response from guest before sending a guest ping. Change-Id: I6f21c205b289169aee9d6a4072ad4e6bafafa76f Signed-off-by: Thomas F Herbert <therbert@redhat.com>
2017-05-05Use 'Qemu Kill All' in perf test teardownJan Gelety1-1/+1
- replace 'Qemu Kill' KW by 'Qemu Kill All' - use self.qemu_kill_all() in case of qemu_start(self) failure Change-Id: I19d4c64d5daef4f00548344d45f0d4943ca4f7e8 Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-05-02csit-validate-pylint-master/3731 for build 3731jan.hradil1-0/+5
pylint repairs deleted duplicated method from HcPersistence.py Change-Id: I426e6c15957c995ea10bd11ae2deac75b1cab922 Signed-off-by: jan.hradil <jan.hradil@pantheon.tech>
2017-04-25Vhost testsMatej Klotton1-8/+21
Change-Id: I03722afe13722941e084bc01161f7c2af30e3cb1 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2017-04-09CSIT-441 vhost - Parametrized qemu installpmikus1-5/+17
Update the current QEMU installation script with option to override QEMU installation and to apply additional patches. Additional patches are applied from qemu_patches directory and subdir for specific QEMU version by run-parts. This means that all patches for particular version are applied. All keywords for build QEMU are updated. Change-Id: I0c874a96ac828dff657ee33eb87d88a8854128ad Signed-off-by: pmikus <pmikus@cisco.com>
2017-04-07CSIT-553 Make QEMU bin configurablepmikus1-4/+12
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>
2017-03-27CSIT-547: Add x520 L2BD perf test with 2 VMs per DUTJan Gelety1-20/+24
- 10ge2p1x520-eth-l2bdbasemaclrn-eth-4vhost-2vm-ndrpdrdisc Change-Id: If65a7cf21d1dbff88f39f319877d9ac1fc5d959e Signed-off-by: Jan Gelety <jgelety@cisco.com>
2017-03-08CSIT-530: Add common setup and teardown to perf testsTibor Frank1-0/+1
Change-Id: I2e76de710b4b758eac1d24d447a9c5938f937385 Signed-off-by: Tibor Frank <tifrank@cisco.com>
2017-02-23QemuUtil lib change to work with ubuntu and centosMatej Klotton1-9/+17
- replace nc to socat for comunicating with qemu QGA - change disk type to use virtio driver - add check to bind only network interface for testpmd Change-Id: I19ab16cbd8fec1ec78263ccfb1309a144e5af845 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2017-02-16CSIT-514: Kill Qemu when it does not respondTibor Frank1-2/+2
Change-Id: Id13c7fd51e693a273637c80cb35a159434be4826 Signed-off-by: Tibor Frank <tifrank@cisco.com>
2016-12-21Fix: Qemu wait_until_vm_bootpmikus1-1/+1
There is an issue that booting Nested VM is successful but QGA guest-ping or flush returns partial response. This fix suppose to do checking until an error or timeout occurs. In case of QGA returns correct response it is success. In case of partial response it will log an error and continue in checking. Change-Id: Idb2c5e5ea54bfc1e118ff62dd15696a1797dfdd9 Signed-off-by: pmikus <pmikus@cisco.com>
2016-12-14Fix: Qemu wait_until_vm_bootPeter Mikus1-9/+18
There is an issue that booting Nested VM is successful but QGA guest-ping returns partial response. This fix suppose to do checking until an error or timeout occurs. In case of QGA returns correct response it is success. In case of partial response it will log an error and continue in checking. Change-Id: I8a2469287abaa9398a9206988e579912840f20c4 Signed-off-by: pmikus <pmikus@cisco.com>
2016-12-08CSIT-494 Add multi-queue support for Qemupmikus1-5/+7
Add multi-queue support when starting qemu. Full implementation will be following in near future. Change-Id: I743bbde67254b26a4e4e98072bad57dde728845a Signed-off-by: pmikus <pmikus@cisco.com>
2016-12-02Fix: Reading huge pages information during Qemu startpmikus1-13/+82
Reading information from sysfs or proc files is randomly failing returning empty string without any error. This fix suppose to add the retries to read the hugepages information multiple times and raise exception if reading failed. Change-Id: I7c88504765c39b11c81f7a8e77e5b0e32b7225fe Signed-off-by: pmikus <pmikus@cisco.com>
2016-11-16CSIT-470 Add option to configure CFS scheduler priority for QEMUpmikus1-0/+16
Add option to configure CFS scheduler priority for QEMU Change-Id: I76da7f536e70a23a57cf5215ab60002f95532b19 Signed-off-by: pmikus <pmikus@cisco.com>
2016-10-24CSIT-452: Switch Qemu binary to Ubuntu defaultpmikus1-1/+1
- Switch Qemu binary to default path and remove building qemu in performance jobs Change-Id: I5e8bb510beb672d034699192a7c454c56f2d2581 Signed-off-by: pmikus <pmikus@cisco.com>
2016-10-04Fix pylint warnings in python librariesselias1-18/+24
- no functional changes - fixes 80+ PEP-8 violations Change-Id: Icf414778ec40d5cb44364fa69a876f9a1870c3c7 Signed-off-by: selias <samelias@cisco.com>
2016-08-17CSIT-312 VPP vhost-user - VPP vhost-user driver, virtio in VMpmikus1-42/+32
- Add libraries and keywords to control Qemu VM and VMapp Change-Id: Iaaedfe240afe394f507ccaf0cf7a77c8b863acd3 Signed-off-by: pmikus <pmikus@cisco.com>
2016-08-04CSIT-337 Improve Qemu affinity settingpmikus1-11/+21
Improve Qemu affinity setting by getting the list of Qemu thread IDs via QMP and pin each thread PID to specific host core by taskset. Change-Id: I1b0ee8d8425cf1f97b16d6761fff0be2fadc44a8 Signed-off-by: pmikus <pmikus@cisco.com>
2016-08-03CSIT-217 Hugepage configuration on physical LF testbedspmikus1-1/+50
If Qemu requires more Hugepages than availbale in system it fails to start. This patch is aimed to add option to configure more hugepages needed. Default behavior is to fail to start if amount of hugepages is lower then required. Change-Id: I64bd8a5ec5bfa559676035c23001b12d00b026a5 Signed-off-by: pmikus <pmikus@cisco.com>
2016-07-27CSIT-212: FIX: Weekly job gets stucked in 2nd FUNCT test attemptMatej Klotton1-1/+1
- remove mem-prealloc parameter from qemu options Change-Id: I5a75f53da970c4aa772f29ed49bbf25c07bf2d87 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-07-15CSIT-206 Adjust qemu runtime optionspmikus1-7/+22
- Modify runtime optimization of qemu process in qemu library - Add ballon=none - Add option to set affinity - Add mem-prealloc - Add vhost extend options Change-Id: I721557d3e38599d783dfe0773f0593a250f8fae7 Signed-off-by: pmikus <pmikus@cisco.com>
2016-05-23Add temporary fix for CSIT-90 by flushing QGA's input bufferCarsten Koester1-0/+16
This is not a final fix. The final fix SHOULD send a "guest-sync" request as per" http://wiki.qemu.org/Features/QAPI/GuestAgent#QEMU_Guest_Agent_Protocol However, this temporary fix will eliminate the nested VM startup failures triggered by the nested VM's guest-agent receiving a partial guest-ping request. Change-Id: Ice409b7c966a527b03cb71c042b476e1771676d0 Signed-off-by: Carsten Koester <ckoester@cisco.com>
2016-05-09QEMU VM guest-ping fixMatus Fabian1-1/+4
JIRA: CSIT-62 Change-Id: I0affda16af8f983895c50fbc306f45f30fbb69cd Signed-off-by: Matus Fabian <matfabia@cisco.com>
2016-04-22Reformat python libraries.Matej Klotton1-3/+5
PEP8 reformat fix typos docstrings reformat Change-Id: Ic48ba4e06490630808b8e2ab1ab0b046ec7eeed7 Signed-off-by: Matej Klotton <mklotton@cisco.com>
2016-04-15Update Qemu libraryMatus Fabian1-7/+49
Incorporated changes from nested VM on VIRL. Change-Id: I76ceeb2dde635c2cf0d3a53d29bf24fed72a5437 Signed-off-by: Matus Fabian <matfabia@cisco.com>
2016-03-24Setup and run QEMU VMMatus Fabian1-2/+358
Change-Id: I22640caa9f13be09d2a837c6332d7b86cef77efc Signed-off-by: Matus Fabian <matfabia@cisco.com>
2016-03-11Add KW to build QEMU 2.2.1 on nodeMatus Fabian1-0/+40
Change-Id: I58271aff1ef558752f00593bbad5c3317d08288d Signed-off-by: Matus Fabian <matfabia@cisco.com>