test suite reviews and discussions
 help / color / mirror / Atom feed
From: Michael Qiu <michael.qiu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 2/3 v2] tests: Add RRC support in suite scatter
Date: Wed,  8 Jul 2015 16:51:05 +0800	[thread overview]
Message-ID: <1436345466-31613-3-git-send-email-michael.qiu@intel.com> (raw)
In-Reply-To: <1436345466-31613-1-git-send-email-michael.qiu@intel.com>

Add RRC support in suite scatter

Signed-off-by: Michael Qiu <michael.qiu>
---
v2 --> v1:
       mv nic tpye to setup function

 tests/TestSuite_scatter.py | 38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/tests/TestSuite_scatter.py b/tests/TestSuite_scatter.py
index 643fe4a..abb1a08 100644
--- a/tests/TestSuite_scatter.py
+++ b/tests/TestSuite_scatter.py
@@ -55,6 +55,10 @@ class TestScatter(TestCase):
         # Verify that enough ports are available
         self.verify(len(dutPorts) >= 2, "Insufficient ports")
         self.pmdout = PmdOutput(self.dut)
+        if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single", "redrockcanyou"]:
+            self.mbsize = 2048
+        else:
+            self.mbsize = 1024
 
     def scatter_pktgen_send_packet(self, sPortid, rPortid, pktsize, num=1):
         """
@@ -62,12 +66,12 @@ class TestScatter(TestCase):
         """
         sport = self.tester.get_local_port(sPortid)
         sintf = self.tester.get_interface(sport)
-        smac = self.dut.get_mac_address(sPortid)
+        smac = self.tester.get_mac(sport)
+        dmac = self.dut.get_mac_address(sPortid)
         rport = self.tester.get_local_port(rPortid)
         rintf = self.tester.get_interface(rport)
-        if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
-            self.tester.send_expect("ifconfig %s mtu 9000" % sintf, "#")
-            self.tester.send_expect("ifconfig %s mtu 9000" % rintf, "#")
+        self.tester.send_expect("ifconfig %s mtu 9000" % sintf, "#")
+        self.tester.send_expect("ifconfig %s mtu 9000" % rintf, "#")
 
         self.tester.scapy_background()
         self.tester.scapy_append(
@@ -79,12 +83,11 @@ class TestScatter(TestCase):
 
         self.tester.scapy_foreground()
         self.tester.scapy_append(
-            'sendp([Ether(dst="%s")/IP(len=%s)/Raw(load="\x50"*%s)], iface="%s")' % (smac, pktlen, padding, sintf))
+            'sendp([Ether(src="%s",dst="%s")/IP(len=%s)/Raw(load="\x50"*%s)], iface="%s")' % (smac, dmac,pktlen, padding, sintf))
         self.tester.scapy_execute()
         res = self.tester.scapy_get_result()
-        if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
-            self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#")
-            self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#")
+        self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#")
+        self.tester.send_expect("ifconfig %s mtu 1500" % sintf, "#")
         return res
 
     def set_up(self):
@@ -103,25 +106,16 @@ class TestScatter(TestCase):
         portMask = dts.create_mask(dutPorts[:2])
 
         # set the mbuf size to 1024
-        if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
-            out = self.pmdout.start_testpmd(
-                "1S/2C/2T", "--mbcache=200 --mbuf-size=2048 --portmask=%s --max-pkt-len=9000" % portMask)
-        else:
-            out = self.pmdout.start_testpmd(
-                "1S/2C/2T", "--mbcache=200 --mbuf-size=1024 --portmask=%s" % portMask)
+        out = self.pmdout.start_testpmd(
+                "1S/2C/2T", "--mbcache=200 --mbuf-size=%d --portmask=%s --max-pkt-len=9000" % (self.mbsize, portMask))
         self.verify("Error" not in out, "launch error 1")
 
-        if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
-            self.dut.send_expect("set fwd mac", "testpmd> ", 120)
+        self.dut.send_expect("set fwd mac", "testpmd> ", 120)
         self.dut.send_expect("start", "testpmd> ")
 
         for offset in [-1, 0, 1, 4, 5]:
-            if self.nic in ["niantic", "fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
-                ret = self.scatter_pktgen_send_packet(
-                    dutPorts[0], dutPorts[1], 2048 + offset)
-            else:
-                ret = self.scatter_pktgen_send_packet(
-                    dutPorts[0], dutPorts[1], 1024 + offset)
+            ret = self.scatter_pktgen_send_packet(
+                dutPorts[0], dutPorts[1], self.mbsize + offset)
             self.verify("load='P" in ret, "packet receive error")
 
         self.dut.send_expect("stop", "testpmd> ")
-- 
1.9.3

  parent reply	other threads:[~2015-07-08  9:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-07  9:37 [dts] [PATCH 0/3] Add RRC support in test suites Michael Qiu
2015-07-07  9:37 ` [dts] [PATCH 1/3] tests: Add RRC support with jumbo frame Michael Qiu
2015-07-07  9:37 ` [dts] [PATCH 2/3] tests: Add RRC support in suit scatter Michael Qiu
2015-07-08  0:57   ` Liu, Yong
2015-07-08  1:49     ` Qiu, Michael
2015-07-07  9:38 ` [dts] [PATCH 3/3] tests: Add RRC support with vlan suite Michael Qiu
2015-07-08  1:43   ` Liu, Yong
2015-07-08  1:54     ` Qiu, Michael
2015-07-08  8:51 ` [dts] [PATCH 0/3 v2] Add RRC support in test suites Michael Qiu
2015-07-08  8:51   ` [dts] [PATCH 1/3 v2] tests: Add RRC support with jumbo frame Michael Qiu
2015-07-08  8:51   ` Michael Qiu [this message]
2015-07-08  8:51   ` [dts] [PATCH 3/3 v2] tests: Add RRC support with vlan suite Michael Qiu
2015-07-09  2:26   ` [dts] [PATCH 0/3 v2] Add RRC support in test suites 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=1436345466-31613-3-git-send-email-michael.qiu@intel.com \
    --to=michael.qiu@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).