test suite reviews and discussions
 help / color / mirror / Atom feed
From: Michael Qiu <michael.qiu@intel.com>
To: dts@dpdk.org
Subject: [dts] [PATCH 3/3] tests: Add RRC support with vlan suite
Date: Tue,  7 Jul 2015 17:38:00 +0800	[thread overview]
Message-ID: <1436261880-22395-4-git-send-email-michael.qiu@intel.com> (raw)
In-Reply-To: <1436261880-22395-1-git-send-email-michael.qiu@intel.com>

Add RRC support with vlan suite

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
 tests/TestSuite_vlan.py | 56 ++++++++++++++++++++++++++++++-------------------
 1 file changed, 34 insertions(+), 22 deletions(-)

diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py
index fba68e3..6f443de 100644
--- a/tests/TestSuite_vlan.py
+++ b/tests/TestSuite_vlan.py
@@ -74,12 +74,13 @@ class TestVlan(TestCase):
         self.dut.send_expect("set verbose 1", "testpmd> ")
         out = self.dut.send_expect("set fwd mac", "testpmd> ")
 
-        if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
+        if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single", "redrockcanyou"]:
             self.dut.send_expect("set promisc all off", "testpmd> ")
             self.dut.send_expect("vlan set filter on %s"%dutRxPortId, "testpmd> ")
 
         self.dut.send_expect("vlan set strip off %s" % dutRxPortId, "testpmd> ")
         self.verify('Set mac packet forwarding mode' in out, "set fwd rxonly error")
+        self.vlan = 51
     
     def start_tcpdump(self):
         port = self.tester.get_local_port(dutTxPortId)
@@ -98,16 +99,17 @@ class TestVlan(TestCase):
         # The package stream : testTxPort->dutRxPort->dutTxport->testRxPort
         port = self.tester.get_local_port(dutRxPortId)
         txItf = self.tester.get_interface(port)
+        self.smac = self.tester.get_mac(port)
 
         port = self.tester.get_local_port(dutTxPortId)
         rxItf = self.tester.get_interface(port)
 
         # the package dect mac must is dut tx port id when the port promisc is off
-        mac = self.dut.get_mac_address(dutRxPortId)
+        self.dmac = self.dut.get_mac_address(dutRxPortId)
 
         # FIXME  send a burst with only num packet
 
-        self.tester.scapy_append('sendp([Ether(dst="%s")/Dot1Q(vlan=%s)/IP(len=46)], iface="%s")' % (mac, vid, txItf))
+        self.tester.scapy_append('sendp([Ether(src="%s",dst="%s")/Dot1Q(vlan=%s)/IP(len=46)], iface="%s")' % (self.smac, self.dmac, vid, txItf))
 
         self.tester.scapy_execute()
     def set_up(self):
@@ -120,16 +122,19 @@ class TestVlan(TestCase):
         Enable receipt of VLAN packets
         """
 
-        self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd> ")
+        if self.nic == "redrockcanyou" :
+            print "fm10k not support this case\n"
+            return
+        self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, dutRxPortId), "testpmd> ")
         self.dut.send_expect("vlan set strip off  %s" % dutRxPortId, "testpmd> ")
         self.dut.send_expect("start", "testpmd> ", 120)
         out = self.dut.send_expect("show port info %s" % dutRxPortId, "testpmd> ", 20)
         
         self.start_tcpdump()
-        self.vlan_send_packet(1)
+        self.vlan_send_packet(self.vlan)
         #out = self.tester.scapy_get_result()
         out = self.get_tcpdump_package()
-        self.verify("vlan 1" in out, "Wrong vlan:" + out)
+        self.verify("vlan %d" % self.vlan in out, "Wrong vlan:" + out)
 
         self.dut.send_expect("stop", "testpmd> ")
 
@@ -140,13 +145,15 @@ class TestVlan(TestCase):
         """
 
 
-        self.dut.send_expect("rx_vlan rm 1 %s" % dutRxPortId, "testpmd> ")
+        self.dut.send_expect("rx_vlan rm %d %s" % (self.vlan, dutRxPortId), "testpmd> ")
         self.dut.send_expect("start", "testpmd> ", 120)
         self.start_tcpdump()
-        self.vlan_send_packet(1)
+        self.vlan_send_packet(self.vlan)
 
         out = self.get_tcpdump_package()
-        self.verify("vlan 1" not in out, "Wrong vlan:" + out)
+        # fm10k switch will redirect package if not send to nic
+        if (not((self.nic == "redrockcanyou") and ("%s > %s"%(self.smac, self.dmac) in out))):
+            self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:" + out)
 
         out = self.dut.send_expect("stop", "testpmd> ")
 
