* [dts][PATCH V3 2/3] tests/vlan: modify script to match the test plan
2022-09-05 14:48 [dts][PATCH V3 1/3] test_plans/vlan_ethertype_config: highlight check tpid point in test plan Weiyuan Li
@ 2022-09-05 14:48 ` Weiyuan Li
2022-09-05 14:48 ` [dts][PATCH V3 3/3] tests/vlan_ethertype_config: modify case name to match " Weiyuan Li
1 sibling, 0 replies; 4+ messages in thread
From: Weiyuan Li @ 2022-09-05 14:48 UTC (permalink / raw)
To: dts, qi.fu; +Cc: Weiyuan Li
Modify script use tx_first to send pkts match the test plan.
Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
tests/TestSuite_vlan.py | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/tests/TestSuite_vlan.py b/tests/TestSuite_vlan.py
index b2889ae2..27e9a30c 100644
--- a/tests/TestSuite_vlan.py
+++ b/tests/TestSuite_vlan.py
@@ -31,6 +31,10 @@ class TestVlan(TestCase):
# Based on h/w type, choose how many ports to use
ports = self.dut.get_ports()
+ self.dut_ports = self.dut.get_ports(self.nic)
+ self.used_dut_port_0 = self.dut_ports[0]
+ self.tester_intf_0 = self.tester.get_interface(self.used_dut_port_0)
+
# Verify that enough ports are available
self.verify(len(ports) >= 1, "Insufficient ports")
@@ -159,11 +163,19 @@ class TestVlan(TestCase):
)
self.dut.send_expect("port start all", "testpmd> ")
- self.dut.send_expect("start", "testpmd> ")
- self.vlan_send_packet(-1)
-
- out = self.get_tcpdump_package()
- self.verify(self.vlan in out, "Vlan not found:" + str(out))
+ filter = [{"layer": "ether", "config": {"dst": "not ff:ff:ff:ff:ff:ff"}}]
+ inst = self.tester.tcpdump_sniff_packets(
+ intf=self.tester_intf_0,
+ filters=filter,
+ )
+ self.dut.send_expect("set nbport 1", "testpmd> ")
+ self.dut.send_expect("start tx_first", "testpmd> ")
+ pkts = self.tester.load_tcpdump_sniff_packets(inst)
+ self.verify(len(pkts) > 0, f"no packets received.")
+ self.verify(
+ self.vlan == pkts[0].vlan,
+ f"Vlan id {self.vlan} is not found in the packet.",
+ )
self.dut.send_expect("stop", "testpmd> ")
self.dut.send_expect("port stop all", "testpmd> ")
self.dut.send_expect("tx_vlan reset %s" % dutTxPortId, "testpmd> ", 30)
--
2.27.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dts][PATCH V3 3/3] tests/vlan_ethertype_config: modify case name to match test plan
2022-09-05 14:48 [dts][PATCH V3 1/3] test_plans/vlan_ethertype_config: highlight check tpid point in test plan Weiyuan Li
2022-09-05 14:48 ` [dts][PATCH V3 2/3] tests/vlan: modify script to match the " Weiyuan Li
@ 2022-09-05 14:48 ` Weiyuan Li
2022-09-06 8:02 ` lijuan.tu
1 sibling, 1 reply; 4+ messages in thread
From: Weiyuan Li @ 2022-09-05 14:48 UTC (permalink / raw)
To: dts, qi.fu; +Cc: Weiyuan Li
Modify test case name to match test plan.
Signed-off-by: Weiyuan Li <weiyuanx.li@intel.com>
---
tests/TestSuite_vlan_ethertype_config.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/TestSuite_vlan_ethertype_config.py b/tests/TestSuite_vlan_ethertype_config.py
index 409adf2a..b641d928 100644
--- a/tests/TestSuite_vlan_ethertype_config.py
+++ b/tests/TestSuite_vlan_ethertype_config.py
@@ -202,7 +202,7 @@ class TestVlanEthertypeConfig(TestCase):
)
self.check_vlan_packets(rx_vlan, tpid, self.rxItf)
- def test_vlan_add_vlan_tag(self):
+ def test_add_vlan_tag_identifier_with_change_vlan_tpid(self):
"""
test adding VLAN Tag Identifier with changing VLAN TPID
"""
@@ -235,7 +235,7 @@ class TestVlanEthertypeConfig(TestCase):
self.dut.send_expect("stop", "testpmd> ", 30)
- def test_vlan_strip(self):
+ def test_vlan_header_strip_with_change_vlan_tpid(self):
"""
Test Case 4: test VLAN header striping with changing VLAN TPID
"""
@@ -265,7 +265,7 @@ class TestVlanEthertypeConfig(TestCase):
)
self.check_vlan_packets(rx_vlan, tpid, self.rxItf)
- def test_vlan_enable_vlan_insertion(self):
+ def test_vlan_header_insert_with_change_vlan_tpid(self):
"""
Test Case 5: test VLAN header inserting with changing VLAN TPID
"""
--
2.27.0
^ permalink raw reply [flat|nested] 4+ messages in thread