test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH v1 0/8] use virt_common for VM creation
@ 2018-02-09  6:25 Herbert Guan
  2018-02-09  6:25 ` [dts] [PATCH v1 1/8] tests/vf_macfilter: " Herbert Guan
                   ` (8 more replies)
  0 siblings, 9 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:25 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

This patch series adds support of using libvirt as VM type for a set
of vf test suites.  It 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.

Herbert Guan (8):
  tests/vf_macfilter: use virt_common for VM creation
  tests/vf_jumboframe: use virt_common for VM creation
  tests/vf_offload: use virt_common for VM creation
  tests/vf_rss: use virt_common for VM creation
  tests/vf_to_vf_nic_bridge: use virt_common for VM creation
  tests/vf_vlan: use virt_common for VM creation
  tests/vf_packet_rxtx: use virt_common for VM creation
  tests/vf_port_start_stop: use virt_common for VM creation

 conf/vf_jumboframe.cfg                 | 111 ++++++++++++++++++++++++++++++
 conf/vf_macfilter.cfg                  |  30 ++++++++
 conf/vf_offload.cfg                    |  32 ++++++++-
 conf/vf_packet_rxtx.cfg                |  44 +++++++++++-
 conf/vf_port_start_stop.cfg            |  32 ++++++++-
 conf/vf_rss.cfg                        |  30 ++++++++
 conf/vf_to_vf_bridge.cfg               | 121 +++++++++++++++++++++++++++++++++
 conf/vf_vlan.cfg                       | 111 ++++++++++++++++++++++++++++++
 tests/TestSuite_vf_jumboframe.py       |   4 +-
 tests/TestSuite_vf_macfilter.py        |   4 +-
 tests/TestSuite_vf_offload.py          |   4 +-
 tests/TestSuite_vf_packet_rxtx.py      |   8 +--
 tests/TestSuite_vf_port_start_stop.py  |   4 +-
 tests/TestSuite_vf_rss.py              |   4 +-
 tests/TestSuite_vf_to_vf_nic_bridge.py |   6 +-
 tests/TestSuite_vf_vlan.py             |   4 +-
 16 files changed, 526 insertions(+), 23 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 1/8] tests/vf_macfilter: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
@ 2018-02-09  6:25 ` Herbert Guan
  2018-02-09  6:25 ` [dts] [PATCH v1 2/8] tests/vf_jumboframe: " Herbert Guan
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:25 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_macfilter.cfg           | 30 ++++++++++++++++++++++++++++++
 tests/TestSuite_vf_macfilter.py |  4 ++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/conf/vf_macfilter.cfg b/conf/vf_macfilter.cfg
index ddf3168..1f5388b 100644
--- a/conf/vf_macfilter.cfg
+++ b/conf/vf_macfilter.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 | ...]
@@ -70,6 +87,7 @@
 #
 # serial_port
 #       enable: [yes | no]
+#       opt_type: [pty | unix]
 #
 # vnc
 #       displayNum: 1
@@ -83,18 +101,30 @@
 
 # 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/img/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;
diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py
index 23105a4..f0de169 100644
--- a/tests/TestSuite_vf_macfilter.py
+++ b/tests/TestSuite_vf_macfilter.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
 
@@ -71,7 +71,7 @@ class TestVfMacFilter(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_macfilter')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_macfilter')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 2/8] tests/vf_jumboframe: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
  2018-02-09  6:25 ` [dts] [PATCH v1 1/8] tests/vf_macfilter: " Herbert Guan
@ 2018-02-09  6:25 ` Herbert Guan
  2018-02-11 10:07   ` Liu, Yong
  2018-02-09  6:26 ` [dts] [PATCH v1 3/8] tests/vf_offload: " Herbert Guan
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:25 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_jumboframe.cfg           | 111 +++++++++++++++++++++++++++++++++++++++
 tests/TestSuite_vf_jumboframe.py |   4 +-
 2 files changed, 113 insertions(+), 2 deletions(-)

diff --git a/conf/vf_jumboframe.cfg b/conf/vf_jumboframe.cfg
index 94e68b4..52d8c33 100644
--- a/conf/vf_jumboframe.cfg
+++ b/conf/vf_jumboframe.cfg
@@ -1,11 +1,122 @@
+# QEMU options
+# 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]
+#
+# cpu
+#       model: [host | core2duo | ...]
+#           usage:
+#               choose model value from the command
+#                   qemu-system-x86_64 -cpu help
+#       number: '4' #number of vcpus
+#       cpupin: '3 4 5 6' # host cpu list
+#
+# 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 | ...]
+#           nic
+#               opt_vlan: 0
+#                   note: Default is 0.
+#               opt_macaddr: 00:00:00:00:01:01
+#                   note: if creating a nic, it`s better to specify a MAC,
+#                         else it will get a random number.
+#               opt_model:["e1000" | "virtio" | "i82551" | ...]
+#                   note: Default is e1000.
+#               opt_name: 'nic1'
+#               opt_addr: ''
+#                   note: PCI cards only.
+#               opt_vectors:
+#                   note: This option currently only affects virtio cards.
+#           user
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
+#                   note: If not specified, it will be setted automatically.
+#           tap
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_br: br0
+#                   note: if choosing tap, need to specify bridge name,
+#                         else it will be br0.
+#               opt_script: QEMU_IFUP_PATH
+#                   note: if not specified, default is self.QEMU_IFUP_PATH.
+#               opt_downscript: QEMU_IFDOWN_PATH
+#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
+#
+# device
+#       driver: [pci-assign | virtio-net-pci | ...]
+#           pci-assign
+#               prop_host: 08:00.0
+#               prop_addr: 00:00:00:00:01:02
+#           virtio-net-pci
+#               prop_netdev: mynet1
+#               prop_id: net1
+#               prop_mac: 00:00:00:00:01:03
+#               prop_bus: pci.0
+#               prop_addr: 0x3
+#
+# monitor
+#       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
+#           note: you can choose a number not used on the host.
+#
+# daemon
+#       enable: 'yes'
+#           note:
+#               By default VM will start with the daemonize status.
+#               Not support starting it on the stdin now.
+
+# 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=/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 = 
     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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 3/8] tests/vf_offload: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
  2018-02-09  6:25 ` [dts] [PATCH v1 1/8] tests/vf_macfilter: " Herbert Guan
  2018-02-09  6:25 ` [dts] [PATCH v1 2/8] tests/vf_jumboframe: " Herbert Guan