@@ -154,45 +161,48 @@ class TestVlan(TestCase):
     def test_vlan_strip_config_on(self):
 
         self.dut.send_expect("vlan set strip on %s" % dutRxPortId, "testpmd> ", 20)
-        self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd> ", 20)
+        self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, dutRxPortId), "testpmd> ", 20)
         out = self.dut.send_expect("show port info %s" % dutRxPortId, "testpmd> ", 20)
         self.verify("strip on" in out, "Wrong strip:" + out)
 
         self.dut.send_expect("start", "testpmd> ", 120)
         self.start_tcpdump()
-        self.vlan_send_packet(1)
+        self.vlan_send_packet(self.vlan)
         out = self.get_tcpdump_package()
-        self.verify("vlan 1" not in out, "Wrong vlan:" + out)
+        self.verify("vlan %d" % self.vlan not in out, "Wrong vlan:" + out)
         out = self.dut.send_expect("quit", "#", 120)
 
     def test_vlan_strip_config_off(self):
 
+        if self.nic == "redrockcanyou" :
+            print "fm10k not support this case\n"
+            return
         self.dut.send_expect("vlan set strip off %s" % dutRxPortId, "testpmd> ", 20)
-        self.dut.send_expect("rx_vlan add 1 %s" % dutRxPortId, "testpmd> ", 20)
+        self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, dutRxPortId), "testpmd> ", 20)
         out = self.dut.send_expect("show port info %s" % dutRxPortId, "testpmd> ", 20)
         self.verify("strip off" in out, "Wrong strip:" + out)
         self.dut.send_expect("set nbport 2", "testpmd> ")
         self.dut.send_expect("start", "testpmd> ", 120)
         self.start_tcpdump()
-        self.vlan_send_packet(1)
+        self.vlan_send_packet(self.vlan)
         out = self.get_tcpdump_package()
-        self.verify("vlan 1" in out, "Wrong strip vlan:" + out)
+        self.verify("vlan %d" % self.vlan in out, "Wrong strip vlan:" + out)
         out = self.dut.send_expect("stop", "testpmd> ", 120)
 
-    def FAILING_test_vlan_enable_vlan_insertion(self):
+    def test_vlan_enable_vlan_insertion(self):
         """
         Enable VLAN header insertion in transmitted packets
         """
 
-        port = self.tester.get_local_port(valports[0])
+        port = self.tester.get_local_port(dutTxPortId,)
         intf = self.tester.get_interface(port)
 
         self.dut.send_expect("set nbport 2", "testpmd> ")
-        self.dut.send_expect("tx_vlan set 1 %s" % valports[0], "testpmd> ")
+        self.dut.send_expect("tx_vlan set %d %s" % (self.vlan, dutTxPortId), "testpmd> ")
 
-        self.dut.send_expect("set promisc all on", "testpmd> ")
+        #self.dut.send_expect("set promisc all on", "testpmd> ")
         if self.nic == 'hartwell':
-            self.dut.send_expect("vlan set strip on %s" % valports[0], "testpmd> ")
+            self.dut.send_expect("vlan set strip on %s" % dutRxPortId, "testpmd> ")
 
         self.tester.scapy_background()
         self.tester.scapy_append('p = sniff(iface="%s", count=1, timeout=5)' % intf)
@@ -205,8 +215,9 @@ class TestVlan(TestCase):
         time.sleep(2)
 
         out = self.tester.scapy_get_result()
-        self.verify("vlan=1L" in out, "Wrong vlan: " + out)
-        if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single"]:
+        self.verify("vlan=%dL" % self.vlan in out, "Wrong vlan: " + out)
+        if self.nic in ["fortville_eagle", "fortville_spirit", "fortville_spirit_single", "redrockcanyou"]:
+            self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> ", 30)
             self.dut.send_expect("stop", "testpmd> ", 30)
         else:
             self.dut.send_expect("quit", "# ", 30)
@@ -217,6 +228,7 @@ class TestVlan(TestCase):
         """
         pass
 
+
     def tear_down_all(self):
         """
         Run after each test suite.
-- 
1.9.3

  parent reply	other threads:[~2015-07-07  9:38 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 ` Michael Qiu [this message]
2015-07-08  1:43   ` [dts] [PATCH 3/3] tests: Add RRC support with vlan suite 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   ` [dts] [PATCH 2/3 v2] tests: Add RRC support in suite scatter Michael Qiu
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=1436261880-22395-4-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).