test suite reviews and discussions
 help / color / mirror / Atom feed
From: Weiyuan Li <weiyuanx.li@intel.com>
To: dts@dpdk.org, qi.fu@intel.com
Cc: Weiyuan Li <weiyuanx.li@intel.com>
Subject: [dts][PATCH V3 2/3] tests/vlan: modify script to match the test plan
Date: Mon,  5 Sep 2022 22:48:51 +0800	[thread overview]
Message-ID: <20220905144852.5158-2-weiyuanx.li@intel.com> (raw)
In-Reply-To: <20220905144852.5158-1-weiyuanx.li@intel.com>

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


  reply	other threads:[~2022-09-05 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 14:48 [dts][PATCH V3 1/3] test_plans/vlan_ethertype_config: highlight check tpid point in " Weiyuan Li
2022-09-05 14:48 ` Weiyuan Li [this message]
2022-09-05 14:48 ` [dts][PATCH V3 3/3] tests/vlan_ethertype_config: modify case name to match " Weiyuan Li
2022-09-06  8:02   ` lijuan.tu

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=20220905144852.5158-2-weiyuanx.li@intel.com \
    --to=weiyuanx.li@intel.com \
    --cc=dts@dpdk.org \
    --cc=qi.fu@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).