@ 2018-02-09  6:26 ` Herbert Guan
  2018-02-09  6:26 ` [dts] [PATCH v1 4/8] tests/vf_rss: " Herbert Guan
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:26 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_offload.cfg           | 32 ++++++++++++++++++++++++++++++--
 tests/TestSuite_vf_offload.py |  4 ++--
 2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/conf/vf_offload.cfg b/conf/vf_offload.cfg
index 5820660..ade67c6 100644
--- a/conf/vf_offload.cfg
+++ b/conf/vf_offload.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 | ...]
@@ -70,6 +87,7 @@
 #
 # serial_port
 #       enable: [yes | no]
+#       opt_type: [pty | unix]
 #
 # vnc
 #       displayNum: 1
@@ -83,20 +101,30 @@
 
 # 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=4 5 6 7; 
 disk =
     file=/home/image/sriov-fc23-1.img;
-mem =
-    size=4096;
+# 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=11;
+# 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_offload.py b/tests/TestSuite_vf_offload.py
index 69ee592..cb4b368 100644
--- a/tests/TestSuite_vf_offload.py
+++ b/tests/TestSuite_vf_offload.py
@@ -5,7 +5,7 @@ import time
 import string
 
 import utils
-from qemu_kvm import QEMUKvm
+from virt_common import VM
 from test_case import TestCase
 from pmd_output import PmdOutput
 from utils import RED, GREEN
@@ -73,7 +73,7 @@ class TestVfOffload(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_offload')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_offload')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 4/8] tests/vf_rss: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
                   ` (2 preceding siblings ...)
  2018-02-09  6:26 ` [dts] [PATCH v1 3/8] tests/vf_offload: " Herbert Guan
@ 2018-02-09  6:26 ` Herbert Guan
  2018-02-09  6:26 ` [dts] [PATCH v1 5/8] tests/vf_to_vf_nic_bridge: " Herbert Guan
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:26 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_rss.cfg           | 30 ++++++++++++++++++++++++++++++
 tests/TestSuite_vf_rss.py |  4 ++--
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/conf/vf_rss.cfg b/conf/vf_rss.cfg
index 8e6025f..31c9204 100644
--- a/conf/vf_rss.cfg
+++ b/conf/vf_rss.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 | ...]
@@ -70,6 +87,7 @@
 #
 # serial_port
 #       enable: [yes | no]
+#       opt_type: [pty | unix]
 #
 # vnc
 #       displayNum: 1
@@ -83,18 +101,30 @@
 
 # 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=8,cpupin=5 6 7 8 9 10 11 12 ;
 disk =
     file=/home/image/fedora23-ok.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;
diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py
index 33591b5..f2730e7 100644
--- a/tests/TestSuite_vf_rss.py
+++ b/tests/TestSuite_vf_rss.py
@@ -44,7 +44,7 @@ reta_lines = []
 # and collect the hash result of five tuple and the queue id.
 from test_case import TestCase
 from pmd_output import PmdOutput
-from qemu_kvm import QEMUKvm
+from virt_common import VM
 
 class TestVfRss(TestCase):
 
@@ -262,7 +262,7 @@ class TestVfRss(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_rss')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_rss')
             self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prot)
 
             self.vm_dut_0 = self.vm0.start()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 5/8] tests/vf_to_vf_nic_bridge: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
                   ` (3 preceding siblings ...)
  2018-02-09  6:26 ` [dts] [PATCH v1 4/8] tests/vf_rss: " Herbert Guan
@ 2018-02-09  6:26 ` Herbert Guan
  2018-02-09  6:26 ` [dts] [PATCH v1 6/8] tests/vf_vlan: " Herbert Guan
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:26 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_to_vf_bridge.cfg               | 121 +++++++++++++++++++++++++++++++++
 tests/TestSuite_vf_to_vf_nic_bridge.py |   6 +-
 2 files changed, 124 insertions(+), 3 deletions(-)

