test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case
@ 2022-09-05 18:51 Jiale Song
  2022-09-05 18:51 ` [dts] [PATCH V2 2/2] tests/ice_switch_filter: " Jiale Song
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jiale Song @ 2022-09-05 18:51 UTC (permalink / raw)
  To: dts; +Cc: Jiale Song

add case to test the rule of l2 mask and l3 mask.

Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 test_plans/ice_switch_filter_test_plan.rst | 189 +++++++++++++++++++++
 1 file changed, 189 insertions(+)

diff --git a/test_plans/ice_switch_filter_test_plan.rst b/test_plans/ice_switch_filter_test_plan.rst
index 6ea6843c..c85e7fc9 100644
--- a/test_plans/ice_switch_filter_test_plan.rst
+++ b/test_plans/ice_switch_filter_test_plan.rst
@@ -5632,3 +5632,192 @@ subcase 3: pipeline mode
 7. create rule, check the rule can not be created::
 
     testpmd> flow create 0 priority 1 ingress pattern any / end actions queue index 4 / end
+
+Test case: L3 mask
+=======================
+
+subcase 1: ipv4 dst + mask + queue action
+-----------------------------------------
+
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions queue index 12 / end
+
+   get the message::
+
+     Flow rule validated
+
+   check the flow list::
+
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+
+2. create a rule::
+
+     testpmd> flow create 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions queue index 12 / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether()/IP(src="192.168.0.1", dst="239.255.255.255")/UDP()/Raw("x"*80), iface="enp27s0f0", count=1),
+
+   check all the packets received by queue 12.
+   send mismatched packets::
+
+     sendp(Ether()/IP(src="192.168.0.1", dst="223.0.0.0")/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether()/IP(src="192.168.0.1", dst="240.0.0.0")/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether()/IP(src="192.168.0.1", dst="128.0.0.0")/Raw("x"*80)], iface="enp27s0f0", count=1)
+
+   check all the packets can't received by queue 12.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets can't received by queue 12.
+
+subcase 2: ipv6 src + mask + drop action
+----------------------------------------
+
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth / ipv6 src spec CDCD:910A:2222:5498:8475:1111:3900:2023 src mask ffff:ffff:ffff:ffff:0:0:0:0 / end actions drop / end
+
+   get the message::
+
+     Flow rule validated
+
+   check the flow list::
+
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+
+2. create a rule::
+
+     testpmd> flow create 0 ingress pattern eth / ipv6 src spec CDCD:910A:2222:5498:8475:1111:3900:2023 src mask ffff:ffff:ffff:ffff:0:0:0:0 / end actions drop / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDCD:910A:2222:5498:ffff:ffff:ffff:ffff")/TCP()/("X"*480), iface="enp27s0f0", count=1),
+
+   check all the packets are dropped.
+   send mismatched packets::
+
+     sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="CDCD:910A:2222:ffff:8475:1111:3900:2023")/("X"*480), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="CFCD:910A:ffff:5498:8475:1111:3900:2023")/UDP()/("X"*480), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="CDCD:ffff:2222:5498:8475:1111:3900:1515")/TCP()/("X"*480), iface="enp27s0f0", count=1)
+	 sendp(Ether(dst="00:00:5e:00:00:01")/IPv6(src="ffff:910A:2222:5498:8475:1111:3900:1515")/TCP()/("X"*480), iface="enp27s0f0", count=1)
+
+   check all the packets are not dropped.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets are not dropped.
+
+Test case: L2 mask
+=======================
+
+subcase 1: mac dst + mask + queue action
+----------------------------------------
+
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth dst spec 00:00:5e:00:00:00 dst mask ff:ff:ff:80:00:00 / end actions queue index 12 / end
+
+   get the message::
+
+     Flow rule validated
+
+   check the flow list::
+
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+
+2. create a rule::
+
+     testpmd> flow create 0 ingress pattern eth dst spec 00:00:5e:00:00:00 dst mask ff:ff:ff:80:00:00 / end actions queue index 12 / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether(src="00:00:5e:00:00:01", dst="00:00:5e:7f:ff:ff")/IP()/UDP()/Raw("x"*80)), iface="enp27s0f0", count=1)
+
+   check all the packets received by queue 12.
+   send mismatched packets::
+
+     sendp(Ether(dst="00:00:5e:80:00:00")/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="00:00:ff:00:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="00:ff:5e:00:00:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(dst="ff:00:5e:00:00:00")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+
+   check all the packets can't receive by queue 12.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets can't receive by queue 12.
+
+subcase 2: mac src + mask + drop action
+---------------------------------------
+
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth src spec 00:00:5e:00:00:00 src mask ff:ff:ff:80:00:00 / end actions drop / end
+
+   get the message::
+
+     Flow rule validated
+
+   check the flow list::
+
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+
+2. create a rule::
+
+     testpmd> flow create 0 ingress pattern eth src spec 00:00:5e:00:00:00 src mask ff:ff:ff:80:00:00 / end actions drop / end
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets::
+
+     sendp(Ether(dst="00:00:5e:00:00:01", src="00:00:5e:7f:ff:ff")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+
+   check all the packets are dropped.
+   send mismatched packets::
+
+     sendp(Ether(src="00:00:5e:80:00:00")/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="00:00:ff:00:00:00")/IP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="00:ff:5e:00:00:00")/IP()/TCP()/Raw("x"*80), iface="enp27s0f0", count=1)
+     sendp(Ether(src="ff:00:5e:00:00:00")/IP()/UDP()/Raw("x"*80), iface="enp27s0f0", count=1)
+
+   check all the packets are not dropped.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 0
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check all the packets are not dropped.
\ No newline at end of file
-- 
2.25.1


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

* [dts] [PATCH V2 2/2] tests/ice_switch_filter: add 2 case
  2022-09-05 18:51 [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case Jiale Song
@ 2022-09-05 18:51 ` Jiale Song
  2022-09-07  5:00   ` Peng, Yuan
  2022-09-07  4:59 ` [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: " Peng, Yuan
  2022-09-08  1:53 ` lijuan.tu
  2 siblings, 1 reply; 5+ messages in thread
From: Jiale Song @ 2022-09-05 18:51 UTC (permalink / raw)
  To: dts; +Cc: Jiale Song

add case test_l2_mask and test_l3_mask.

Signed-off-by: Jiale Song <songx.jiale@intel.com>
---
 tests/TestSuite_ice_switch_filter.py | 159 ++++++++++++++++++++++++++-
 1 file changed, 158 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_ice_switch_filter.py b/tests/TestSuite_ice_switch_filter.py
index c9c5b17f..78418568 100644
--- a/tests/TestSuite_ice_switch_filter.py
+++ b/tests/TestSuite_ice_switch_filter.py
@@ -4169,6 +4169,151 @@ drop_any_pkt_list = [
     "Ether(dst='68:05:CA:BB:26:E0')/IP()/UDP(dport=2152)/GTP_U_Header(gtp_type=255, teid=0x123456)/GTPPDUSessionContainer(type=0, P=1, QFI=0x34)/IP(dst='192.168.0.1', src='192.168.0.2')/UDP(sport=22, dport=33)/('X'*480)",
 ]
 
+IP_MASK = {
+    "matched": [
+        'Ether()/IP(src="192.168.0.1", dst="239.255.255.255")/UDP()/Raw("x"*80)',
+    ],
+    "mismatched": [
+        'Ether()/IP(src="192.168.0.1", dst="223.0.0.0")/TCP()/Raw("x"*80)',
+        'Ether()/IP(src="192.168.0.1", dst="240.0.0.0")/UDP()/Raw("x"*80)',
+        'Ether()/IP(src="192.168.0.1", dst="128.0.0.0")/Raw("x"*80)',
+    ],
+}
+
+tv_ip_dst_mask_quest = {
+    "name": "tv_ip_dst_mask",
+    "rte_flow_pattern": "flow create 0 ingress pattern eth / ipv4 dst spec 224.0.0.0 dst mask 240.0.0.0 / end actions queue index 12 / end",
+    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
+    "matched": {
+        "scapy_str": IP_MASK["matched"],
+        "check_func": {
+            "func": rfc.check_output_log_in_queue,
+            "param": {"expect_port": 0, "expect_queues": 12},
+        },
+        "expect_results": {"expect_pkts": len(IP_MASK["matched"])},
+    },
+    "mismatched": {
+        "scapy_str": IP_MASK["mismatched"],
+        "check_func": {
+            "func": rfc.check_output_log_in_queue_mismatched,
+            "param": {"expect_port": 0, "expect_queues": 12},
+        },
+        "expect_results": {"expect_pkts": len(IP_MASK["mismatched"])},
+    },
+}
+
+IPv6_MASK = {
+    "matched": [
+        'Ether(dst="00:00:5e:00:00:01")/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDCD:910A:2222:5498:ffff:ffff:ffff:ffff")/TCP()/("X"*480)',
+    ],
+    "mismatched": [
+        'Ether(dst="00:00:5e:00:00:01")/IPv6(src="CDCD:910A:2222:ffff:8475:1111:3900:2023")/("X"*480)',
+        'Ether(dst="00:00:5e:00:00:01")/IPv6(src="CFCD:910A:ffff:5498:8475:1111:3900:2023")/UDP()/("X"*480)',
+        'Ether(dst="00:00:5e:00:00:01")/IPv6(src="CDCD:ffff:2222:5498:8475:1111:3900:1515")/TCP()/("X"*480)',
+        'Ether(dst="00:00:5e:00:00:01")/IPv6(src="ffff:910A:2222:5498:8475:1111:3900:1515")/TCP()/("X"*480)',
+    ],
+}
+
+tv_ipv6_src_mask_drop = {
+    "name": "tv_ipv6_src_mask",
+    "rte_flow_pattern": "flow create 0 ingress pattern eth / ipv6 src spec CDCD:910A:2222:5498:8475:1111:3900:2023 src mask ffff:ffff:ffff:ffff:0:0:0:0 / end actions drop / end",
+    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
+    "matched": {
+        "scapy_str": IPv6_MASK["matched"],
+        "check_func": {
+            "func": rfc.check_output_log_drop,
+            "param": {"expect_port": 0, "expect_queues": "null"},
+        },
+        "expect_results": {"expect_pkts": len(IPv6_MASK["matched"])},
+    },
+    "mismatched": {
+        "scapy_str": IPv6_MASK["mismatched"],
+        "check_func": {
+            "func": rfc.check_output_log_drop_mismatched,
+            "param": {"expect_port": 0, "expect_queues": "null"},
+        },
+        "expect_results": {"expect_pkts": len(IPv6_MASK["mismatched"])},
+    },
+}
+
+tvs_L3_mask_non_pipeline_mode = [
+    tv_ip_dst_mask_quest,
+    tv_ipv6_src_mask_drop,
+]
+
+L2_DST_MASK = {
+    "matched": [
+        'Ether(src="00:00:5e:00:00:01", dst="00:00:5e:7f:ff:ff")/IP()/UDP()/Raw("x"*80)',
+    ],
+    "mismatched": [
+        'Ether(dst="00:00:5e:80:00:00")/Raw("x"*80)',
+        'Ether(dst="00:00:ff:00:00:00")/IP()/Raw("x"*80)',
+        'Ether(dst="00:ff:5e:00:00:00")/IP()/TCP()/Raw("x"*80)',
+        'Ether(dst="ff:00:5e:00:00:00")/IP()/UDP()/Raw("x"*80)',
+    ],
+}
+
+tv_eth_dst_mask_quest = {
+    "name": "tv_eth_dst_mask_quest",
+    "rte_flow_pattern": "flow create 0 ingress pattern eth dst spec 00:00:5e:00:00:00 dst mask ff:ff:ff:80:00:00 / end actions queue index 12 / end",
+    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
+    "matched": {
+        "scapy_str": L2_DST_MASK["matched"],
+        "check_func": {
+            "func": rfc.check_output_log_in_queue,
+            "param": {"expect_port": 0, "expect_queues": 12},
+        },
+        "expect_results": {"expect_pkts": len(L2_DST_MASK["matched"])},
+    },
+    "mismatched": {
+        "scapy_str": L2_DST_MASK["mismatched"],
+        "check_func": {
+            "func": rfc.check_output_log_in_queue_mismatched,
+            "param": {"expect_port": 0, "expect_queues": 12},
+        },
+        "expect_results": {"expect_pkts": len(L2_DST_MASK["mismatched"])},
+    },
+}
+
+L2_SRC_MASK = {
+    "matched": [
+        'Ether(dst="00:00:5e:00:00:01", src="00:00:5e:7f:ff:ff")/IP()/UDP()/Raw("x"*80)',
+    ],
+    "mismatched": [
+        'Ether(src="00:00:5e:80:00:00")/Raw("x"*80)',
+        'Ether(src="00:00:ff:00:00:00")/IP()/Raw("x"*80)',
+        'Ether(src="00:ff:5e:00:00:00")/IP()/TCP()/Raw("x"*80)',
+        'Ether(src="ff:00:5e:00:00:00")/IP()/UDP()/Raw("x"*80)',
+    ],
+}
+
+tv_eth_src_mask_drop = {
+    "name": "tv_eth_src_mask_drop",
+    "rte_flow_pattern": "flow create 0 ingress pattern eth src spec 00:00:5e:00:00:00 src mask ff:ff:ff:80:00:00 / end actions drop / end",
+    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
+    "matched": {
+        "scapy_str": L2_SRC_MASK["matched"],
+        "check_func": {
+            "func": rfc.check_output_log_drop,
+            "param": {"expect_port": 0, "expect_queues": "null"},
+        },
+        "expect_results": {"expect_pkts": len(L2_SRC_MASK["matched"])},
+    },
+    "mismatched": {
+        "scapy_str": L2_SRC_MASK["mismatched"],
+        "check_func": {
+            "func": rfc.check_output_log_drop_mismatched,
+            "param": {"expect_port": 0, "expect_queues": "null"},
+        },
+        "expect_results": {"expect_pkts": len(L2_SRC_MASK["mismatched"])},
+    },
+}
+
+tvs_L2_mask_non_pipeline_mode = [
+    tv_eth_dst_mask_quest,
+    tv_eth_src_mask_drop,
+]
+
 test_results = OrderedDict()
 
 
@@ -4212,7 +4357,7 @@ class ICESwitchFilterTest(TestCase):
         self.verify(len(self.dut_ports) >= 1, "Insufficient ports")
         localPort = self.tester.get_local_port(self.dut_ports[0])
         self.__tx_iface = self.tester.get_interface(localPort)
-        self.dut.send_expect("ifconfig %s up" % self.__tx_iface, "# ")
+        self.tester.send_expect("ifconfig %s up" % self.__tx_iface, "# ")
         self.pkt = Packet()
         self.pmd = PmdOutput(self.dut)
 
@@ -5319,6 +5464,18 @@ class ICESwitchFilterTest(TestCase):
             not all(rule6), "all rules should create failed, result {}".format(rule6)
         )
 
+    def test_l3_mask(self):
+        """
+        Test case: L3 mask
+        """
+        self._rte_flow_validate_pattern(tvs_L3_mask_non_pipeline_mode)
+
+    def test_l2_mask(self):
+        """
+        Test case: L2 mask
+        """
+        self._rte_flow_validate_pattern(tvs_L2_mask_non_pipeline_mode)
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.25.1


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

* RE: [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case
  2022-09-05 18:51 [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case Jiale Song
  2022-09-05 18:51 ` [dts] [PATCH V2 2/2] tests/ice_switch_filter: " Jiale Song
@ 2022-09-07  4:59 ` Peng, Yuan
  2022-09-08  1:53 ` lijuan.tu
  2 siblings, 0 replies; 5+ messages in thread
From: Peng, Yuan @ 2022-09-07  4:59 UTC (permalink / raw)
  To: Jiale, SongX, dts; +Cc: Jiale, SongX

Acked-by: Peng, Yuan <yuan.peng@intel.com>

-----Original Message-----
From: Jiale Song <songx.jiale@intel.com> 
Sent: Tuesday, September 6, 2022 2:51 AM
To: dts@dpdk.org
Cc: Jiale, SongX <songx.jiale@intel.com>
Subject: [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case

add case to test the rule of l2 mask and l3 mask.

Signed-off-by: Jiale Song <songx.jiale@intel.com>

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

* RE: [dts] [PATCH V2 2/2] tests/ice_switch_filter: add 2 case
  2022-09-05 18:51 ` [dts] [PATCH V2 2/2] tests/ice_switch_filter: " Jiale Song
@ 2022-09-07  5:00   ` Peng, Yuan
  0 siblings, 0 replies; 5+ messages in thread
From: Peng, Yuan @ 2022-09-07  5:00 UTC (permalink / raw)
  To: Jiale, SongX, dts; +Cc: Jiale, SongX

Acked-by: Peng, Yuan <yuan.peng@intel.com>

-----Original Message-----
From: Jiale Song <songx.jiale@intel.com> 
Sent: Tuesday, September 6, 2022 2:51 AM
To: dts@dpdk.org
Cc: Jiale, SongX <songx.jiale@intel.com>
Subject: [dts] [PATCH V2 2/2] tests/ice_switch_filter: add 2 case

add case test_l2_mask and test_l3_mask.

Signed-off-by: Jiale Song <songx.jiale@intel.com>

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

* [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case
  2022-09-05 18:51 [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case Jiale Song
  2022-09-05 18:51 ` [dts] [PATCH V2 2/2] tests/ice_switch_filter: " Jiale Song
  2022-09-07  4:59 ` [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: " Peng, Yuan
@ 2022-09-08  1:53 ` lijuan.tu
  2 siblings, 0 replies; 5+ messages in thread
From: lijuan.tu @ 2022-09-08  1:53 UTC (permalink / raw)
  To: dts, Jiale Song; +Cc: Jiale Song

On Mon,  5 Sep 2022 18:51:08 +0000, Jiale Song <songx.jiale@intel.com> wrote:
> add case to test the rule of l2 mask and l3 mask.
> 
> Signed-off-by: Jiale Song <songx.jiale@intel.com>

Acked-by: Lijuan Tu <lijuan.tu@intel.com>
Series applied, thanks

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

end of thread, other threads:[~2022-09-08  1:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 18:51 [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: add 2 case Jiale Song
2022-09-05 18:51 ` [dts] [PATCH V2 2/2] tests/ice_switch_filter: " Jiale Song
2022-09-07  5:00   ` Peng, Yuan
2022-09-07  4:59 ` [dts] [PATCH V2 1/2] test_plans/ice_switch_filter: " Peng, Yuan
2022-09-08  1:53 ` lijuan.tu

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).