* [dts] [PATCH] tests: remove a test case from TestSuite_vlan.py
@ 2019-06-26 10:15 Peng Yuan
2019-07-10 6:30 ` Tu, Lijuan
0 siblings, 1 reply; 2+ messages in thread
From: Peng Yuan @ 2019-06-26 10:15 UTC (permalink / raw)
To: dts; +Cc: Peng Yuan
Remove a test case from TestSuite_vlan.py
Signed-off-by: Peng Yuan <yuan.peng@intel.com>
diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py
index 4bf0ae8..421efc6 100644
--- a/tests/TestSuite_vlan.py
+++ b/tests/TestSuite_vlan.py
@@ -73,14 +73,10 @@ class TestVlan(TestCase):
self.pmdout.start_testpmd("Default", "--portmask=%s --port-topology=loop" % portMask)
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", "fortpark_TLV", "fortville_25g"]:
- self.dut.send_expect("vlan set filter on %s" % dutRxPortId, "testpmd> ")
- self.dut.send_expect("set promisc all off", "testpmd> ")
-
+ self.dut.send_expect("set fwd mac", "testpmd> ")
+ 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
if self.kdriver == "fm10k":
@@ -97,7 +93,7 @@ class TestVlan(TestCase):
def vlan_send_packet(self, vid, num=1):
"""
- Send $num of packet to portid, if vid is -1, it means send pakcage not include vlan id.
+ Send $num of packets to portid, if vid is -1, it means send a packet which does not include a vlan id.
"""
# The package stream : testTxPort->dutRxPort->dutTxport->testRxPort
port = self.tester.get_local_port(dutRxPortId)
@@ -128,9 +124,9 @@ class TestVlan(TestCase):
"""
pass
- def test_vlan_enable_receipt(self):
+ def test_vlan_enable_receipt_strip_off(self):
"""
- Enable receipt of VLAN packets
+ Enable receipt of VLAN packets and strip off
"""
if self.kdriver == "fm10k":
@@ -140,18 +136,24 @@ class TestVlan(TestCase):
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.verify("strip off" in out, "Wrong strip:" + out)
self.vlan_send_packet(self.vlan)
out = self.get_tcpdump_package()
self.verify(self.vlan in out, "Wrong vlan:" + str(out))
+ notmatch_vlan = self.vlan + 1
+ self.vlan_send_packet(notmatch_vlan)
+ out = self.get_tcpdump_package()
+ self.verify(len(out) == 0, "Received unexpected packet, filter not work!!!")
+ self.verify(notmatch_vlan not in out, "Wrong vlan:" + str(out))
+
self.dut.send_expect("stop", "testpmd> ")
def test_vlan_disable_receipt(self):
"""
Disable receipt of VLAN packets
"""
- self.dut.send_expect("vlan set filter on %s" % dutRxPortId, "testpmd> ")
self.dut.send_expect("rx_vlan rm %d %s" % (self.vlan, dutRxPortId), "testpmd> ")
self.dut.send_expect("start", "testpmd> ", 120)
@@ -161,9 +163,12 @@ class TestVlan(TestCase):
self.verify(len(out) == 0, "Received unexpected packet, filter not work!!!")
self.verify(self.vlan not in out, "Wrong vlan:" + str(out))
- out = self.dut.send_expect("stop", "testpmd> ")
+ self.dut.send_expect("stop", "testpmd> ")
- def test_vlan_strip_config_on(self):
+ def test_vlan_enable_receipt_strip_on(self):
+ """
+ Enable receipt of VLAN packets and strip on
+ """
self.dut.send_expect("vlan set strip on %s" % dutRxPortId, "testpmd> ", 20)
self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, dutRxPortId), "testpmd> ", 20)
@@ -175,23 +180,8 @@ class TestVlan(TestCase):
out = self.get_tcpdump_package()
self.verify(len(out), "Forwarded vlan packet not received!!!")
self.verify(self.vlan not in out, "Wrong vlan:" + str(out))
- out = self.dut.send_expect("stop", "testpmd> ", 120)
-
- def test_vlan_strip_config_off(self):
-
- if self.kdriver == "fm10k":
- print utils.RED("fm10k not support this case\n")
- return
+ self.dut.send_expect("stop", "testpmd> ", 120)
self.dut.send_expect("vlan set strip off %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.vlan_send_packet(self.vlan)
- out = self.get_tcpdump_package()
- self.verify(self.vlan in out, "Vlan not found:" + str(out))
- out = self.dut.send_expect("stop", "testpmd> ", 120)
def test_vlan_enable_vlan_insertion(self):
"""
@@ -202,10 +192,6 @@ class TestVlan(TestCase):
netobj.add_vlan(vlan_id = self.vlan)
netobj.add_txvlan(vlan_id = self.vlan)
- 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("stop", "testpmd> ")
self.dut.send_expect("port stop all", "testpmd> ")
self.dut.send_expect("tx_vlan set %s %d" % (dutTxPortId, self.vlan), "testpmd> ")
--
2.14.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dts] [PATCH] tests: remove a test case from TestSuite_vlan.py
2019-06-26 10:15 [dts] [PATCH] tests: remove a test case from TestSuite_vlan.py Peng Yuan
@ 2019-07-10 6:30 ` Tu, Lijuan
0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2019-07-10 6:30 UTC (permalink / raw)
To: Peng, Yuan, dts; +Cc: Peng, Yuan
Applying: tests: remove a test case from TestSuite_vlan.py
error: patch failed: tests/TestSuite_vlan.py:73
error: tests/TestSuite_vlan.py: patch does not apply
Patch failed at 0001 tests: remove a test case from TestSuite_vlan.py
> -----Original Message-----
> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Peng Yuan
> Sent: Wednesday, June 26, 2019 6:16 PM
> To: dts@dpdk.org
> Cc: Peng, Yuan <yuan.peng@intel.com>
> Subject: [dts] [PATCH] tests: remove a test case from TestSuite_vlan.py
>
> Remove a test case from TestSuite_vlan.py
>
> Signed-off-by: Peng Yuan <yuan.peng@intel.com>
>
> diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py index
> 4bf0ae8..421efc6 100644
> --- a/tests/TestSuite_vlan.py
> +++ b/tests/TestSuite_vlan.py
> @@ -73,14 +73,10 @@ class TestVlan(TestCase):
> self.pmdout.start_testpmd("Default", "--portmask=%s --port-
> topology=loop" % portMask)
>
> 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",
> "fortpark_TLV", "fortville_25g"]:
> - self.dut.send_expect("vlan set filter on %s" % dutRxPortId, "testpmd>
> ")
> - self.dut.send_expect("set promisc all off", "testpmd> ")
> -
> + self.dut.send_expect("set fwd mac", "testpmd> ")
> + 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
>
> if self.kdriver == "fm10k":
> @@ -97,7 +93,7 @@ class TestVlan(TestCase):
>
> def vlan_send_packet(self, vid, num=1):
> """
> - Send $num of packet to portid, if vid is -1, it means send pakcage not
> include vlan id.
> + Send $num of packets to portid, if vid is -1, it means send a packet
> which does not include a vlan id.
> """
> # The package stream : testTxPort->dutRxPort->dutTxport->testRxPort
> port = self.tester.get_local_port(dutRxPortId)
> @@ -128,9 +124,9 @@ class TestVlan(TestCase):
> """
> pass
>
> - def test_vlan_enable_receipt(self):
> + def test_vlan_enable_receipt_strip_off(self):
> """
> - Enable receipt of VLAN packets
> + Enable receipt of VLAN packets and strip off
> """
>
> if self.kdriver == "fm10k":
> @@ -140,18 +136,24 @@ class TestVlan(TestCase):
> 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.verify("strip off" in out, "Wrong strip:" + out)
>
> self.vlan_send_packet(self.vlan)
> out = self.get_tcpdump_package()
> self.verify(self.vlan in out, "Wrong vlan:" + str(out))
>
> + notmatch_vlan = self.vlan + 1
> + self.vlan_send_packet(notmatch_vlan)
> + out = self.get_tcpdump_package()
> + self.verify(len(out) == 0, "Received unexpected packet, filter not
> work!!!")
> + self.verify(notmatch_vlan not in out, "Wrong vlan:" + str(out))
> +
> self.dut.send_expect("stop", "testpmd> ")
>
> def test_vlan_disable_receipt(self):
> """
> Disable receipt of VLAN packets
> """
> - self.dut.send_expect("vlan set filter on %s" % dutRxPortId, "testpmd> ")
>
> self.dut.send_expect("rx_vlan rm %d %s" % (self.vlan, dutRxPortId),
> "testpmd> ")
> self.dut.send_expect("start", "testpmd> ", 120) @@ -161,9 +163,12 @@
> class TestVlan(TestCase):
> self.verify(len(out) == 0, "Received unexpected packet, filter not
> work!!!")
> self.verify(self.vlan not in out, "Wrong vlan:" + str(out))
>
> - out = self.dut.send_expect("stop", "testpmd> ")
> + self.dut.send_expect("stop", "testpmd> ")
>
> - def test_vlan_strip_config_on(self):
> + def test_vlan_enable_receipt_strip_on(self):
> + """
> + Enable receipt of VLAN packets and strip on
> + """
>
> self.dut.send_expect("vlan set strip on %s" % dutRxPortId, "testpmd> ",
> 20)
> self.dut.send_expect("rx_vlan add %d %s" % (self.vlan, dutRxPortId),
> "testpmd> ", 20) @@ -175,23 +180,8 @@ class TestVlan(TestCase):
> out = self.get_tcpdump_package()
> self.verify(len(out), "Forwarded vlan packet not received!!!")
> self.verify(self.vlan not in out, "Wrong vlan:" + str(out))
> - out = self.dut.send_expect("stop", "testpmd> ", 120)
> -
> - def test_vlan_strip_config_off(self):
> -
> - if self.kdriver == "fm10k":
> - print utils.RED("fm10k not support this case\n")
> - return
> + self.dut.send_expect("stop", "testpmd> ", 120)
> self.dut.send_expect("vlan set strip off %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.vlan_send_packet(self.vlan)
> - out = self.get_tcpdump_package()
> - self.verify(self.vlan in out, "Vlan not found:" + str(out))
> - out = self.dut.send_expect("stop", "testpmd> ", 120)
>
> def test_vlan_enable_vlan_insertion(self):
> """
> @@ -202,10 +192,6 @@ class TestVlan(TestCase):
> netobj.add_vlan(vlan_id = self.vlan)
> netobj.add_txvlan(vlan_id = self.vlan)
>
> - 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("stop", "testpmd> ")
> self.dut.send_expect("port stop all", "testpmd> ")
> self.dut.send_expect("tx_vlan set %s %d" % (dutTxPortId, self.vlan),
> "testpmd> ")
> --
> 2.14.3
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-10 6:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 10:15 [dts] [PATCH] tests: remove a test case from TestSuite_vlan.py Peng Yuan
2019-07-10 6:30 ` Tu, Lijuan
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).