diff --git a/conf/vf_to_vf_bridge.cfg b/conf/vf_to_vf_bridge.cfg
index 537b3da..fee104a 100644
--- a/conf/vf_to_vf_bridge.cfg
+++ b/conf/vf_to_vf_bridge.cfg
@@ -1,28 +1,149 @@
+# QEMU options
+# 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]
+#
+# cpu
+#       model: [host | core2duo | ...]
+#           usage:
+#               choose model value from the command
+#                   qemu-system-x86_64 -cpu help
+#       number: '4' #number of vcpus
+#       cpupin: '3 4 5 6' # host cpu list
+#
+# 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 | ...]
+#           nic
+#               opt_vlan: 0
+#                   note: Default is 0.
+#               opt_macaddr: 00:00:00:00:01:01
+#                   note: if creating a nic, it`s better to specify a MAC,
+#                         else it will get a random number.
+#               opt_model:["e1000" | "virtio" | "i82551" | ...]
+#                   note: Default is e1000.
+#               opt_name: 'nic1'
+#               opt_addr: ''
+#                   note: PCI cards only.
+#               opt_vectors:
+#                   note: This option currently only affects virtio cards.
+#           user
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
+#                   note: If not specified, it will be setted automatically.
+#           tap
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_br: br0
+#                   note: if choosing tap, need to specify bridge name,
+#                         else it will be br0.
+#               opt_script: QEMU_IFUP_PATH
+#                   note: if not specified, default is self.QEMU_IFUP_PATH.
+#               opt_downscript: QEMU_IFDOWN_PATH
+#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
+#
+# device
+#       driver: [pci-assign | virtio-net-pci | ...]
+#           pci-assign
+#               prop_host: 08:00.0
+#               prop_addr: 00:00:00:00:01:02
+#           virtio-net-pci
+#               prop_netdev: mynet1
+#               prop_id: net1
+#               prop_mac: 00:00:00:00:01:03
+#               prop_bus: pci.0
+#               prop_addr: 0x3
+#
+# monitor
+#       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
+#           note: you can choose a number not used on the host.
+#
+# daemon
+#       enable: 'yes'
+#           note:
+#               By default VM will start with the daemonize status.
+#               Not support starting it on the stdin now.
+
 # vm configuration for vhost sample 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=20 21 22 23;
 mem =
     size=6144,hugepage=yes;
 disk =
     file=/home/img/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 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;
 
 [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=30 31 32 33;
 mem =
     size=6144,hugepage=yes;
 disk =
     file=/home/img/vm1.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;
+# 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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 6/8] tests/vf_vlan: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
                   ` (4 preceding siblings ...)
  2018-02-09  6:26 ` [dts] [PATCH v1 5/8] tests/vf_to_vf_nic_bridge: " Herbert Guan
@ 2018-02-09  6:26 ` Herbert Guan
  2018-02-09  6:26 ` [dts] [PATCH v1 7/8] tests/vf_packet_rxtx: " Herbert Guan
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:26 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_vlan.cfg           | 111 +++++++++++++++++++++++++++++++++++++++++++++
 tests/TestSuite_vf_vlan.py |   4 +-
 2 files changed, 113 insertions(+), 2 deletions(-)

diff --git a/conf/vf_vlan.cfg b/conf/vf_vlan.cfg
index 94e68b4..31ddbc9 100644
--- a/conf/vf_vlan.cfg
+++ b/conf/vf_vlan.cfg
@@ -1,11 +1,122 @@
+# QEMU options
+# 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]
+#
+# cpu
+#       model: [host | core2duo | ...]
+#           usage:
+#               choose model value from the command
+#                   qemu-system-x86_64 -cpu help
+#       number: '4' #number of vcpus
+#       cpupin: '3 4 5 6' # host cpu list
+#
+# 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 | ...]
+#           nic
+#               opt_vlan: 0
+#                   note: Default is 0.
+#               opt_macaddr: 00:00:00:00:01:01
+#                   note: if creating a nic, it`s better to specify a MAC,
+#                         else it will get a random number.
+#               opt_model:["e1000" | "virtio" | "i82551" | ...]
+#                   note: Default is e1000.
+#               opt_name: 'nic1'
+#               opt_addr: ''
+#                   note: PCI cards only.
+#               opt_vectors:
+#                   note: This option currently only affects virtio cards.
+#           user
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
+#                   note: If not specified, it will be setted automatically.
+#           tap
+#               opt_vlan: 0
+#                   note: default is 0.
+#               opt_br: br0
+#                   note: if choosing tap, need to specify bridge name,
+#                         else it will be br0.
+#               opt_script: QEMU_IFUP_PATH
+#                   note: if not specified, default is self.QEMU_IFUP_PATH.
+#               opt_downscript: QEMU_IFDOWN_PATH
+#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
+#
+# device
+#       driver: [pci-assign | virtio-net-pci | ...]
+#           pci-assign
+#               prop_host: 08:00.0
+#               prop_addr: 00:00:00:00:01:02
+#           virtio-net-pci
+#               prop_netdev: mynet1
+#               prop_id: net1
+#               prop_mac: 00:00:00:00:01:03
+#               prop_bus: pci.0
+#               prop_addr: 0x3
+#
+# monitor
+#       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
+#           note: you can choose a number not used on the host.
+#
+# daemon
+#       enable: 'yes'
+#           note:
+#               By default VM will start with the daemonize status.
+#               Not support starting it on the stdin now.
+
 [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 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;
diff --git a/tests/TestSuite_vf_vlan.py b/tests/TestSuite_vf_vlan.py
index c0b26a3..da9330d 100644
--- a/tests/TestSuite_vf_vlan.py
+++ b/tests/TestSuite_vf_vlan.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
 from packet import Packet, sniff_packets, load_sniff_packets
@@ -114,7 +114,7 @@ class TestVfVlan(TestCase):
             vf1_prop = {'opt_host': self.sriov_vfs_port_1[0].pci}
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_vlan')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_vlan')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 7/8] tests/vf_packet_rxtx: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
                   ` (5 preceding siblings ...)
  2018-02-09  6:26 ` [dts] [PATCH v1 6/8] tests/vf_vlan: " Herbert Guan
@ 2018-02-09  6:26 ` Herbert Guan
  2018-02-09  6:26 ` [dts] [PATCH v1 8/8] tests/vf_port_start_stop: " Herbert Guan
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
  8 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:26 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v1 8/8] tests/vf_port_start_stop: use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
                   ` (6 preceding siblings ...)
  2018-02-09  6:26 ` [dts] [PATCH v1 7/8] tests/vf_packet_rxtx: " Herbert Guan
@ 2018-02-09  6:26 ` Herbert Guan
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
  8 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-09  6:26 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_port_start_stop.cfg           | 32 +++++++++++++++++++++++++++++++-
 tests/TestSuite_vf_port_start_stop.py |  4 ++--
 2 files changed, 33 insertions(+), 3 deletions(-)

diff --git a/conf/vf_port_start_stop.cfg b/conf/vf_port_start_stop.cfg
index 8576404..9840e86 100644
--- a/conf/vf_port_start_stop.cfg
+++ b/conf/vf_port_start_stop.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,20 +101,32 @@
 
 # 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 9; 
 disk =
     file=/home/image/fedora23.img;
+# Example for libvirt:
+#    file=/var/lib/libvirt/images/DTSVM.qcow2,opt_format=qcow2,opt_bus=scsi,opt_dev=sda,opt_controller=virtio-scsi;
 mem =
     size=8196
 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=11;
+# 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_port_start_stop.py b/tests/TestSuite_vf_port_start_stop.py
index 3ebee73..a9e88d8 100644
--- a/tests/TestSuite_vf_port_start_stop.py
+++ b/tests/TestSuite_vf_port_start_stop.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
 from utils import RED, GREEN
@@ -180,7 +180,7 @@ class TestVfPortStartStop(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_port_start_stop')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_port_start_stop')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [dts] [PATCH v1 2/8] tests/vf_jumboframe: use virt_common for VM creation
  2018-02-09  6:25 ` [dts] [PATCH v1 2/8] tests/vf_jumboframe: " Herbert Guan
@ 2018-02-11 10:07   ` Liu, Yong
  0 siblings, 0 replies; 21+ messages in thread
From: Liu, Yong @ 2018-02-11 10:07 UTC (permalink / raw)
  To: dts

Hi Herbert,
Now pass-through parameters are using prefix "opt_". And it is redundant 
to list same thing in all configuration files.
I think you can just use one line like "configuration sample: 
sriov_kvm.cfg". Thus only need  to maintain one correct sample file.

Regards,
Marvin

On 02/09/2018 02:25 PM, Herbert Guan wrote:
> +# device
> +#       driver: [pci-assign | virtio-net-pci | ...]
> +#           pci-assign
> +#               prop_host: 08:00.0
> +#               prop_addr: 00:00:00:00:01:02
> +#           virtio-net-pci
> +#               prop_netdev: mynet1
> +#               prop_id: net1
> +#               prop_mac: 00:00:00:00:01:03
> +#               prop_bus: pci.0
> +#               prop_addr: 0x3
> +#

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 0/9] use virt_common for VM creation
  2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
                   ` (7 preceding siblings ...)
  2018-02-09  6:26 ` [dts] [PATCH v1 8/8] tests/vf_port_start_stop: " Herbert Guan
@ 2018-02-12  9:57 ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 1/9] tests/sriov_kvm: " Herbert Guan
                     ` (9 more replies)
  8 siblings, 10 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

