test suite reviews and discussions
 help / color / mirror / Atom feed
From: Zhimin Huang <zhiminx.huang@intel.com>
To: dts@dpdk.org
Cc: Zhimin Huang <zhiminx.huang@intel.com>
Subject: [dts][PATCH V1] tests/ice_advanced_rss_pppoe:add destroy test param
Date: Mon, 11 Jul 2022 23:17:48 +0800	[thread overview]
Message-ID: <20220711151748.3155-1-zhiminx.huang@intel.com> (raw)

fix dts 21b47e97d7e(add check result after deleting the rules).
some case no need to check hash values after destroy rule.
so add param judgement to check destroy rule test flow.

Signed-off-by: Zhimin Huang <zhiminx.huang@intel.com>
---
 tests/TestSuite_ice_advanced_rss_pppoe.py | 32 ++++++++++++++---------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/tests/TestSuite_ice_advanced_rss_pppoe.py b/tests/TestSuite_ice_advanced_rss_pppoe.py
index ebb644f6..78a6a734 100644
--- a/tests/TestSuite_ice_advanced_rss_pppoe.py
+++ b/tests/TestSuite_ice_advanced_rss_pppoe.py
@@ -5153,8 +5153,11 @@ class Advanced_rss_pppoe(TestCase):
             func(out, hash_key)
 
     def _two_rules_operation(
-        self, rule_list, pkt_list, action_list1=None, action_list2=None
+        self, rule_list, pkt_list, action_list1=None, action_list2=None, **kwargs
     ):
+        destroy_test = (
+            kwargs.get("destroy_test") if kwargs.get("destroy_test") else False
+        )
         for i in range(0, len(rule_list)):
             self.rsspro.create_rule(rule_list[i])
             self.rsspro.check_rule(rule_list=["{}".format(i)])
@@ -5163,15 +5166,16 @@ class Advanced_rss_pppoe(TestCase):
                 self._send_pkt_action(pkt_list)
             else:
                 self._send_pkt_action(pkt_list)
-        # destory rule 1
-        self.rsspro.destroy_rule(rule_id=1)
-        self.rsspro.check_rule(rule_list=["1"], stats=False)
-        pkt_list[1], pkt_list[2] = pkt_list[2], pkt_list[1]
-        self._send_pkt_action(pkt_list)
-        # destory rule 0
-        self.rsspro.destroy_rule(rule_id=0)
-        self.rsspro.check_rule(rule_list=["0"], stats=False)
-        self._send_pkt_action(pkt_list, action_list=["check_no_hash"] * 3)
+        if destroy_test:
+            # destroy rule 1
+            self.rsspro.destroy_rule(rule_id=1)
+            self.rsspro.check_rule(rule_list=["1"], stats=False)
+            pkt_list[1], pkt_list[2] = pkt_list[2], pkt_list[1]
+            self._send_pkt_action(pkt_list)
+            # destroy rule 0
+            self.rsspro.destroy_rule(rule_id=0)
+            self.rsspro.check_rule(rule_list=["0"], stats=False)
+            self._send_pkt_action(pkt_list, action_list=["check_no_hash"] * 3)
 
     def test_two_rules_smaller_first_larger_later(
         self,
@@ -5190,7 +5194,9 @@ class Advanced_rss_pppoe(TestCase):
             'Ether(src="00:11:22:33:44:55", dst="10:22:33:44:55:66")/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=19,dport=23)/Raw("x"*80)',
             'Ether(src="00:11:22:33:44:53", dst="10:22:33:44:55:99")/PPPoE(sessionid=7)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.5")/UDP(sport=25,dport=99)/Raw("x"*80)',
         ]
-        self._two_rules_operation(rule_list, pkt_list, action_list2=["check_no_hash"])
+        self._two_rules_operation(
+            rule_list, pkt_list, action_list2=["check_no_hash"], destroy_test=True
+        )
         self.verify(not self.rsspro.error_msgs, "some subcases failed")
 
     def test_two_rules_larger_first_smaller_later(self):
@@ -5208,4 +5214,6 @@ class Advanced_rss_pppoe(TestCase):
             'Ether(src="00:11:22:33:44:53", dst="10:22:33:44:55:99")/PPPoE(sessionid=7)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.3", dst="192.168.1.5")/UDP(sport=25,dport=99)/Raw("x"*80)',
             'Ether(src="00:11:22:33:44:55", dst="10:22:33:44:55:66")/PPPoE(sessionid=3)/PPP(b\'\\x00\\x21\')/IP(src="192.168.1.1", dst="192.168.1.2")/UDP(sport=19,dport=23)/Raw("x"*80)',
         ]
-        self._two_rules_operation(rule_list, pkt_list, action_list2=["check_no_hash"])
+        self._two_rules_operation(
+            rule_list, pkt_list, action_list2=["check_no_hash"], destroy_test=True
+        )
-- 
2.17.1


             reply	other threads:[~2022-07-11  6:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-11 15:17 Zhimin Huang [this message]
2022-07-18  3:32 ` Jiale, SongX
2022-10-09 10:07 ` lijuan.tu

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=20220711151748.3155-1-zhiminx.huang@intel.com \
    --to=zhiminx.huang@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).