From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by dpdk.org (Postfix) with ESMTP id 5D63B1B2FF for ; Mon, 12 Feb 2018 10:58:25 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B39F415AB; Mon, 12 Feb 2018 01:58:24 -0800 (PST) Received: from lenovo-a010984.shanghai.arm.com (lenovo-a010984.shanghai.arm.com [10.169.40.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4714C3F41F; Mon, 12 Feb 2018 01:58:24 -0800 (PST) From: Herbert Guan To: dts@dpdk.org Cc: Herbert Guan Date: Mon, 12 Feb 2018 17:57:34 +0800 Message-Id: <1518429462-30299-2-git-send-email-herbert.guan@arm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1518429462-30299-1-git-send-email-herbert.guan@arm.com> References: <1518157565-17167-1-git-send-email-herbert.guan@arm.com> <1518429462-30299-1-git-send-email-herbert.guan@arm.com> Subject: [dts] [PATCH v2 1/9] tests/sriov_kvm: use virt_common for VM creation X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2018 09:58:25 -0000 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 --- 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