This patch series adds support of using libvirt as VM type for a set
of vf test suites.  It 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.


Herbert Guan (9):
  tests/sriov_kvm: use virt_common for VM creation
  tests/vf_port_start_stop: use virt_common for VM creation
  tests/vf_packet_rxtx: use virt_common for VM creation
  tests/vf_vlan: use virt_common for VM creation
  tests/vf_to_vf_nic_bridge: use virt_common for VM creation
  tests/vf_rss: use virt_common for VM creation
  tests/vf_offload: use virt_common for VM creation
  tests/vf_jumboframe: use virt_common for VM creation
  tests/vf_macfilter: use virt_common for VM creation

 conf/sriov_kvm.cfg                     | 79 ++++++++++++++++++++++++++-
 conf/vf_jumboframe.cfg                 | 12 ++++-
 conf/vf_macfilter.cfg                  | 97 +++++-----------------------------
 conf/vf_offload.cfg                    | 89 ++-----------------------------
 conf/vf_packet_rxtx.cfg                | 93 ++++----------------------------
 conf/vf_port_start_stop.cfg            | 88 ++----------------------------
 conf/vf_rss.cfg                        | 88 ++----------------------------
 conf/vf_to_vf_bridge.cfg               |  6 ++-
 conf/vf_vlan.cfg                       |  3 ++
 tests/TestSuite_sriov_kvm.py           | 18 +++----
 tests/TestSuite_vf_jumboframe.py       |  4 +-
 tests/TestSuite_vf_macfilter.py        |  4 +-
 tests/TestSuite_vf_offload.py          |  4 +-
 tests/TestSuite_vf_packet_rxtx.py      |  8 +--
 tests/TestSuite_vf_port_start_stop.py  |  4 +-
 tests/TestSuite_vf_rss.py              |  4 +-
 tests/TestSuite_vf_to_vf_nic_bridge.py |  6 +--
 tests/TestSuite_vf_vlan.py             |  4 +-
 18 files changed, 162 insertions(+), 449 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 1/9] tests/sriov_kvm: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 2/9] tests/vf_port_start_stop: " Herbert Guan
                     ` (8 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/sriov_kvm.cfg           | 79 +++++++++++++++++++++++++++++++++++++++++++-
 tests/TestSuite_sriov_kvm.py | 18 +++++-----
 2 files changed, 87 insertions(+), 10 deletions(-)

diff --git a/conf/sriov_kvm.cfg b/conf/sriov_kvm.cfg
index cf63da6..4bffa57 100644
--- a/conf/sriov_kvm.cfg
+++ b/conf/sriov_kvm.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 | ...]
@@ -70,6 +87,8 @@
 #
 # serial_port
 #       enable: [yes | no]
+#       opt_type: [pty | unix]
+#
 # vnc
 #       displayNum: 1
 #           note: you can choose a number not used on the host.
@@ -83,70 +102,128 @@
 
 # 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/DTSVM0_VARS.fd;
 cpu =
     model=host,number=4,cpupin=5 6 7 8;
 disk =
     file=/home/image/vdisk01-sriov-fc20.img;
+# Example for libvirt:
+#    file=/var/lib/libvirt/images/DTSVM0.qcow2,opt_format=qcow2,opt_bus=scsi,opt_dev=sda,opt_controller=virtio-scsi;
+#mem =
+#    size=4096;
 login =
     user=root,password=tester;
-net = 
+#serial_port =
+#    enable=yes,opt_type=pty;
+# 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/vdisk02-sriov-fc20.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;
+#serial_port =
+#    enable=yes,opt_type=pty;
+# 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;
 
 [vm2]
+# 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/DTSVM2_VARS.fd;
 cpu =
     model=host,number=4,cpupin=13 14 15 16;
 disk =
     file=/home/image/vdisk03-ivshmem-fc20.img;
+# Example for libvirt:
+#    file=/var/lib/libvirt/images/DTSVM2.qcow2,opt_format=qcow2,opt_bus=scsi,opt_dev=sda,opt_controller=virtio-scsi;
 login =
     user=root,password=tester;
+#serial_port =
+#    enable=yes,opt_type=pty;
+# net option is not necessary for libvirt, comment out below 2 lines if using libvirt
 net =
    type=nic,opt_vlan=3;
    type=tap,opt_vlan=3,opt_br=br0;
+# 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=3;
+# daemon option is not supported by libvirt yet, comment out below 2 lines if using libvirt
 daemon =
     enable=yes;
 
 [vm3]
+# 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/DTSVM3_VARS.fd;
 cpu =
     model=host,number=4,cpupin=17 18 19 20;
 disk =
     file=/home/image/vdisk04-ivshmem-fc20.img;
+# Example for libvirt:
+#    file=/var/lib/libvirt/images/DTSVM3.qcow2,opt_format=qcow2,opt_bus=scsi,opt_dev=sda,opt_controller=virtio-scsi;
 login =
     user=root,password=tester;
+#serial_port =
+#    enable=yes,opt_type=pty;
+# net option is not necessary for libvirt, comment out below 2 lines if using libvirt
 net =
    type=nic,opt_vlan=4;
    type=tap,opt_vlan=4,opt_br=br0;
+# 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=4;
+# daemon option is not supported by libvirt yet, comment out below 2 lines if using libvirt
 daemon =
     enable=yes;
 
diff --git a/tests/TestSuite_sriov_kvm.py b/tests/TestSuite_sriov_kvm.py
index ae97bef..ee8d555 100644
--- a/tests/TestSuite_sriov_kvm.py
+++ b/tests/TestSuite_sriov_kvm.py
@@ -12,7 +12,7 @@ import re
 import pdb
 import time
 
-from qemu_kvm import QEMUKvm
+from virt_common import VM
 from test_case import TestCase
 
 from pmd_output import PmdOutput
@@ -296,12 +296,12 @@ class TestSriovKvm(TestCase):
         vf1_prop = {'opt_host': self.port1_pci}
 
         # set up VM0 ENV
-        self.vm0 = QEMUKvm(self.dut, 'vm0', 'sriov_kvm')
+        self.vm0 = VM(self.dut, 'vm0', 'sriov_kvm')
         self.vm0.set_vm_device(driver='pci-assign', **vf0_prop)
         self.vm_dut_0 = self.vm0.start()
 
         # set up VM1 ENV
-        self.vm1 = QEMUKvm(self.dut, 'vm1', 'sriov_kvm')
+        self.vm1 = VM(self.dut, 'vm1', 'sriov_kvm')
         self.vm1.set_vm_device(driver='pci-assign', **vf1_prop)
         self.vm_dut_1 = self.vm1.start()
 
@@ -355,14 +355,14 @@ class TestSriovKvm(TestCase):
                 self.host_testpmd.execute_cmd('start')
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'sriov_kvm')
+            self.vm0 = VM(self.dut, 'vm0', 'sriov_kvm')
             self.vm0.set_vm_device(driver='pci-assign', **vf0_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', 'sriov_kvm')
+            self.vm1 = VM(self.dut, 'vm1', 'sriov_kvm')
             self.vm1.set_vm_device(driver='pci-assign', **vf1_prop)
             self.vm_dut_1 = self.vm1.start()
             if self.vm_dut_1 is None:
@@ -435,25 +435,25 @@ class TestSriovKvm(TestCase):
                 self.host_testpmd.start_testpmd(
                     "1S/2C/2T", eal_param=eal_param)
 
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'sriov_kvm')
+            self.vm0 = VM(self.dut, 'vm0', 'sriov_kvm')
             self.vm0.set_vm_device(driver='pci-assign', **vf0_prop)
             self.vm_dut_0 = self.vm0.start()
             if self.vm_dut_0 is None:
                 raise Exception("Set up VM0 ENV failed!")
 
-            self.vm1 = QEMUKvm(self.dut, 'vm1', 'sriov_kvm')
+            self.vm1 = VM(self.dut, 'vm1', 'sriov_kvm')
             self.vm1.set_vm_device(driver='pci-assign', **vf1_prop)
             self.vm_dut_1 = self.vm1.start()
             if self.vm_dut_1 is None:
                 raise Exception("Set up VM1 ENV failed!")
 
-            self.vm2 = QEMUKvm(self.dut, 'vm2', 'sriov_kvm')
+            self.vm2 = VM(self.dut, 'vm2', 'sriov_kvm')
             self.vm2.set_vm_device(driver='pci-assign', **vf2_prop)
             self.vm_dut_2 = self.vm2.start()
             if self.vm_dut_2 is None:
                 raise Exception("Set up VM2 ENV failed!")
 
-            self.vm3 = QEMUKvm(self.dut, 'vm3', 'sriov_kvm')
+            self.vm3 = VM(self.dut, 'vm3', 'sriov_kvm')
             self.vm3.set_vm_device(driver='pci-assign', **vf3_prop)
             self.vm_dut_3 = self.vm3.start()
             if self.vm_dut_3 is None:
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 2/9] tests/vf_port_start_stop: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 1/9] tests/sriov_kvm: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 3/9] tests/vf_packet_rxtx: " Herbert Guan
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_port_start_stop.cfg           | 88 ++---------------------------------
 tests/TestSuite_vf_port_start_stop.py |  4 +-
 2 files changed, 7 insertions(+), 85 deletions(-)

diff --git a/conf/vf_port_start_stop.cfg b/conf/vf_port_start_stop.cfg
index 8576404..0ccec70 100644
--- a/conf/vf_port_start_stop.cfg
+++ b/conf/vf_port_start_stop.cfg
@@ -1,87 +1,5 @@
-# QEMU options
-# name
-#       name: vm0
-#
-# enable_kvm
-#       enable: [yes | no]
-#
-# cpu
-#       model: [host | core2duo | ...]
-#           usage:
-#               choose model value from the command
-#                   qemu-system-x86_64 -cpu help
-#       number: '4' #number of vcpus
-#       cpupin: '3 4 5 6' # host cpu list
-#
-# mem
-#       size: 1024
-#
-# disk
-#       file: /path/to/image/test.img
-#
-# net
-#        type: [nic | user | tap | bridge | ...]
-#           nic
-#               opt_vlan: 0
-#                   note: Default is 0.
-#               opt_macaddr: 00:00:00:00:01:01
-#                   note: if creating a nic, it`s better to specify a MAC,
-#                         else it will get a random number.
-#               opt_model:["e1000" | "virtio" | "i82551" | ...]
-#                   note: Default is e1000.
-#               opt_name: 'nic1'
-#               opt_addr: ''
-#                   note: PCI cards only.
-#               opt_vectors:
-#                   note: This option currently only affects virtio cards.
-#           user
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
-#                   note: If not specified, it will be setted automatically.
-#           tap
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_br: br0
-#                   note: if choosing tap, need to specify bridge name,
-#                         else it will be br0.
-#               opt_script: QEMU_IFUP_PATH
-#                   note: if not specified, default is self.QEMU_IFUP_PATH.
-#               opt_downscript: QEMU_IFDOWN_PATH
-#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
-#
-# device
-#       driver: [pci-assign | virtio-net-pci | ...]
-#           pci-assign
-#               prop_host: 08:00.0
-#               prop_addr: 00:00:00:00:01:02
-#           virtio-net-pci
-#               prop_netdev: mynet1
-#               prop_id: net1
-#               prop_mac: 00:00:00:00:01:03
-#               prop_bus: pci.0
-#               prop_addr: 0x3
-#
-# monitor
-#       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]
-#
-# vnc
-#       displayNum: 1
-#           note: you can choose a number not used on the host.
-#
-# daemon
-#       enable: 'yes'
-#           note:
-#               By default VM will start with the daemonize status.
-#               Not support starting it on the stdin now.
+# Configuration sample: sriov_kvm.cfg
 
