test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1] tests/rte_flow_common: optimize scripts
@ 2022-09-21 14:23 Song Jiale
  0 siblings, 0 replies; 2+ messages in thread
From: Song Jiale @ 2022-09-21 14:23 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

1. "check_queue" is repeated, delete one.
2. the method "check_rss" requires the parameter "rxq", so pass the parameter 
"rxq" to the variable "check_param".

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

diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py
index 87892c13..02c85f85 100644
--- a/tests/rte_flow_common.py
+++ b/tests/rte_flow_common.py
@@ -129,6 +129,7 @@ def check_output_log_queue_region_mismatched(out, func_param, expect_results):
         func_param["expect_port"] if func_param["expect_port"] else 0
     )
     check_param["queue"] = func_param["expect_queues"]
+    check_param["rxq"] = func_param["rxq"]
     try:
         check_queue(out, expect_pkts, check_param, stats=False)
     except Exception as ex:
@@ -151,7 +152,7 @@ def check_output_log_in_queue_mismatched(out, func_param, expect_results):
         func_param["expect_port"] if func_param["expect_port"] else 0
     )
     check_param["queue"] = func_param["expect_queues"]
-    check_queue(out, expect_pkts, check_param, stats=False)
+    check_param["rxq"] = func_param["rxq"]
     try:
         check_queue(out, expect_pkts, check_param, stats=False)
     except Exception as ex:
-- 
2.25.1


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

* [dts] [PATCH v1] tests/rte_flow_common: optimize scripts
@ 2022-10-28 14:22 Song Jiale
  0 siblings, 0 replies; 2+ messages in thread
From: Song Jiale @ 2022-10-28 14:22 UTC (permalink / raw)
  To: dts; +Cc: Song Jiale

some packages that mismatch the rule do not have hash values. 
add a parameter "check_hash_num" to determine whether to detect the number of hash values.

Signed-off-by: Song Jiale <songx.jiale@intel.com>
---
 tests/rte_flow_common.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py
index 02c85f85..4d36c9a5 100644
--- a/tests/rte_flow_common.py
+++ b/tests/rte_flow_common.py
@@ -346,7 +346,7 @@ def verify(passed, description):
         raise AssertionError(description)
 
 
-def check_rss(out, pkt_num, check_param, stats=True):
+def check_rss(out, pkt_num, check_param, stats=True, check_hash_num=True):
     """
     check whether the packet directed by rss or not according to the specified parameters
     :param out: information received by testpmd after sending packets and port statistics
@@ -359,7 +359,8 @@ def check_rss(out, pkt_num, check_param, stats=True):
     rxq = check_param.get("rxq")
     p = re.compile("RSS\shash=(\w+)\s-\sRSS\squeue=(\w+)")
     pkt_info = p.findall(out)
-    verify(len(pkt_info) == pkt_num, "some packets no hash:{}".format(p.pattern))
+    if check_hash_num:
+        verify(len(pkt_info) == pkt_num, "some packets no hash:{}".format(p.pattern))
     pkt_queue = set([int(i[1], 16) for i in pkt_info])
     if stats:
         verify(
@@ -400,7 +401,7 @@ def check_queue(out, pkt_num, check_param, stats=True):
             if not any(q in queue for q in pkt_queue):
                 print((GREEN("pass: queue id %s not matched" % pkt_queue)))
             else:
-                check_rss(out, pkt_num, check_param, stats=True)
+                check_rss(out, pkt_num, check_param, stats=True, check_hash_num=False)
         return pkt_queue
     else:
         raise Exception("got wrong output, not match pattern %s" % p.pattern)
-- 
2.17.1


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

end of thread, other threads:[~2022-10-28  6:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 14:23 [dts] [PATCH V1] tests/rte_flow_common: optimize scripts Song Jiale
2022-10-28 14:22 [dts] [PATCH v1] " Song Jiale

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