test suite reviews and discussions
 help / color / mirror / Atom feed
From: Ke Xu <ke1.xu@intel.com>
To: dts@dpdk.org
Cc: qi.fu@intel.com, lijuan.tu@intel.com, Ke Xu <ke1.xu@intel.com>
Subject: [DTS][PATCH V1 4/4] tests/ice_dcf_switch_filter: update existing negative cases to validate represented port action and port representor action
Date: Fri, 30 Sep 2022 05:46:47 +0000	[thread overview]
Message-ID: <20220930054647.545932-5-ke1.xu@intel.com> (raw)
In-Reply-To: <20220930054647.545932-1-ke1.xu@intel.com>

1. Add second PF with VFs for following cases

2. Add a subcase to validate creating 'represented port' action on a representor

3. Add a subcase to validate creating 'represented port' action on a VF

4. Add a subcase to validate creating 'represented port' action to a VF

5. Add two subcases to validate creating 'represented port' action to DCFs

6. Add a subcase to validate creating 'represented port' action to a representor of another DCF

7. Add a subcase to validate creating 'port representor' action on a representor

8. Add a subcase to validate creating 'port representor' action on a VF

9. Add a subcase to validate creating 'port representor' action to a VF

10. Add a subcase to validate creating 'port representor' action to a representor

11. Add a subcase to validate creating 'port representor' action to another DCF

12. Add a subcase to validate deprecated action

13. Add	a subcase to validate using an invalid port id

Signed-off-by: Ke Xu <ke1.xu@intel.com>
---
 tests/TestSuite_ice_dcf_switch_filter.py | 111 ++++++++++++++++++++---
 1 file changed, 100 insertions(+), 11 deletions(-)

diff --git a/tests/TestSuite_ice_dcf_switch_filter.py b/tests/TestSuite_ice_dcf_switch_filter.py
index c68ae3f5..429769a1 100644
--- a/tests/TestSuite_ice_dcf_switch_filter.py
+++ b/tests/TestSuite_ice_dcf_switch_filter.py
@@ -2315,22 +2315,111 @@ class ICEDCFSwitchFilterTest(TestCase):
         # launch testpmd
         self.launch_testpmd()
         rules = {
-            "cannot create rule on vf 1": "flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end",
-            "unsupported input set": "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 2 / eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.1.2 dst is 192.168.1.3 tos is 4 / end actions represented_port ethdev_port_id 1 / end",
-            "invalid vf id": "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / tcp src is 25 dst is 23 / end actions represented_port ethdev_port_id 5 / end",
-            "void action": "flow create 0 ingress pattern eth / ipv4 / udp src is 25 dst is 23 / end actions end",
-            "void input set value": "flow create 0 ingress pattern eth / ipv4 / end actions represented_port ethdev_port_id 1 end",
+            "cannot create to vf rule on a representor"                 : "flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end",
+            "cannot create to vf rule on a vf"                          : "flow create 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 1 / end",
+            "cannot create to vf rule to a vf"                          : "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 3 / end",
+            "cannot create to vf rule to another dcf"                   : "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 4 / end",
+            "cannot create to vf rule to a representor of another pf"   : "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions represented_port ethdev_port_id 5 / end",
+            "cannot create vf original rule on a representor"           : "flow create 1 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end",
+            "cannot create vf original rule on a vf"                    : "flow create 3 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end",
+            "cannot create vf original rule to a vf"                    : "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 3 / end",
+            "cannot create vf original rule to a representor"           : "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 1 / end",
+            "cannot create vf original rule to another dcf"             : "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / udp src is 25 dst is 23 / end actions port_representor port_id 4 / end",
+            "unsupported input set"     : "flow create 0 ingress pattern eth / ipv4 dst is 192.168.0.1 / nvgre tni is 2 / eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.1.2 dst is 192.168.1.3 tos is 4 / end actions port_representor port_id 1 / end",
+            "invalid port id"           : "flow create 0 ingress pattern eth dst is 68:05:ca:8d:ed:a8 / ipv4 src is 192.168.0.1 dst is 192.168.0.2 tos is 4 ttl is 3 / tcp src is 25 dst is 23 / end actions represented_port ethdev_port_id 20 / end",
+            "void action"               : "flow create 0 ingress pattern eth / ipv4 / udp src is 25 dst is 23 / end actions end",
+            "void input set value"      : "flow create 0 ingress pattern eth / ipv4 / end actions represented_port ethdev_port_id 1 end",
         }