-# vm configuration for pmd sriov case
 [vm0]
 cpu =
     model=host,number=4,cpupin=5 6 7 8 9; 
@@ -91,12 +9,16 @@ mem =
     size=8196
 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=11;
+# 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_port_start_stop.py b/tests/TestSuite_vf_port_start_stop.py
index 3ebee73..a9e88d8 100644
--- a/tests/TestSuite_vf_port_start_stop.py
+++ b/tests/TestSuite_vf_port_start_stop.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
 from utils import RED, GREEN
@@ -180,7 +180,7 @@ class TestVfPortStartStop(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_port_start_stop')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_port_start_stop')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 3/9] tests/vf_packet_rxtx: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 1/9] tests/sriov_kvm: " Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 2/9] tests/vf_port_start_stop: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 4/9] tests/vf_vlan: " Herbert Guan
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_packet_rxtx.cfg           | 93 ++++-----------------------------------
 tests/TestSuite_vf_packet_rxtx.py |  8 ++--
 2 files changed, 13 insertions(+), 88 deletions(-)

diff --git a/conf/vf_packet_rxtx.cfg b/conf/vf_packet_rxtx.cfg
index adf7919..b83a0bf 100644
--- a/conf/vf_packet_rxtx.cfg
+++ b/conf/vf_packet_rxtx.cfg
@@ -1,87 +1,4 @@
-# QEMU options
-# name
-#       name: vm0
-#
-# enable_kvm
-#       enable: [yes | no]
-#
-# cpu
-#       model: [host | core2duo | ...]
-#           usage:
-#               choose model value from the command
-#                   qemu-system-x86_64 -cpu help
-#       number: '4' #number of vcpus
-#       cpupin: '3 4 5 6' # host cpu list
-#
-# mem
-#       size: 1024
-#
-# disk
-#       file: /path/to/image/test.img
-#
-# net
-#        type: [nic | user | tap | bridge | ...]
-#           nic
-#               opt_vlan: 0
-#                   note: Default is 0.
-#               opt_macaddr: 00:00:00:00:01:01
-#                   note: if creating a nic, it`s better to specify a MAC,
-#                         else it will get a random number.
-#               opt_model:["e1000" | "virtio" | "i82551" | ...]
-#                   note: Default is e1000.
-#               opt_name: 'nic1'
-#               opt_addr: ''
-#                   note: PCI cards only.
-#               opt_vectors:
-#                   note: This option currently only affects virtio cards.
-#           user
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
-#                   note: If not specified, it will be setted automatically.
-#           tap
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_br: br0
-#                   note: if choosing tap, need to specify bridge name,
-#                         else it will be br0.
-#               opt_script: QEMU_IFUP_PATH
-#                   note: if not specified, default is self.QEMU_IFUP_PATH.
-#               opt_downscript: QEMU_IFDOWN_PATH
-#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
-#
-# device
-#       driver: [pci-assign | virtio-net-pci | ...]
-#           pci-assign
-#               prop_host: 08:00.0
-#               prop_addr: 00:00:00:00:01:02
-#           virtio-net-pci
-#               prop_netdev: mynet1
-#               prop_id: net1
-#               prop_mac: 00:00:00:00:01:03
-#               prop_bus: pci.0
-#               prop_addr: 0x3
-#
-# monitor
-#       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]
-#
-# vnc
-#       displayNum: 1
-#           note: you can choose a number not used on the host.
-#
-# daemon
-#       enable: 'yes'
-#           note:
-#               By default VM will start with the daemonize status.
-#               Not support starting it on the stdin now.
-
-# vm configuration for pmd sriov case
+# Configuration sample: sriov_kvm.cfg
 [vm0]
 cpu =
     model=host,number=4,cpupin=5 6 7 8;
