test suite reviews and discussions
 help / color / mirror / Atom feed
From: Jiale Song <songx.jiale@intel.com>
To: dts@dpdk.org
Cc: Jiale Song <songx.jiale@intel.com>
Subject: [dts] [PATCH V1 2/2] tests/ice_switch_filter: add 2 case
Date: Thu, 14 Jul 2022 18:47:43 +0000	[thread overview]
Message-ID: <20220714184743.14720-2-songx.jiale@intel.com> (raw)
In-Reply-To: <20220714184743.14720-1-songx.jiale@intel.com>

add case test_l2_multicast and test_l3_multicast.

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

diff --git a/tests/TestSuite_ice_switch_filter.py b/tests/TestSuite_ice_switch_filter.py
index 76bd630f..39e25ef7 100644
--- a/tests/TestSuite_ice_switch_filter.py
+++ b/tests/TestSuite_ice_switch_filter.py
@@ -4230,6 +4230,167 @@ 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(dst="224.0.0.0")/Raw("x"*80)',
+        'Ether()/IP(dst="224.0.0.255")/Raw("x"*80)',
+        'Ether()/IP(src="192.168.0.1", dst="224.0.255.0")/Raw("x"*80)',
+        'Ether()/IP(src="192.168.0.1", dst="224.255.0.0")/TCP()/Raw("x"*80)',
+        'Ether()/IP(src="192.168.0.1", dst="239.0.0.0")/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": 5},
+    },
+    "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": 3},
+    },
+}
+
+IPv6_MASK = {
+    "matched": [
+        'Ether()/IPv6(src="CDCD:910A:2222:5498:8475:1111:3900:2023")/("X"*480)',
+        'Ether()/IPv6(src="CDCf:0:0:0:0:0:0:0")/("X"*480)',
+        'Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:0:0:0:0:0:0:ffff")/("X"*480)',
+        'Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:0:0:0:0:0:ffff:0")/("X"*480)',
+        'Ether()/IPv6(src="CDC0:0:0:0:0:ffff:0:0")/UDP()/("X"*480)',
+        'Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:0:0:0:ffff:0:0:0")/UDP()/("X"*480)',
+        'Ether()/IPv6(src="CDC0:0:ffff:0:0:0:0:0")/TCP()/("X"*480)',
+        'Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="CDC0:ffff:0:0:0:0:0:0")/TCP()/("X"*480)',
+    ],
+    "mismatched": [
+        'Ether()/IPv6(src="CDDD:910A:2222:5498:8475:1111:3900:2023")/("X"*480)',
+        'Ether()/IPv6(src="CFCD:910A:2222:5498:8475:1111:3900:2023")/UDP()/("X"*480)',
+        'Ether()/IPv6(dst="CDCD:910A:2222:5498:8475:1111:3900:1515", src="FDCD:0:0:0:0:0:0:ffff")/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 fff0:0:0:0: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": 8},
+    },
+    "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": 3},
+    },
+}
+
+tvs_L3_multicast_non_pipeline_mode = [
+    tv_ip_dst_mask_quest,
+    tv_ipv6_src_mask_drop,
+]
+
+L2_DST_MASK = {
+    "matched": [
+        'Ether(dst="01:00:5e:00:00:00")/Raw("x"*80)',
+        'Ether(dst="01:00:5e:7f:00:00")/IP()/Raw("x"*80)',
+        'Ether(dst="01:00:5e:00:ff:00")/IP()/TCP()/Raw("x"*80)',
+        'Ether(src="01:00:5e:00:00:01", dst="01:00:5e:00:00:ff")/IP()/UDP()/Raw("x"*80)',
+    ],
+    "mismatched": [
+        'Ether(dst="01:00:5e:80:00:00")/Raw("x"*80)',
+        'Ether(dst="01:00:ff:00:00:00")/IP()/Raw("x"*80)',
+        'Ether(dst="01:ff:5e:00:ff:00")/IP()/TCP()/Raw("x"*80)',
+        'Ether(dst="ff:00:5e:00:00:ff")/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 01: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": 4},
+    },
+    "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": 4},
+    },
+}
+
+L2_SRC_MASK = {
+    "matched": [
+        'Ether(src="01:00:5e:00:00:00")/Raw("x"*80)',
+        'Ether(src="01:00:5e:7f:00:00")/IP()/Raw("x"*80)',
+        'Ether(src="01:00:5e:00:ff:00")/IP()/TCP()/Raw("x"*80)',
+        'Ether(dst="01:00:5e:00:00:01", src="01:00:5e:00:00:ff")/IP()/UDP()/Raw("x"*80)',
+    ],
+    "mismatched": [
+        'Ether(src="01:00:5e:80:00:00")/Raw("x"*80)',
+        'Ether(src="01:00:ff:00:00:00")/IP()/Raw("x"*80)',
+        'Ether(src="01:ff:5e:00:ff:00")/IP()/TCP()/Raw("x"*80)',
+        'Ether(src="ff:00:5e:00:00:ff")/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 01: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": 4},
+    },
+    "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": 4},
+    },
+}
+
+tvs_L2_multicast_non_pipeline_mode = [
+    tv_eth_dst_mask_quest,
+    tv_eth_src_mask_drop,
+]
+
 test_results = OrderedDict()
 
 
@@ -4273,7 +4434,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)
 
@@ -5397,6 +5558,18 @@ class ICESwitchFilterTest(TestCase):
             not all(rule6), "all rules should create failed, result {}".format(rule6)
         )
 
+    def test_l3_multicast(self):
+        """
+        Test case: IP multicast
+        """
+        self._rte_flow_validate_pattern(tvs_L3_multicast_non_pipeline_mode)
+
+    def test_l2_multicast(self):
+        """
+        Test case: L2 multicast
+        """
+        self._rte_flow_validate_pattern(tvs_L2_multicast_non_pipeline_mode)
+
     def tear_down(self):
         """
         Run after each test case.
-- 
2.17.1


  reply	other threads:[~2022-07-14 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 18:47 [dts] [PATCH V1 1/2] test_plans/ice_switch_filter: " Jiale Song
2022-07-14 18:47 ` Jiale Song [this message]
2022-07-18  2:56   ` [dts] [PATCH V1 2/2] tests/ice_switch_filter: " Huang, ZhiminX

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=20220714184743.14720-2-songx.jiale@intel.com \
    --to=songx.jiale@intel.com \
    --cc=dts@dpdk.org \
    /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).