-        # cannot create rule on vf 1
+        # cannot create to vf rule on a representor
         self.validate_switch_filter_rule(
-            rules["cannot create rule on vf 1"], check_stats=False
+            rules["cannot create rule on a representor"], check_stats=False
         )
         self.check_switch_filter_rule_list(1, [])
         self.create_switch_filter_rule(
-            rules["cannot create rule on vf 1"], check_stats=False
+            rules["cannot create rule on a representor"], check_stats=False
         )
         self.check_switch_filter_rule_list(1, [])
 
+        # cannot create to vf rule on a vf
+        self.validate_switch_filter_rule(
+            rules["cannot create rule on a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(3, [])
+        self.create_switch_filter_rule(
+            rules["cannot create rule on a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(3, [])
+
+        # cannot create to vf rule to a vf
+        self.validate_switch_filter_rule(
+            rules["cannot create rule to a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        self.create_switch_filter_rule(
+            rules["cannot create rule to a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+
+        # cannot create to vf rule to another dcf
+        self.validate_switch_filter_rule(
+            rules["cannot create rule to another dcf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        self.create_switch_filter_rule(
+            rules["cannot create rule to another dcf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+
+        # cannot create to vf rule to a representor of another pf
+        self.validate_switch_filter_rule(
+            rules["cannot create rule to a representor of another pf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        self.create_switch_filter_rule(
+            rules["cannot create rule to a representor of another pf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        
+        # cannot create vf original rule on a representor
+        self.validate_switch_filter_rule(
+            rules["cannot create vf original rule on a representor"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        self.create_switch_filter_rule(
+            rules["cannot create vf original rule on a representor"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+
+        # cannot create vf original rule on a vf
+        self.validate_switch_filter_rule(
+            rules["cannot create vf original rule on a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        self.create_switch_filter_rule(
+            rules["cannot create vf original rule on a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+
+        # cannot create vf original rule to a vf
+        self.validate_switch_filter_rule(
+            rules["cannot create vf original rule to a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        self.create_switch_filter_rule(
+            rules["cannot create vf original rule to a vf"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+
+        # cannot create vf original rule to a representor
+        self.validate_switch_filter_rule(
+            rules["cannot create vf original rule to a representor"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+        self.create_switch_filter_rule(
+            rules["cannot create vf original rule to a representor"], check_stats=False
+        )
+        self.check_switch_filter_rule_list(0, [])
+
         # unsupported input set
         self.validate_switch_filter_rule(
             rules["unsupported input set"], check_stats=False
@@ -2363,10 +2452,10 @@ class ICEDCFSwitchFilterTest(TestCase):
         self.create_switch_filter_rule(rules["void input set value"], check_stats=False)
         self.check_switch_filter_rule_list(0, [])
 
-        # invalid vf id
-        # self.validate_switch_filter_rule(rules["invalid vf id"], check_stats=False)
+        # invalid port id
+        # self.validate_switch_filter_rule(rules["invalid port id"], check_stats=False)
         # self.check_switch_filter_rule_list(0, [])
-        self.create_switch_filter_rule(rules["invalid vf id"], check_stats=False)
+        self.create_switch_filter_rule(rules["invalid port id"], check_stats=False)
         self.check_switch_filter_rule_list(0, [])
 
         # delete non-existing rule
-- 
2.25.1


  parent reply	other threads:[~2022-09-30  5:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30  5:46 [DTS][PATCH V1 0/4] update existing cases and add new sub-cases to validate port representor action and represented port action Ke Xu
2022-09-30  5:46 ` [DTS][PATCH V1 1/4] test_plans/ice_dcf_switch_filter: update existing TO_VF action cases to cover port representor action from not covered vf original action Ke Xu
2022-09-30  5:46 ` [DTS][PATCH V1 2/4] test_plans/ice_dcf_switch_filter: update existing negative cases to validate represented port action and port representor action Ke Xu
2022-09-30  5:46 ` [DTS][PATCH V1 3/4] tests/ice_dcf_switch_filter: update existing TO_VF action cases to cover port representor action from not covered vf original action Ke Xu
2022-09-30  5:46 ` Ke Xu [this message]
2022-12-13  7:14 [DTS][PATCH V1 0/4] update existing cases and add new sub-cases to validate port representor action and represented port action Ke Xu
2022-12-13  7:14 ` [DTS][PATCH V1 4/4] tests/ice_dcf_switch_filter: update existing negative cases to validate represented port action and port representor action Ke Xu
2022-12-14  2:47   ` Li, HongboX

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=20220930054647.545932-5-ke1.xu@intel.com \
    --to=ke1.xu@intel.com \
    --cc=dts@dpdk.org \
    --cc=lijuan.tu@intel.com \
    --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).