@@ -89,13 +6,17 @@ disk =
     file=/home/image/sriov-fc20-1.img;
 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;
 
@@ -106,12 +27,16 @@ disk =
     file=/home/image/sriov-fc20-2.img;
 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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 4/9] tests/vf_vlan: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
                     ` (2 preceding siblings ...)
  2018-02-12  9:57   ` [dts] [PATCH v2 3/9] tests/vf_packet_rxtx: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 5/9] tests/vf_to_vf_nic_bridge: " Herbert Guan
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_vlan.cfg           | 3 +++
 tests/TestSuite_vf_vlan.py | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/conf/vf_vlan.cfg b/conf/vf_vlan.cfg
index 94e68b4..5e0754b 100644
--- a/conf/vf_vlan.cfg
+++ b/conf/vf_vlan.cfg
@@ -1,3 +1,4 @@
+# Configuration sample: sriov_kvm.cfg
 [vm0]
 cpu =
     model=host,number=4,cpupin=5 6 7 8;
@@ -5,7 +6,9 @@ disk =
     file=/storage/vm-image/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=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_vlan.py b/tests/TestSuite_vf_vlan.py
index c0b26a3..da9330d 100644
--- a/tests/TestSuite_vf_vlan.py
+++ b/tests/TestSuite_vf_vlan.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
 from packet import Packet, sniff_packets, load_sniff_packets
@@ -114,7 +114,7 @@ class TestVfVlan(TestCase):
             vf1_prop = {'opt_host': self.sriov_vfs_port_1[0].pci}
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_vlan')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_vlan')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 5/9] tests/vf_to_vf_nic_bridge: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
                     ` (3 preceding siblings ...)
  2018-02-12  9:57   ` [dts] [PATCH v2 4/9] tests/vf_vlan: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 6/9] tests/vf_rss: " Herbert Guan
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 6/9] tests/vf_rss: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
                     ` (4 preceding siblings ...)
  2018-02-12  9:57   ` [dts] [PATCH v2 5/9] tests/vf_to_vf_nic_bridge: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 7/9] tests/vf_offload: " Herbert Guan
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_rss.cfg           | 88 +++--------------------------------------------
 tests/TestSuite_vf_rss.py |  4 +--
 2 files changed, 7 insertions(+), 85 deletions(-)

diff --git a/conf/vf_rss.cfg b/conf/vf_rss.cfg
index 8e6025f..1ef8656 100644
--- a/conf/vf_rss.cfg
+++ b/conf/vf_rss.cfg
@@ -1,87 +1,5 @@
-# QEMU options
-# name
-#       name: vm0
-#
-# enable_kvm
-#       enable: [yes | no]
-#
-# cpu
-#       model: [host | core2duo | ...]
-#           usage:
-#               choose model value from the command
-#                   qemu-system-x86_64 -cpu help
-#       number: '4' #number of vcpus
-#       cpupin: '3 4 5 6' # host cpu list
-#
-# mem
-#       size: 1024
-#
-# disk
-#       file: /path/to/image/test.img
-#
-# net
-#        type: [nic | user | tap | bridge | ...]
-#           nic
-#               opt_vlan: 0
-#                   note: Default is 0.
-#               opt_macaddr: 00:00:00:00:01:01
-#                   note: if creating a nic, it`s better to specify a MAC,
-#                         else it will get a random number.
-#               opt_model:["e1000" | "virtio" | "i82551" | ...]
-#                   note: Default is e1000.
-#               opt_name: 'nic1'
-#               opt_addr: ''
-#                   note: PCI cards only.
-#               opt_vectors:
-#                   note: This option currently only affects virtio cards.
-#           user
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
-#                   note: If not specified, it will be setted automatically.
-#           tap
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_br: br0
-#                   note: if choosing tap, need to specify bridge name,
-#                         else it will be br0.
-#               opt_script: QEMU_IFUP_PATH
-#                   note: if not specified, default is self.QEMU_IFUP_PATH.
-#               opt_downscript: QEMU_IFDOWN_PATH
-#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
-#
-# device
-#       driver: [pci-assign | virtio-net-pci | ...]
-#           pci-assign
-#               prop_host: 08:00.0
-#               prop_addr: 00:00:00:00:01:02
-#           virtio-net-pci
-#               prop_netdev: mynet1
-#               prop_id: net1
-#               prop_mac: 00:00:00:00:01:03
-#               prop_bus: pci.0
-#               prop_addr: 0x3
-#
-# monitor
-#       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]
-#
-# vnc
-#       displayNum: 1
-#           note: you can choose a number not used on the host.
-#
-# daemon
-#       enable: 'yes'
-#           note:
-#               By default VM will start with the daemonize status.
-#               Not support starting it on the stdin now.
+# Configuration sample: sriov_kvm.cfg
 
