From: "xu,huilong" <huilongx.xu@intel.com>
To: dts@dpdk.org
Cc: "xu,huilong" <huilongx.xu@intel.com>
Subject: [dts] [PATCH V2] fix hotplug failed case
Date: Fri, 25 Aug 2017 11:16:12 +0800 [thread overview]
Message-ID: <1503630972-89428-1-git-send-email-huilongx.xu@intel.com> (raw)
update list:
1. update dpdk-devbind tools path
2. update start/stop/close port process, add sleep time for update fortville link status
3. fix verify received packet type error
4. fix send packet with error port
Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
tests/TestSuite_hotplug.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/tests/TestSuite_hotplug.py b/tests/TestSuite_hotplug.py
index 9fa922a..7704253 100644
--- a/tests/TestSuite_hotplug.py
+++ b/tests/TestSuite_hotplug.py
@@ -69,15 +69,20 @@ class TestPortHotPlug(TestCase):
"""
attach port
"""
- self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'],"is attached",60)
- self.dut.send_expect("port start %s" % port,"Link Up",60)
+ # dpdk hotplug discern NIC by pci bus not include domid
+ self.dut.send_expect("port attach %s" % self.dut.ports_info[port]['pci'][len("0000:"):],"is attached",60)
+ self.dut.send_expect("port start %s" % port,"Configuring Port",120)
+ # sleep 10 seconds for fortville update link stats
+ time.sleep(10)
self.dut.send_expect("show port info %s" % port,"testpmd>",60)
def detach(self, port):
"""
detach port
"""
- self.dut.send_expect("port stop %s" % port,"Link Down",60)
+ self.dut.send_expect("port stop %s" % port,"Stopping ports",60)
+ # sleep 10 seconds for fortville update link stats
+ time.sleep(10)
self.dut.send_expect("port close %s" % port,"Closing ports...",60)
self.dut.send_expect("port detach %s" % port,"is detached",60)
@@ -88,7 +93,7 @@ class TestPortHotPlug(TestCase):
cmd = "./x86_64-native-linuxapp-gcc/app/testpmd -c %s -n %s -- -i" % (self.coremask,self.dut.get_memory_channels())
self.dut.send_expect(cmd,"testpmd>",60)
session_secondary = self.dut.new_session()
- session_secondary.send_expect("./tools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
+ session_secondary.send_expect("./usertools/dpdk-devbind.py --bind=igb_uio %s" % self.dut.ports_info[self.port]['pci'], "#", 60)
self.dut.close_session(session_secondary)
self.attach(self.port)
self.dut.send_expect("start","testpmd>",60)
@@ -103,15 +108,15 @@ class TestPortHotPlug(TestCase):
out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
packet = re.search("RX-packets:\s*(\d*)",out)
sum_packet = packet.group(1)
- self.verify(sum_packet = 1, "Insufficient the received package")
+ self.verify(int(sum_packet) == 1, "Insufficient the received package")
self.dut.send_expect("quit","#",60)
def send_packet(self, port):
"""
Send a packet to port
"""
- self.dmac = self.dut.get_mac_address(self.dut_ports[0])
- txport = self.tester.get_local_port(self.dut_ports[0])
+ self.dmac = self.dut.get_mac_address(port)
+ txport = self.tester.get_local_port(port)
self.txItf = self.tester.get_interface(txport)
pkt = Packet(pkt_type='UDP')
pkt.config_layer('ether', {'dst': self.dmac,})
@@ -134,7 +139,7 @@ class TestPortHotPlug(TestCase):
out = self.dut.send_expect("show port stats %s" % self.port ,"testpmd>",60)
packet = re.search("RX-packets:\s*(\d*)",out)
sum_packet = packet.group(1)
- self.verify(sum_packet = 1, "Insufficient the received package")
+ self.verify(int(sum_packet) == 1, "Insufficient the received package")
self.dut.send_expect("quit","#",60)
--
1.9.3
next reply other threads:[~2017-08-25 3:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-25 3:16 xu,huilong [this message]
2017-08-25 13:52 ` Liu, Yong
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=1503630972-89428-1-git-send-email-huilongx.xu@intel.com \
--to=huilongx.xu@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).