[dts] [PATCH v2 5/9] tests/vf_to_vf_nic_bridge: use virt_common for VM creation

Herbert Guan herbert.guan at arm.com
Mon Feb 12 10:57:38 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_to_vf_bridge.cfg               | 6 +++++-
 tests/TestSuite_vf_to_vf_nic_bridge.py | 6 +++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/conf/vf_to_vf_bridge.cfg b/conf/vf_to_vf_bridge.cfg
index 537b3da..f9cc911 100644
--- a/conf/vf_to_vf_bridge.cfg
+++ b/conf/vf_to_vf_bridge.cfg
@@ -1,4 +1,4 @@
-# vm configuration for vhost sample case
+# Configuration sample: sriov_kvm.cfg
 [vm0]
 cpu =
     model=host,number=4,cpupin=20 21 22 23;
@@ -8,8 +8,10 @@ disk =
     file=/home/img/vm0.img;
 login =
     user=root,password=tester;
+# vnc option is not supported by libvirt yet, comment out below 2 lines if using libvirt
 vnc =
     displayNum=4;
+# daemon option is not supported by libvirt yet, comment out below 2 lines if using libvirt
 daemon =
     enable=yes;
 
@@ -22,7 +24,9 @@ disk =
     file=/home/img/vm1.img;
 login =
     user=root,password=tester;
+# vnc option is not supported by libvirt yet, comment out below 2 lines if using libvirt
 vnc =
     displayNum=5;
+# 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_to_vf_nic_bridge.py b/tests/TestSuite_vf_to_vf_nic_bridge.py
index a85cab5..356795a 100644
--- a/tests/TestSuite_vf_to_vf_nic_bridge.py
+++ b/tests/TestSuite_vf_to_vf_nic_bridge.py
@@ -39,7 +39,7 @@ import time
 import pdb
 
 from test_case import TestCase
-from qemu_kvm import QEMUKvm
+from virt_common import VM
 from pmd_output import PmdOutput
 
 VF_NUMS_ON_ONE_PF = 2
@@ -93,7 +93,7 @@ class TestVF2VFBridge(TestCase):
         vf0_prop = {'opt_host': self.sriov_vfs_ports[0].pci}
         vf1_prop = {'opt_host': self.sriov_vfs_ports[1].pci}
         time.sleep(1)
-        self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_to_vf_bridge')
+        self.vm0 = VM(self.dut, 'vm0', 'vf_to_vf_bridge')
         self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prop)
         try:
             self.vm0_dut = self.vm0.start()
@@ -102,7 +102,7 @@ class TestVF2VFBridge(TestCase):
         except Exception as e:
             print utils.RED(str(e))
 
-        self.vm1 = QEMUKvm(self.dut, 'vm1', 'vf_to_vf_bridge')
+        self.vm1 = VM(self.dut, 'vm1', 'vf_to_vf_bridge')
         self.vm1.set_vm_device(driver=self.vf_assign_method, **vf1_prop)
         try:
             self.vm1_dut = self.vm1.start()
-- 
1.8.3.1



More information about the dts mailing list