[V1] tests/ice_switch_filter_pppoe:move the case of ethertype_filter_pppoed to ice_switch_filter_pppoe

Message ID 20220826102759.90507-1-hongbox.li@intel.com (mailing list archive)
State Accepted
Headers
Series [V1] tests/ice_switch_filter_pppoe:move the case of ethertype_filter_pppoed to ice_switch_filter_pppoe |

Checks

Context Check Description
ci/Intel-dts-format-test success Testing OK
ci/Intel-dts-pylama-test success Testing OK
ci/Intel-dts-doc-test fail Testing issues

Commit Message

Li, HongboX Aug. 26, 2022, 10:27 a.m. UTC
  move the case from ice_switch_filter to ice_switch_filter_pppoe

Signed-off-by: Hongbo Li <hongbox.li@intel.com>
---
 .../ice_switch_filter_pppoe_test_plan.rst     | 127 +++++++++++++++++
 test_plans/ice_switch_filter_test_plan.rst    | 129 ------------------
 tests/TestSuite_ice_switch_filter.py          |  78 -----------
 tests/TestSuite_ice_switch_filter_pppoe.py    |  79 +++++++++++
 4 files changed, 206 insertions(+), 207 deletions(-)
  

Comments

Tu, Lijuan Sept. 2, 2022, 1:47 a.m. UTC | #1
On Fri, 26 Aug 2022 06:27:59 -0400, Hongbo Li <hongbox.li@intel.com> wrote:
> move the case from ice_switch_filter to ice_switch_filter_pppoe
> 
> Signed-off-by: Hongbo Li <hongbox.li@intel.com>

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

Patch

diff --git a/test_plans/ice_switch_filter_pppoe_test_plan.rst b/test_plans/ice_switch_filter_pppoe_test_plan.rst
index 8cffb554..157d2e01 100644
--- a/test_plans/ice_switch_filter_pppoe_test_plan.rst
+++ b/test_plans/ice_switch_filter_pppoe_test_plan.rst
@@ -36,6 +36,8 @@  Pattern and input set
   |                     |                               |              non-pipeline mode            |              pipeline mode                |
   +=====================+===============================+===========================================+===========================================+
   |  ethertype filter   | ethertype filter_PPPOES       | [Ether type]                              | [Ether type]                              |
+  |                     +-------------------------------+-------------------------------------------+-------------------------------------------+
+  |                     | ethertype filter_PPPOED       | [Ether type]                              | [Ether type]                              |
   +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+
   |                     | MAC_VLAN_PPPOE_IPV4_PAY       | [Dest MAC], [VLAN], [seid],               | [Dest MAC], [VLAN], [seid],               |
   |                     | _session_id_proto_id          | [pppoe_proto_id]                          | [pppoe_proto_id]                          |
@@ -371,6 +373,131 @@  drop action
 
    repeat step 1-4 to check the pattern in pipeline mode.
 
+
+Ethertype filter_PPPOED
+-----------------------
+
+matched packets::
+
+  sendp([Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)],iface="ens786f0",count=1)
+  sendp([Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)],iface="ens786f0",count=1)
+
+mismatched packets::
+
+  sendp([Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)],iface="ens786f0",count=1)
+  sendp([Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)],iface="ens786f0",count=1)
+
+to queue action
+................
+
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / 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 type is 0x8863 / end actions queue index 2 / end
+
+   get the message::
+
+     Succeeded to create (2) flow
+
+   check the flow list::
+
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets, check the packets are to queue 2.
+   send mismatched packets, check the packets are not to queue 2.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 15360
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check the packets are not to queue 2.
+
+5. check the pattern in pipeline mode
+
+   The rules in pipeline mode are similar to rules in non-pipeline mode,
+   just need to add priority 0 to show it is created as a switch filter rule.
+
+   validate a rule::
+
+     testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end
+
+   create a rule::
+
+     testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end
+
+   repeat step 1-4 to check the pattern in pipeline mode.
+
+drop action
+............
+
+1. validate a rule::
+
+     testpmd> flow validate 0 ingress pattern eth type is 0x8863 / 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 type is 0x8863 / end actions drop / end
+
+   get the message::
+
+     Succeeded to create (2) flow
+
+   check the flow list::
+
+     testpmd> flow list 0
+
+   check the rule exists in the list.
+
+3. send matched packets, check the packets are dropped.
+   send mismatched packets, check the packets are not dropped.
+
+4. verify rules can be destroyed::
+
+     testpmd> flow destroy 0 rule 15360
+     testpmd> flow list 0
+
+   check the rule not exists in the list.
+   send matched packets, check the packets are not to dropped.
+
+5. check the pattern in pipeline mode
+
+   validate a rule::
+
+     testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end
+
+   create a rule::
+
+     testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end
+
+   repeat step 1-4 to check the pattern in pipeline mode.
+
 Test case: MAC_VLAN_PPPOE_IPV4_PAY_session_id_proto_id
 ======================================================
 
