[dts] [PATCH v1 7/8] tests/vf_packet_rxtx: use virt_common for VM creation
Herbert Guan
herbert.guan at arm.com
Fri Feb 9 07:26:04 CET 2018
Use 'VM' form virt_common instead of 'QEMUKvm' from qemu_kvm for VM
creation. This will allow VM type selection (kvm/libvirt etc.) for
each VM defined in test suite's config file.
Signed-off-by: Herbert Guan <herbert.guan at arm.com>
---
conf/vf_packet_rxtx.cfg | 44 ++++++++++++++++++++++++++++++++++++++-
tests/TestSuite_vf_packet_rxtx.py | 8 +++----
2 files changed, 47 insertions(+), 5 deletions(-)
diff --git a/conf/vf_packet_rxtx.cfg b/conf/vf_packet_rxtx.cfg
index adf7919..20a1feb 100644
--- a/conf/vf_packet_rxtx.cfg
+++ b/conf/vf_packet_rxtx.cfg
@@ -2,6 +2,15 @@
# name
# name: vm0
#
+# virt_type
+# virt_type: [ KVM | LIBVIRT ]
+#
+# os
+# loader: /path/to/loader/file.fd
+# note: applicable for libvirt only
+# nvram: /path/to/nvram/file.fd
+# note: applicable for libvirt only
+#
# enable_kvm
# enable: [yes | no]
#
@@ -15,9 +24,17 @@
#
# mem
# size: 1024
+# note: Set VM memory size in MB
#
# disk
# file: /path/to/image/test.img
+# opt_format: [ raw | qcow2 | ... ]
+# opt_bus: [ virtio | scsi | ... ]
+# note: applicable for libvirt only
+# opt_dev: [ sda | sdb | vda | ... ]
+# note: applicable for libvirt only
+# opt_controller: [ virtio-scsi | ...]
+# note: applicable for libvirt only
#
# net
# type: [nic | user | tap | bridge | ...]
@@ -63,13 +80,14 @@
# prop_addr: 0x3
#
# monitor
-# port: 6061
+# port: 6061
# note: if adding monitor to vm, need to specicy
# this port, else it will get a free port
# on the host machine.
#
# serial_port
# enable: [yes | no]
+# opt_type: [pty | unix]
#
# vnc
# displayNum: 1
@@ -83,35 +101,59 @@
# vm configuration for pmd sriov case
[vm0]
+# Default virt_type is KVM
+#virt_type =
+# virt_type=LIBVIRT;
+# os option is applicable for libvirt only
+#os =
+# loader=/usr/share/AAVMF/AAVMF_CODE.fd,nvram=/var/lib/libvirt/qemu/nvram/DTSVM_VARS.fd;
cpu =
model=host,number=4,cpupin=5 6 7 8;
disk =
file=/home/image/sriov-fc20-1.img;
+# Example for libvirt:
+# file=/var/lib/libvirt/images/DTSVM.qcow2,opt_format=qcow2,opt_bus=scsi,opt_dev=sda,opt_controller=virtio-scsi;
login =
user=root,password=tester;
+# net option is not necessary for libvirt, comment out below 2 lines if using libvirt
net =
type=nic,opt_vlan=0;
type=user,opt_vlan=0;
+# monitor option is not supported by libvirt yet, comment out below 2 lines if using libvirt
monitor =
port=;
+# vnc option is not supported by libvirt yet, comment out below 2 lines if using libvirt
vnc =
displayNum=1;
+# daemon option is not supported by libvirt yet, comment out below 2 lines if using libvirt
daemon =
enable=yes;
[vm1]
+# Default virt_type is KVM
+#virt_type =
+# virt_type=LIBVIRT;
+# os option is applicable for libvirt only
+#os =
+# loader=/usr/share/AAVMF/AAVMF_CODE.fd,nvram=/var/lib/libvirt/qemu/nvram/DTSVM1_VARS.fd;
cpu =
model=host,number=4,cpupin=9 10 11 12;
disk =
file=/home/image/sriov-fc20-2.img;
+# Example for libvirt:
+# file=/var/lib/libvirt/images/DTSVM1.qcow2,opt_format=qcow2,opt_bus=scsi,opt_dev=sda,opt_controller=virtio-scsi;
login =
user=root,password=tester;
+# net option is not necessary for libvirt, comment out below 2 lines if using libvirt
net =
type=nic,opt_vlan=1;
type=user,opt_vlan=1;
+# monitor option is not supported by libvirt yet, comment out below 2 lines if using libvirt
monitor =
port=;
+# vnc option is not supported by libvirt yet, comment out below 2 lines if using libvirt
vnc =
displayNum=2;
+# daemon option is not supported by libvirt yet, comment out below 2 lines if using libvirt
daemon =
enable=yes;
diff --git a/tests/TestSuite_vf_packet_rxtx.py b/tests/TestSuite_vf_packet_rxtx.py
index 3312e05..63f4820 100644
--- a/tests/TestSuite_vf_packet_rxtx.py
+++ b/tests/TestSuite_vf_packet_rxtx.py
@@ -3,7 +3,7 @@
import re
import time
-from qemu_kvm import QEMUKvm
+from virt_common import VM
from test_case import TestCase
from pmd_output import PmdOutput
@@ -73,7 +73,7 @@ class TestVfPacketRxtx(TestCase):
self.host_testpmd.start_testpmd("1S/5C/1T", "", eal_param=eal_param)
# set up VM0 ENV
- self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_packet_rxtx')
+ self.vm0 = VM(self.dut, 'vm0', 'vf_packet_rxtx')
self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop)
self.vm0.set_vm_device(driver=self.vf_assign_method, **vf1_prop)
self.vm_dut_0 = self.vm0.start()
@@ -195,14 +195,14 @@ class TestVfPacketRxtx(TestCase):
self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
# set up VM0 ENV
- self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_packet_rxtx')
+ self.vm0 = VM(self.dut, 'vm0', 'vf_packet_rxtx')
self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop)
self.vm0.set_vm_device(driver=self.vf_assign_method, **vf1_prop)
self.vm_dut_0 = self.vm0.start()
if self.vm_dut_0 is None:
raise Exception("Set up VM0 ENV failed!")
# set up VM1 ENV
- self.vm1 = QEMUKvm(self.dut, 'vm1', 'vf_packet_rxtx')
+ self.vm1 = VM(self.dut, 'vm1', 'vf_packet_rxtx')
self.vm1.set_vm_device(driver=self.vf_assign_method, **vf2_prop)
self.vm_dut_1 = self.vm1.start()
if self.vm_dut_1 is None:
--
1.8.3.1
More information about the dts
mailing list