test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 0/2] Add a new case to PF and VF gtpogre
@ 2021-04-12  8:56 Xiang An
  2021-04-12  8:56 ` [dts] [PATCH V1 1/2] tests/cvl_advanced_rss_gtpogre: add a new case Xiang An
  2021-04-12  8:56 ` [dts] [PATCH V1 2/2] tests/cvl_advanced_iavf_rss_gtpogre: " Xiang An
  0 siblings, 2 replies; 3+ messages in thread
From: Xiang An @ 2021-04-12  8:56 UTC (permalink / raw)
  To: dts; +Cc: Xiang An

Add a new case: test_parse_pfcp_over_gre_packet

Xiang An (2):
  tests/cvl_advanced_rss_gtpogre: add a new case ...
  tests/cvl_advanced_iavf_rss_gtpogre: add a new case ...

 tests/TestSuite_cvl_advanced_iavf_rss_gtpogre.py | 52 ++++++++++++++++++++++++
 tests/TestSuite_cvl_advanced_rss_gtpogre.py      | 52 ++++++++++++++++++++++++
 2 files changed, 104 insertions(+)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dts] [PATCH V1 1/2] tests/cvl_advanced_rss_gtpogre: add a new case ...
  2021-04-12  8:56 [dts] [PATCH V1 0/2] Add a new case to PF and VF gtpogre Xiang An
@ 2021-04-12  8:56 ` Xiang An
  2021-04-12  8:56 ` [dts] [PATCH V1 2/2] tests/cvl_advanced_iavf_rss_gtpogre: " Xiang An
  1 sibling, 0 replies; 3+ messages in thread
From: Xiang An @ 2021-04-12  8:56 UTC (permalink / raw)
  To: dts; +Cc: Xiang An

Add a new case: test_parse_pfcp_over_gre_packet

Signed-off-by: Xiang An <xiangx.an@intel.com>
---
 tests/TestSuite_cvl_advanced_rss_gtpogre.py | 52 +++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/tests/TestSuite_cvl_advanced_rss_gtpogre.py b/tests/TestSuite_cvl_advanced_rss_gtpogre.py
index 4a889ea..9f3f258 100755
--- a/tests/TestSuite_cvl_advanced_rss_gtpogre.py
+++ b/tests/TestSuite_cvl_advanced_rss_gtpogre.py
@@ -3502,8 +3502,60 @@ class TestCVLAdvancedRSSGTPoGRE(TestCase):
     def test_inner_l4_protocal_hash(self):
         self.switch_testpmd(enable_rss=True)
         self.rssprocess.handle_rss_distribute_cases(cases_info=inner_l4_protocal_hash)