diff --git a/test_plans/ice_switch_filter_test_plan.rst b/test_plans/ice_switch_filter_test_plan.rst
index 599174ba..6ea6843c 100644
--- a/test_plans/ice_switch_filter_test_plan.rst
+++ b/test_plans/ice_switch_filter_test_plan.rst
@@ -94,8 +94,6 @@  Pattern and input set
   |                     |                               | [Inner Source IP], [Inner Dest IP],       |                                           |
   |                     |                               | [Inner Source Port], [Inner Dest Port]    |                                           |
   +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+
-  |  ethertype filter   | ethertype filter_PPPOED       | [Ether type]                              | [Ether type]                              |
-  +---------------------+-------------------------------+-------------------------------------------+-------------------------------------------+
 
 .. note::
 
@@ -4603,133 +4601,6 @@  drop action
    check the rule not exists in the list.
    send matched packets, check the packets are not dropped.
 
-Test case: Ethertype filter
-===========================
-
-Ethertype filter_PPPOED
------------------------
-
-matched packets::
-
-  sendp([Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)],iface="ens786f0",count=1)
-  sendp([Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)],iface="ens786f0",count=1)
-
-mismatched packets::
-
-  sendp([Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)],iface="ens786f0",count=1)
-  sendp([Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)],iface="ens786f0",count=1)
-
-to queue action
-................
-
-1. validate a rule::
-
-     testpmd> flow validate 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / 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 type is 0x8863 / end actions queue index 2 / end
-
-   get the message::
-
-     Succeeded to create (2) flow
-
-   check the flow list::
-
-     testpmd> flow list 0
-
-   check the rule exists in the list.
-
-3. send matched packets, check the packets are to queue 2.
-   send mismatched packets, check the packets are not to queue 2.
-
-4. verify rules can be destroyed::
-
-     testpmd> flow destroy 0 rule 15360
-     testpmd> flow list 0
-
-   check the rule not exists in the list.
-   send matched packets, check the packets are not to queue 2.
-
-5. check the pattern in pipeline mode
-
-   The rules in pipeline mode are similar to rules in non-pipeline mode,
-   just need to add priority 0 to show it is created as a switch filter rule.
-
-   validate a rule::
-
-     testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end
-
-   create a rule::
-
-     testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end
-
-   repeat step 1-4 to check the pattern in pipeline mode.
-
-drop action
-............
-
-1. validate a rule::
-
-     testpmd> flow validate 0 ingress pattern eth type is 0x8863 / 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 type is 0x8863 / end actions drop / end
-
-   get the message::
-
-     Succeeded to create (2) flow
-
-   check the flow list::
-
-     testpmd> flow list 0
-
-   check the rule exists in the list.
-
-3. send matched packets, check the packets are dropped.
-   send mismatched packets, check the packets are not dropped.
-
-4. verify rules can be destroyed::
-
-     testpmd> flow destroy 0 rule 15360
-     testpmd> flow list 0
-
-   check the rule not exists in the list.
-   send matched packets, check the packets are not to dropped.
-
-5. check the pattern in pipeline mode
-
-   validate a rule::
-
-     testpmd> flow validate 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end
-
-   create a rule::
-
-     testpmd> flow create 0 priority 0 ingress pattern eth type is 0x8863 / end actions drop / end
-
-   repeat step 1-4 to check the pattern in pipeline mode.
-
 Test case: unsupported patterns in os default package
 =====================================================
 
