test suite reviews and discussions
 help / color / mirror / Atom feed
From: "xu,gang" <gangx.xu@intel.com>
To: dts@dpdk.org
Cc: "xu,huilong" <huilongx.xu@intel.com>
Subject: [dts] [PATCH V1] fix userspace failed case
Date: Wed, 23 Aug 2017 17:01:59 +0800	[thread overview]
Message-ID: <1503478919-86948-1-git-send-email-gangx.xu@intel.com> (raw)

From: "xu,huilong" <huilongx.xu@intel.com>

update list:
1. update userspace example path for setup app
2. add sleep time for app update link status with fortville nic in port config case
3. dpdk userspace tools dump eeprom file size different kernel ethtools dump, so only compare same size bytes
4. use scapy tool send packet replace packet model, because app can't received packet by use packet model

Signed-off-by: xu,huilong <huilongx.xu@intel.com>
---
 tests/TestSuite_userspace_ethtool.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/TestSuite_userspace_ethtool.py b/tests/TestSuite_userspace_ethtool.py
index 937a9e5..1b234c1 100644
--- a/tests/TestSuite_userspace_ethtool.py
+++ b/tests/TestSuite_userspace_ethtool.py
@@ -61,7 +61,7 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
         self.verify("Error" not in out, "compilation error 1")
         self.verify("No such file" not in out, "compilation error 2")
 
-        path = "./examples/ethtool/ethtool-app/ethtool-app/%s/ethtool" % self.target
+        path = "./examples/ethtool/ethtool-app/%s/ethtool" % self.target
         self.cmd = "%s -c f -n %d" % (path, self.dut.get_memory_channels())
 
         # pause frame basic configuration
@@ -370,7 +370,10 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             self.dut.send_expect("ethtool --eeprom-dump %s raw on > %s" % (intf, ethtool_eeprom), "# ")
             # wait for file ready
             time.sleep(2)
-            portinfo['ethtool_eeprom'] = ethtool_eeprom
+            # dpdk userspace dump eeprom-dump size different with kernel ethtool dump eeprom-dump, so only compare same size bytes
+            dpdk_eeprom_size = int(self.dut.send_expect('ls -all %s' % portinfo['eeprom_file'], '# ').split(' ')[4].strip())
+            self.dut.send_expect('dd if=%s of=%s bs=%d count=1' % (ethtool_eeprom, "ethtool_eeprom_%d_cat.bin" % index, dpdk_eeprom_size), "#")
+            portinfo['ethtool_eeprom'] = "ethtool_eeprom_%d_cat.bin" % index
             # bind to original driver
             portinfo['net_dev'].bind_driver(portinfo['ori_driver'])
 
@@ -394,10 +397,12 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
             rx_ring, _, tx_ring, _ = self.strip_ringparam(index)
             self.verify(rx_ring == rx_max, "Userspace tool failed to set Rx ring parameter")
             self.verify(tx_ring == tx_max, "Userspace tool failed to set Tx ring parameter")
-            pkt = Packet()
             tester_port = self.tester.get_local_port(port)
             intf = self.tester.get_interface(tester_port)
-            pkt.send_pkt(tx_port=intf)
+            # use scapy send packet, because example can't receive packet by packet model
+            packet = r'sendp([Ether(dst="ff:ff:ff:ff:ff:ff")/IP()/UDP()/Raw()], iface="%s")' % intf 
+            self.tester.scapy_append(packet)
+            self.tester.scapy_execute()
             rx_pkts, tx_pkts = self.strip_portstats(index)
             self.verify(rx_pkts == ori_rx_pkts + 1, "Failed to forward after ring parameter changed")
             self.dut.send_expect("quit", "# ")
@@ -499,8 +504,11 @@ class TestUserspaceEthtool(TestCase, IxiaPacketGenerator):
         for index in range(len(self.ports)):
             port = self.ports[index]
             ori_rx_pkts, _ = self.strip_portstats(index)
+            # add sleep time for example update port link status
+            time.sleep(10)
             # stop port
             self.dut.send_expect("stop %d" % index, "EthApp>")
+            time.sleep(10)
             # check packet not forwarded when port is stop
             pkt = Packet()
             tester_port = self.tester.get_local_port(port)
-- 
1.9.3

             reply	other threads:[~2017-08-23  9:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23  9:01 xu,gang [this message]
2017-08-24  3:50 ` Liu, Yong
2017-08-24  3:57   ` Xu, HuilongX
2017-08-24  5:00     ` Liu, Yong
2017-08-24  5:41       ` Xu, HuilongX
2017-08-24  5:49         ` Liu, Yong
2017-08-24  6:17           ` Xu, HuilongX
2017-08-24  6:25             ` Liu, Yong
2017-08-24  6:47               ` Xu, HuilongX

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=1503478919-86948-1-git-send-email-gangx.xu@intel.com \
    --to=gangx.xu@intel.com \
    --cc=dts@dpdk.org \
    --cc=huilongx.xu@intel.com \
    /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).