+    
+    def change_dpdk_code(self):
+        """
+            change dpdk's code to show the PFCP ptype
+        """
+        file_location = "drivers/net/ice/ice_rxtx.c"
+        match1 = "rte_le_to_cpu_16(rxdp\[j\].wb.ptype_flex_flags0)\];"
+        match2 = "ice_set_rx_function(struct rte_eth_dev \*dev)"
+        insert1 = "printf(\"ptype: %3d\\\\n\", ICE_RX_FLEX_DESC_PTYPE_M & rte_le_to_cpu_16(rxdp\[j\].wb.ptype_flex_flags0));"
+        insert2 = "#endif"
+        insert3 = "#if 0"
+        
+        self.dut.send_expect("rm -rf drivers/net/ice/ice_rxtx.c_bak", "# ")
+        self.dut.send_expect("cp -rf drivers/net/ice/ice_rxtx.c drivers/net/ice/ice_rxtx.c_bak", "# ")
+        self.dut.send_expect("sed -i '/%s/a\%s' %s"%(match1,insert1,file_location), "# ")
+        self.dut.send_expect("sed -i '/%s/{n;n;n;n;n;s|$|\\n%s|}' %s" % (match2, insert2, file_location), "# ")
+        self.dut.send_expect("sed -i '/%s/{n;n;n;n;n;n;s|$|\\n%s|}' %s" % (match2, insert3, file_location), "# ")
+
+    def recovery_dpdk_code(self):
+        """
+             Recovery dpdk's code after the case finished
+        """
+        self.dut.send_expect("rm -rf drivers/net/ice/ice_rxtx.c", "# ")
+        self.dut.send_expect("cp -rf drivers/net/ice/ice_rxtx.c_bak drivers/net/ice/ice_rxtx.c", "# ")
+    
+    def test_parse_pfcp_over_gre_packet(self):
+        self.pmd_output.quit()
+        self.change_dpdk_code()
+        self.dut.build_install_dpdk(self.dut.target)
+
+        pkt1 = 'Ether(dst="00:11:22:33:44:55")/IP(proto=0x2F)/GRE(proto=0x0800)/IP()/UDP(sport=22, dport=8805)/PFCP(S=0)'
+        pkt2 = 'Ether(dst="00:11:22:33:44:55")/IP(proto=0x2F)/GRE(proto=0x0800)/IP()/UDP(sport=22, dport=8805)/PFCP(S=1, seid=123)'
+        pkt3 = 'Ether(dst="00:11:22:33:44:55")/IPv6(nh=0x2F)/GRE(proto=0x86dd)/IPv6()/UDP(sport=22, dport=8805)/PFCP(S=0)'
+        pkt4 = 'Ether(dst="00:11:22:33:44:55")/IPv6(nh=0x2F)/GRE(proto=0x86dd)/IPv6()/UDP(sport=22, dport=8805)/PFCP(S=1, seid=256)'
+        pkts = [pkt1, pkt2, pkt3, pkt4]
+        p = Packet()
+        for i in pkts:
+            p.append_pkt(i)
+        self.switch_testpmd(enable_rss=True)
+        p.send_pkt(self.tester, tx_port=self.tester_iface0)
+        out = self.pmd_output.get_output(timeout=1)
+        
+        self.verify('ptype: 351' in out,'some subcase failed')
+        self.verify('ptype: 352' in out,'some subcase failed')
+        self.verify('ptype: 353' in out,'some subcase failed')
+        self.verify('ptype: 354' in out,'some subcase failed')
 
     def tear_down(self):
+        #Judge the currently running case
+        if self.running_case == "test_parse_pfcp_over_gre_packet" :
+            self.pmd_output.quit()
+            self.recovery_dpdk_code()
+            self.dut.build_install_dpdk(self.dut.target)
+            self.switch_testpmd(enable_rss=False)
         # destroy all flow rule on port 0
         self.dut.send_command("flow flush 0", timeout=1)
         self.dut.send_command("clear port stats all", timeout=1)
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dts] [PATCH V1 2/2] tests/cvl_advanced_iavf_rss_gtpogre: add a new case ...
  2021-04-12  8:56 [dts] [PATCH V1 0/2] Add a new case to PF and VF gtpogre Xiang An
  2021-04-12  8:56 ` [dts] [PATCH V1 1/2] tests/cvl_advanced_rss_gtpogre: add a new case Xiang An
@ 2021-04-12  8:56 ` Xiang An
  1 sibling, 0 replies; 3+ messages in thread
From: Xiang An @ 2021-04-12  8:56 UTC (permalink / raw)
  To: dts; +Cc: Xiang An

Add a new case: test_parse_pfcp_over_gre_packet

Signed-off-by: Xiang An <xiangx.an@intel.com>
---
 tests/TestSuite_cvl_advanced_iavf_rss_gtpogre.py | 52 ++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/tests/TestSuite_cvl_advanced_iavf_rss_gtpogre.py b/tests/TestSuite_cvl_advanced_iavf_rss_gtpogre.py
index 5d5d7ee..ddf7ace 100755
--- a/tests/TestSuite_cvl_advanced_iavf_rss_gtpogre.py
+++ b/tests/TestSuite_cvl_advanced_iavf_rss_gtpogre.py
@@ -2532,7 +2532,59 @@ class TestCVLAdvancedIAVFRSSGTPoGRE(TestCase):
         self.switch_testpmd(symmetric=True)
         self.rssprocess.handle_rss_distribute_cases(cases_info=inner_l4_protocal_hash)
 
