* [dts] [PATCH V1] tests/vm_hotplug:add link status check and add nic support
@ 2020-04-22 2:54 Xie,WeiX
2020-04-23 5:52 ` Tu, Lijuan
0 siblings, 1 reply; 2+ messages in thread
From: Xie,WeiX @ 2020-04-22 2:54 UTC (permalink / raw)
To: dts; +Cc: Xie,WeiX
From: "Xie,WeiX" <weix.xie@intel.com>
check link status after start,and add NIC supported
Signed-off-by: Xie,WeiX <weix.xie@intel.com>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH V1] tests/vm_hotplug:add link status check and add nic support
2020-04-22 2:54 [dts] [PATCH V1] tests/vm_hotplug:add link status check and add nic support Xie,WeiX
@ 2020-04-23 5:52 ` Tu, Lijuan
0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2020-04-23 5:52 UTC (permalink / raw)
To: Xie, WeiX, dts; +Cc: Xie, WeiX
Applied thanks
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xie,WeiX
> Sent: Wednesday, April 22, 2020 10:55 AM
> To: dts@dpdk.org
> Cc: Xie, WeiX <weix.xie@intel.com>
> Subject: [dts] [PATCH V1] tests/vm_hotplug:add link status check and add nic
> support
>
> From: "Xie,WeiX" <weix.xie@intel.com>
>
> check link status after start,and add NIC supported
>
> Signed-off-by: Xie,WeiX <weix.xie@intel.com>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-23 5:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 2:54 [dts] [PATCH V1] tests/vm_hotplug:add link status check and add nic support Xie,WeiX
2020-04-23 5:52 ` Tu, Lijuan
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).