diff --git a/tests/TestSuite_ice_switch_filter.py b/tests/TestSuite_ice_switch_filter.py
index 76bd630f..c9c5b17f 100644
--- a/tests/TestSuite_ice_switch_filter.py
+++ b/tests/TestSuite_ice_switch_filter.py
@@ -2983,67 +2983,6 @@  tvs_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode = [
     tv_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode_drop_03,
 ]
 
-# test vector ethertype_filter_pppoed
-ethertype_filter_pppoed_scapy_str = {
-    "matched": [
-        'Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)',
-        'Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)',
-    ],
-    "mismatched": [
-        'Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)',
-        'Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)',
-    ],
-}
-
-tv_ethertype_filter_pppoed_in_queue_01 = {
-    "name": "tv_ethertype_filter_pppoed_in_queue_01",
-    "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end",
-    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
-    "matched": {
-        "scapy_str": ethertype_filter_pppoed_scapy_str["matched"],
-        "check_func": {
-            "func": rfc.check_output_log_in_queue,
-            "param": {"expect_port": 0, "expect_queues": 2},
-        },
-        "expect_results": {"expect_pkts": 2},
-    },
-    "mismatched": {
-        "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"],
-        "check_func": {
-            "func": rfc.check_output_log_in_queue_mismatched,
-            "param": {"expect_port": 0, "expect_queues": 2},
-        },
-        "expect_results": {"expect_pkts": 2},
-    },
-}
-
-tv_ethertype_filter_pppoed_drop_02 = {
-    "name": "tv_ethertype_filter_pppoed_drop_02",
-    "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions drop / end",
-    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
-    "matched": {
-        "scapy_str": ethertype_filter_pppoed_scapy_str["matched"],
-        "check_func": {
-            "func": rfc.check_output_log_drop,
-            "param": {"expect_port": 0, "expect_queues": "null"},
-        },
-        "expect_results": {"expect_pkts": 2},
-    },
-    "mismatched": {
-        "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"],
-        "check_func": {
-            "func": rfc.check_output_log_drop_mismatched,
-            "param": {"expect_port": 0, "expect_queues": "null"},
-        },
-        "expect_results": {"expect_pkts": 2},
-    },
-}
-
-tvs_ethertype_filter_pppoed = [
-    tv_ethertype_filter_pppoed_in_queue_01,
-    tv_ethertype_filter_pppoed_drop_02,
-]
-
 # non-tunnel pipeline mode
 # test vector mac_ipv4_frag_pipeline_mode
 mac_ipv4_frag_pipeline_mode_scapy_str = {
@@ -4920,23 +4859,6 @@  class ICESwitchFilterTest(TestCase):
     def test_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode(self):
         self._rte_flow_validate_pattern(tvs_mac_ipv4_nvgre_ipv4_tcp_pipeline_mode)
 
-    # ether filter non-pipeline mode
-    def test_ethertype_filter_pppoed(self):
-        self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed)
-
-    # ether filter pipeline mode
-    def test_ethertype_filter_pppoed_pipeline_mode(self):
-        tvs_ethertype_filter_pppoed_pipeline_mode = copy.deepcopy(
-            tvs_ethertype_filter_pppoed
-        )
-        for tv in tvs_ethertype_filter_pppoed_pipeline_mode:
-            create_rule = tv["rte_flow_pattern"].replace(
-                "flow create 0", "flow create 0 priority 0"
-            )
-            tv["rte_flow_pattern"] = create_rule
-            tv["configuration"]["is_non_pipeline"] = False
-        self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed_pipeline_mode)
-
     # non-tunnel pipeline mode
     def test_mac_ipv4_frag_pipeline_mode(self):
         self._rte_flow_validate_pattern(tvs_mac_ipv4_frag_pipeline_mode)
diff --git a/tests/TestSuite_ice_switch_filter_pppoe.py b/tests/TestSuite_ice_switch_filter_pppoe.py
index c83195b3..3c840655 100644
--- a/tests/TestSuite_ice_switch_filter_pppoe.py
+++ b/tests/TestSuite_ice_switch_filter_pppoe.py
@@ -97,6 +97,67 @@  tvs_ethertype_filter_pppoes = [
     tv_ethertype_filter_pppoes_drop_03,
 ]
 