-# vm configuration for pmd sriov case
 [vm0]
 cpu =
     model=host,number=8,cpupin=5 6 7 8 9 10 11 12 ;
@@ -89,12 +7,16 @@ disk =
     file=/home/image/fedora23-ok.img;
 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;
diff --git a/tests/TestSuite_vf_rss.py b/tests/TestSuite_vf_rss.py
index 33591b5..f2730e7 100644
--- a/tests/TestSuite_vf_rss.py
+++ b/tests/TestSuite_vf_rss.py
@@ -44,7 +44,7 @@ reta_lines = []
 # and collect the hash result of five tuple and the queue id.
 from test_case import TestCase
 from pmd_output import PmdOutput
-from qemu_kvm import QEMUKvm
+from virt_common import VM
 
 class TestVfRss(TestCase):
 
@@ -262,7 +262,7 @@ class TestVfRss(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_rss')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_rss')
             self.vm0.set_vm_device(driver=self.vf_assign_method, **vf0_prot)
 
             self.vm_dut_0 = self.vm0.start()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 7/9] tests/vf_offload: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
                     ` (5 preceding siblings ...)
  2018-02-12  9:57   ` [dts] [PATCH v2 6/9] tests/vf_rss: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 8/9] tests/vf_jumboframe: " Herbert Guan
                     ` (2 subsequent siblings)
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_offload.cfg           | 89 +++----------------------------------------
 tests/TestSuite_vf_offload.py |  4 +-
 2 files changed, 7 insertions(+), 86 deletions(-)

diff --git a/conf/vf_offload.cfg b/conf/vf_offload.cfg
index 5820660..bff1035 100644
--- a/conf/vf_offload.cfg
+++ b/conf/vf_offload.cfg
@@ -1,87 +1,4 @@
-# QEMU options
-# name
-#       name: vm0
-#
-# enable_kvm
-#       enable: [yes | no]
-#
-# cpu
-#       model: [host | core2duo | ...]
-#           usage:
-#               choose model value from the command
-#                   qemu-system-x86_64 -cpu help
-#       number: '4' #number of vcpus
-#       cpupin: '3 4 5 6' # host cpu list
-#
-# mem
-#       size: 1024
-#
-# disk
-#       file: /path/to/image/test.img
-#
-# net
-#        type: [nic | user | tap | bridge | ...]
-#           nic
-#               opt_vlan: 0
-#                   note: Default is 0.
-#               opt_macaddr: 00:00:00:00:01:01
-#                   note: if creating a nic, it`s better to specify a MAC,
-#                         else it will get a random number.
-#               opt_model:["e1000" | "virtio" | "i82551" | ...]
-#                   note: Default is e1000.
-#               opt_name: 'nic1'
-#               opt_addr: ''
-#                   note: PCI cards only.
-#               opt_vectors:
-#                   note: This option currently only affects virtio cards.
-#           user
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
-#                   note: If not specified, it will be setted automatically.
-#           tap
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_br: br0
-#                   note: if choosing tap, need to specify bridge name,
-#                         else it will be br0.
-#               opt_script: QEMU_IFUP_PATH
-#                   note: if not specified, default is self.QEMU_IFUP_PATH.
-#               opt_downscript: QEMU_IFDOWN_PATH
-#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
-#
-# device
-#       driver: [pci-assign | virtio-net-pci | ...]
-#           pci-assign
-#               prop_host: 08:00.0
-#               prop_addr: 00:00:00:00:01:02
-#           virtio-net-pci
-#               prop_netdev: mynet1
-#               prop_id: net1
-#               prop_mac: 00:00:00:00:01:03
-#               prop_bus: pci.0
-#               prop_addr: 0x3
-#
-# monitor
-#       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]
-#
-# vnc
-#       displayNum: 1
-#           note: you can choose a number not used on the host.
-#
-# daemon
-#       enable: 'yes'
-#           note:
-#               By default VM will start with the daemonize status.
-#               Not support starting it on the stdin now.
-
-# vm configuration for pmd sriov case
+# Configuration sample: sriov_kvm.cfg
 [vm0]
 cpu =
     model=host,number=4,cpupin=4 5 6 7; 
@@ -91,12 +8,16 @@ mem =
     size=4096;
 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=11;
+# 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_offload.py b/tests/TestSuite_vf_offload.py
index 69ee592..cb4b368 100644
--- a/tests/TestSuite_vf_offload.py
+++ b/tests/TestSuite_vf_offload.py
@@ -5,7 +5,7 @@ import time
 import string
 
 import utils
-from qemu_kvm import QEMUKvm
+from virt_common import VM
 from test_case import TestCase
 from pmd_output import PmdOutput
 from utils import RED, GREEN
@@ -73,7 +73,7 @@ class TestVfOffload(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_offload')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_offload')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 8/9] tests/vf_jumboframe: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
                     ` (6 preceding siblings ...)
  2018-02-12  9:57   ` [dts] [PATCH v2 7/9] tests/vf_offload: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-12  9:57   ` [dts] [PATCH v2 9/9] tests/vf_macfilter: " Herbert Guan
  2018-02-13 12:45   ` [dts] [PATCH v2 0/9] " Liu, Yong
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [dts] [PATCH v2 9/9] tests/vf_macfilter: use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
                     ` (7 preceding siblings ...)
  2018-02-12  9:57   ` [dts] [PATCH v2 8/9] tests/vf_jumboframe: " Herbert Guan
@ 2018-02-12  9:57   ` Herbert Guan
  2018-02-13 12:45   ` [dts] [PATCH v2 0/9] " Liu, Yong
  9 siblings, 0 replies; 21+ messages in thread
From: Herbert Guan @ 2018-02-12  9:57 UTC (permalink / raw)
  To: dts; +Cc: Herbert Guan

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@arm.com>
---
 conf/vf_macfilter.cfg           | 97 ++++++-----------------------------------
 tests/TestSuite_vf_macfilter.py |  4 +-
 2 files changed, 15 insertions(+), 86 deletions(-)

