test suite reviews and discussions
 help / color / mirror / Atom feed
From: "Xie,WeiX" <weix.xie@intel.com>
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
Date: Wed, 22 Apr 2020 10:54:56 +0800	[thread overview]
Message-ID: <1587524096-369703-1-git-send-email-weix.xie@intel.com> (raw)

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


             reply	other threads:[~2020-04-22  3:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22  2:54 Xie,WeiX [this message]
2020-04-23  5:52 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1587524096-369703-1-git-send-email-weix.xie@intel.com \
    --to=weix.xie@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).