From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8BE7CA05A1; Wed, 22 Apr 2020 05:01:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7E9FB1D405; Wed, 22 Apr 2020 05:01:15 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id A9CC51D404 for ; Wed, 22 Apr 2020 05:01:14 +0200 (CEST) IronPort-SDR: gfbHRdEkJtFTKsSpW6ou5v83k/yRUIRIbtEkHzZN3o3XVs/+q3/W6txwIkDCga0cOba+10X3Tf rRU8OXGOw5Ng== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2020 20:01:13 -0700 IronPort-SDR: VFGOmA5hT9wctvjfAZHpn5qKA770jUcRpzE0Frk4H+lyYQHTbUEtkHlFEKGnc3mF6M80G/id3o ZOSVketyFirg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,412,1580803200"; d="scan'208";a="334473973" Received: from unknown (HELO xqm-virtio_tester.sh.intel.com) ([10.240.183.52]) by orsmga001.jf.intel.com with ESMTP; 21 Apr 2020 20:01:12 -0700 From: "Xie,WeiX" To: dts@dpdk.org Cc: "Xie,WeiX" Date: Wed, 22 Apr 2020 10:54:56 +0800 Message-Id: <1587524096-369703-1-git-send-email-weix.xie@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1] tests/vm_hotplug:add link status check and add nic support 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: , Errors-To: dts-bounces@dpdk.org Sender: "dts" From: "Xie,WeiX" check link status after start,and add NIC supported Signed-off-by: Xie,WeiX --- tests/TestSuite_vm_hotplug.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tests/TestSuite_vm_hotplug.py b/tests/TestSuite_vm_hotplug.py index 8fd1de7..dd31272 100644 --- a/tests/TestSuite_vm_hotplug.py +++ b/tests/TestSuite_vm_hotplug.py @@ -247,16 +247,28 @@ class TestVmHotplug(TestCase): result.append(cap_num[0]) return result + def check_link_status(self, vm_info): + loop = 1 + while (loop <= 3): + out = vm_info.execute_cmd("show port info all", "testpmd> ", 120) + port_status = re.findall("Link\s*status:\s*([a-z]*)", out) + if ("down" not in port_status): + break + time.sleep(3) + loop += 1 + self.verify("down" not in port_status, "port can not up after start") + def verify_rxtx_only(self): # rxonly self.vm_testpmd.execute_cmd('set fwd rxonly') self.vm_testpmd.execute_cmd('set verbose 1') self.vm_testpmd.execute_cmd('port start all') self.vm_testpmd.execute_cmd('start') - time.sleep(1) + self.check_link_status(self.vm_testpmd) self.send_packet() out = self.vm0_dut.get_session_output() + time.sleep(1) self.verify(self.vf0_mac in out, 'vf0 receive packet fail') if self.device == 2: self.verify(self.vf1_mac in out, 'vf1 receive packet fail') @@ -279,7 +291,7 @@ class TestVmHotplug(TestCase): def check_vf_device(self, has_device=True, device=1): time.sleep(1) sign = 'Connection' - lis1 = ['fortville_spirit', 'fortville_eagle'] + lis1 = ['fortville_spirit', 'fortville_eagle', 'sagepond', 'twinpond', 'sageville'] lis2 = ['fortpark_TLV', 'fortville_25g',"fortpark_BASE-T"] if self.nic in lis1: sign = 'Ethernet' @@ -300,6 +312,7 @@ class TestVmHotplug(TestCase): self.host_session.send_expect('device_add vfio-pci,host=%s,id=dev1' % self.dut.ports_info[0]['pci'], '(qemu)') if device == 2: self.host_session.send_expect('device_add vfio-pci,host=%s,id=dev2' % self.dut.ports_info[1]['pci'], '(qemu)') + time.sleep(3) self.check_vf_device(has_device=True, device=device) self.vm_session.send_expect('./usertools/dpdk-devbind.py -b vfio-pci %s' % self.vf_pci0, '#') if device == 2: -- 1.8.3.1