diff --git a/conf/vf_macfilter.cfg b/conf/vf_macfilter.cfg
index ddf3168..b4a5eb4 100644
--- a/conf/vf_macfilter.cfg
+++ b/conf/vf_macfilter.cfg
@@ -1,100 +1,29 @@
-# QEMU options
-# name
-#       name: vm0
-#
-# enable_kvm
-#       enable: [yes | no]
-#
-# cpu
-#       model: [host | core2duo | ...]
-#           usage:
-#               choose model value from the command
-#                   qemu-system-x86_64 -cpu help
-#       number: '4' #number of vcpus
-#       cpupin: '3 4 5 6' # host cpu list
-#
-# mem
-#       size: 1024
-#
-# disk
-#       file: /path/to/image/test.img
-#
-# net
-#        type: [nic | user | tap | bridge | ...]
-#           nic
-#               opt_vlan: 0
-#                   note: Default is 0.
-#               opt_macaddr: 00:00:00:00:01:01
-#                   note: if creating a nic, it`s better to specify a MAC,
-#                         else it will get a random number.
-#               opt_model:["e1000" | "virtio" | "i82551" | ...]
-#                   note: Default is e1000.
-#               opt_name: 'nic1'
-#               opt_addr: ''
-#                   note: PCI cards only.
-#               opt_vectors:
-#                   note: This option currently only affects virtio cards.
-#           user
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_hostfwd: [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport
-#                   note: If not specified, it will be setted automatically.
-#           tap
-#               opt_vlan: 0
-#                   note: default is 0.
-#               opt_br: br0
-#                   note: if choosing tap, need to specify bridge name,
-#                         else it will be br0.
-#               opt_script: QEMU_IFUP_PATH
-#                   note: if not specified, default is self.QEMU_IFUP_PATH.
-#               opt_downscript: QEMU_IFDOWN_PATH
-#                   note: if not specified, default is self.QEMU_IFDOWN_PATH.
-#
-# device
-#       driver: [pci-assign | virtio-net-pci | ...]
-#           pci-assign
-#               prop_host: 08:00.0
-#               prop_addr: 00:00:00:00:01:02
-#           virtio-net-pci
-#               prop_netdev: mynet1
-#               prop_id: net1
-#               prop_mac: 00:00:00:00:01:03
-#               prop_bus: pci.0
-#               prop_addr: 0x3
-#
-# monitor
-#       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]
-#
-# vnc
-#       displayNum: 1
-#           note: you can choose a number not used on the host.
-#
-# daemon
-#       enable: 'yes'
-#           note:
-#               By default VM will start with the daemonize status.
-#               Not support starting it on the stdin now.
-
-# vm configuration for pmd sriov case
+# 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=/home/img/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;
diff --git a/tests/TestSuite_vf_macfilter.py b/tests/TestSuite_vf_macfilter.py
index 23105a4..f0de169 100644
--- a/tests/TestSuite_vf_macfilter.py
+++ b/tests/TestSuite_vf_macfilter.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
 
@@ -71,7 +71,7 @@ class TestVfMacFilter(TestCase):
                 self.host_testpmd.start_testpmd("1S/2C/2T", eal_param=eal_param)
 
             # set up VM0 ENV
-            self.vm0 = QEMUKvm(self.dut, 'vm0', 'vf_macfilter')
+            self.vm0 = VM(self.dut, 'vm0', 'vf_macfilter')
             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()
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [dts] [PATCH v2 0/9] use virt_common for VM creation
  2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
                     ` (8 preceding siblings ...)
  2018-02-12  9:57   ` [dts] [PATCH v2 9/9] tests/vf_macfilter: " Herbert Guan
@ 2018-02-13 12:45   ` Liu, Yong
  9 siblings, 0 replies; 21+ messages in thread
From: Liu, Yong @ 2018-02-13 12:45 UTC (permalink / raw)
  To: Herbert Guan, dts

Thanks Herbert, applied in.

On 02/12/2018 05:57 PM, Herbert Guan wrote:
> This patch series adds support of using libvirt as VM type for a set
> of vf test suites.  It 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.
>
>
> Herbert Guan (9):
>    tests/sriov_kvm: use virt_common for VM creation
>    tests/vf_port_start_stop: use virt_common for VM creation
>    tests/vf_packet_rxtx: use virt_common for VM creation
>    tests/vf_vlan: use virt_common for VM creation
>    tests/vf_to_vf_nic_bridge: use virt_common for VM creation
>    tests/vf_rss: use virt_common for VM creation
>    tests/vf_offload: use virt_common for VM creation
>    tests/vf_jumboframe: use virt_common for VM creation
>    tests/vf_macfilter: use virt_common for VM creation

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-02-13  4:54 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09  6:25 [dts] [PATCH v1 0/8] use virt_common for VM creation Herbert Guan
2018-02-09  6:25 ` [dts] [PATCH v1 1/8] tests/vf_macfilter: " Herbert Guan
2018-02-09  6:25 ` [dts] [PATCH v1 2/8] tests/vf_jumboframe: " Herbert Guan
2018-02-11 10:07   ` Liu, Yong
2018-02-09  6:26 ` [dts] [PATCH v1 3/8] tests/vf_offload: " Herbert Guan
2018-02-09  6:26 ` [dts] [PATCH v1 4/8] tests/vf_rss: " Herbert Guan
2018-02-09  6:26 ` [dts] [PATCH v1 5/8] tests/vf_to_vf_nic_bridge: " Herbert Guan
2018-02-09  6:26 ` [dts] [PATCH v1 6/8] tests/vf_vlan: " Herbert Guan
2018-02-09  6:26 ` [dts] [PATCH v1 7/8] tests/vf_packet_rxtx: " Herbert Guan
2018-02-09  6:26 ` [dts] [PATCH v1 8/8] tests/vf_port_start_stop: " Herbert Guan
2018-02-12  9:57 ` [dts] [PATCH v2 0/9] " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 1/9] tests/sriov_kvm: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 2/9] tests/vf_port_start_stop: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 3/9] tests/vf_packet_rxtx: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 4/9] tests/vf_vlan: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 5/9] tests/vf_to_vf_nic_bridge: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 6/9] tests/vf_rss: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 7/9] tests/vf_offload: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 8/9] tests/vf_jumboframe: " Herbert Guan
2018-02-12  9:57   ` [dts] [PATCH v2 9/9] tests/vf_macfilter: " Herbert Guan
2018-02-13 12:45   ` [dts] [PATCH v2 0/9] " Liu, Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).