+    def change_dpdk_code(self):
+        """
+            change dpdk's code to show the PFCP ptype
+        """
+        file_location = "drivers/net/iavf/iavf_rxtx.c"
+        match1 = "rte_le_to_cpu_16(rxdp\[j\].wb.ptype_flex_flags0)\];"
+        match2 = "iavf_set_rx_function(struct rte_eth_dev \*dev)"
+        insert1 = "printf(\"ptype: %3d\\\\n\", IAVF_RX_FLEX_DESC_PTYPE_M & rte_le_to_cpu_16(rxdp\[j\].wb.ptype_flex_flags0));"
+        insert2 = "#endif"
+        insert3 = "#if 0"
+
+        self.dut.send_expect("rm -rf drivers/net/iavf/iavf_rxtx.c_bak", "# ")
+        self.dut.send_expect("cp -rf drivers/net/iavf/iavf_rxtx.c drivers/net/iavf/iavf_rxtx.c_bak", "# ")
+        self.dut.send_expect("sed -i '/%s/a\%s' %s" % (match1, insert1, file_location), "# ")
+        self.dut.send_expect("sed -i '/%s/{n;n;n;n;n;n;s|$|\\n%s|}' %s" % (match2, insert2, file_location), "# ")
+        self.dut.send_expect("sed -i '/%s/{n;n;n;n;n;n;n;s|$|\\n%s|}' %s" % (match2, insert3, file_location), "# ")
+
+    def recovery_dpdk_code(self):
+        """
+             Recovery dpdk's code after the case finished
+        """
+        self.dut.send_expect("rm -rf drivers/net/iavf/iavf_rxtx.c", "# ")
+        self.dut.send_expect("cp -rf drivers/net/iavf/iavf_rxtx.c_bak drivers/net/iavf/iavf_rxtx.c", "# ")
+
+    def test_parse_pfcp_over_gre_packet(self):
+        self.pmd_output.quit()
+        self.change_dpdk_code()
+        self.dut.build_install_dpdk(self.dut.target)
+
+        pkt1 = 'Ether(dst="00:11:22:33:44:55")/IP(proto=0x2F)/GRE(proto=0x0800)/IP()/UDP(sport=22, dport=8805)/PFCP(S=0)'
+        pkt2 = 'Ether(dst="00:11:22:33:44:55")/IP(proto=0x2F)/GRE(proto=0x0800)/IP()/UDP(sport=22, dport=8805)/PFCP(S=1, seid=123)'
+        pkt3 = 'Ether(dst="00:11:22:33:44:55")/IPv6(nh=0x2F)/GRE(proto=0x86dd)/IPv6()/UDP(sport=22, dport=8805)/PFCP(S=0)'
+        pkt4 = 'Ether(dst="00:11:22:33:44:55")/IPv6(nh=0x2F)/GRE(proto=0x86dd)/IPv6()/UDP(sport=22, dport=8805)/PFCP(S=1, seid=256)'
+        pkts = [pkt1, pkt2, pkt3, pkt4]
+        p = Packet()
+        for i in pkts:
+            p.append_pkt(i)
+        self.switch_testpmd(symmetric=True)
+        p.send_pkt(self.tester, tx_port=self.tester_iface0)
+        out = self.pmd_output.get_output(timeout=1)
+
+        self.verify('ptype: 351' in out, 'some subcase failed')
+        self.verify('ptype: 352' in out, 'some subcase failed')
+        self.verify('ptype: 353' in out, 'some subcase failed')
+        self.verify('ptype: 354' in out, 'some subcase failed')
+
     def tear_down(self):
+        # Judge the currently running case
+        if self.running_case == "test_parse_pfcp_over_gre_packet":
+            self.pmd_output.quit()
+            self.recovery_dpdk_code()
+            self.dut.build_install_dpdk(self.dut.target)
+            self.switch_testpmd(symmetric=True)
         # destroy all flow rule on port 0
         self.dut.send_command("flow flush 0", timeout=1)
         self.dut.send_command("clear port stats all", timeout=1)
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-12  8:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-12  8:56 [dts] [PATCH V1 0/2] Add a new case to PF and VF gtpogre Xiang An
2021-04-12  8:56 ` [dts] [PATCH V1 1/2] tests/cvl_advanced_rss_gtpogre: add a new case Xiang An
2021-04-12  8:56 ` [dts] [PATCH V1 2/2] tests/cvl_advanced_iavf_rss_gtpogre: " Xiang An

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git