+# test vector ethertype_filter_pppoed
+ethertype_filter_pppoed_scapy_str = {
+    "matched": [
+        'Ether(dst="00:11:22:33:44:55", type=0x8863)/Raw("x" *80)',
+        'Ether(dst="00:11:22:33:44:55")/PPPoED()/Raw("x" *80)',
+    ],
+    "mismatched": [
+        'Ether(dst="00:11:22:33:44:55", type=0x8864)/Raw("x" *80)',
+        'Ether(dst="00:11:22:33:44:55")/PPPoE()/Raw("x" *80)',
+    ],
+}
+
+tv_ethertype_filter_pppoed_in_queue_01 = {
+    "name": "tv_ethertype_filter_pppoed_in_queue_01",
+    "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions queue index 2 / end",
+    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
+    "matched": {
+        "scapy_str": ethertype_filter_pppoed_scapy_str["matched"],
+        "check_func": {
+            "func": rfc.check_output_log_in_queue,
+            "param": {"expect_port": 0, "expect_queues": 2},
+        },
+        "expect_results": {"expect_pkts": 2},
+    },
+    "mismatched": {
+        "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"],
+        "check_func": {
+            "func": rfc.check_output_log_in_queue_mismatched,
+            "param": {"expect_port": 0, "expect_queues": 2},
+        },
+        "expect_results": {"expect_pkts": 2},
+    },
+}
+
+tv_ethertype_filter_pppoed_drop_02 = {
+    "name": "tv_ethertype_filter_pppoed_drop_02",
+    "rte_flow_pattern": "flow create 0 ingress pattern eth type is 0x8863 / end actions drop / end",
+    "configuration": {"is_non_pipeline": True, "is_need_rss_rule": False},
+    "matched": {
+        "scapy_str": ethertype_filter_pppoed_scapy_str["matched"],
+        "check_func": {
+            "func": rfc.check_output_log_drop,
+            "param": {"expect_port": 0, "expect_queues": "null"},
+        },
+        "expect_results": {"expect_pkts": 2},
+    },
+    "mismatched": {
+        "scapy_str": ethertype_filter_pppoed_scapy_str["mismatched"],
+        "check_func": {
+            "func": rfc.check_output_log_drop_mismatched,
+            "param": {"expect_port": 0, "expect_queues": "null"},
+        },
+        "expect_results": {"expect_pkts": 2},
+    },
+}
+
+tvs_ethertype_filter_pppoed = [
+    tv_ethertype_filter_pppoed_in_queue_01,
+    tv_ethertype_filter_pppoed_drop_02,
+]
+
 # l4 mask
 # ipv4/ipv6 + udp/tcp pipeline mode
 mac_pppoes_ipv4_udp_l4_mask_scapy_str = {
@@ -2814,6 +2875,7 @@  tv_mac_vlan_pppoe_ipcp_pay_drop_03 = {
     },
 }
 
+
 tvs_mac_vlan_pppoe_ipcp_pay = [
     tv_mac_vlan_pppoe_ipcp_pay_in_queue_01,
     tv_mac_vlan_pppoe_ipcp_pay_queue_region_02,
@@ -3432,6 +3494,23 @@  class ICESwitchFilterPPPOETest(TestCase):
     def test_mac_vlan_pppoes_l4_mask(self):
         self._rte_flow_validate_pattern(tvs_mac_vlan_pppoes_l4_mask)
 
+    # ether filter non-pipeline mode
+    def test_ethertype_filter_pppoed(self):
+        self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed)
+
+    # ether filter pipeline mode
+    def test_ethertype_filter_pppoed_pipeline_mode(self):
+        tvs_ethertype_filter_pppoed_pipeline_mode = copy.deepcopy(
+            tvs_ethertype_filter_pppoed
+        )
+        for tv in tvs_ethertype_filter_pppoed_pipeline_mode:
+            create_rule = tv["rte_flow_pattern"].replace(
+                "flow create 0", "flow create 0 priority 0"
+            )
+            tv["rte_flow_pattern"] = create_rule
+            tv["configuration"]["is_non_pipeline"] = False
+        self._rte_flow_validate_pattern(tvs_ethertype_filter_pppoed_pipeline_mode)
+
     # 20.08
     def test_mac_vlan_pppoe_ipv4_pay_non_pipeline_mode(self):
         self._rte_flow_validate_pattern(tvs_mac_vlan_pppoe_ipv4_pay_session_id_proto_id)