[dts] [PATCH v2 8/9] tests/vf_jumboframe: use virt_common for VM creation

Herbert Guan herbert.guan at arm.com
Mon Feb 12 10:57:41 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_jumboframe.cfg           | 12 +++++++++++-
 tests/TestSuite_vf_jumboframe.py |  4 ++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/conf/vf_jumboframe.cfg b/conf/vf_jumboframe.cfg
index 94e68b4..a73e427 100644
--- a/conf/vf_jumboframe.cfg
+++ b/conf/vf_jumboframe.cfg
@@ -1,11 +1,21 @@
+# Configuration sample: sriov_kvm.cfg
 [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=/storage/vm-image/vm0.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;
-vnc = 
+vnc =
     displayNum=1;
+# 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_jumboframe.py b/tests/TestSuite_vf_jumboframe.py
index 78a43cd..dfafbd4 100644
--- a/tests/TestSuite_vf_jumboframe.py
+++ b/tests/TestSuite_vf_jumboframe.py
@@ -4,7 +4,7 @@ import re
 import time
 
 import utils
-from qemu_kvm import QEMUKvm
+from virt_common import VM
 from test_case import TestCase
 from pmd_output import PmdOutput
 from settings import HEADER_SIZE
@@ -111,7 +111,7 @@ class TestVfJumboFrame(TestCase):
             vf_popt = {'opt_host': self.sriov_vfs_port[0].pci}
 
             # set up VM ENV
-            self.vm = QEMUKvm(self.dut, 'vm0', 'vf_jumboframe')
+            self.vm = VM(self.dut, 'vm0', 'vf_jumboframe')
             self.vm.set_vm_device(driver=self.vf_assign_method, **vf_popt)
             self.vm_dut = self.vm.start()
             if self.vm_dut is None:
-- 
1.8.3.1



More information about the dts mailing list