test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH]tests: change function check_hash_different
@ 2021-04-13  2:17 Peng Yuan
  2021-05-07  3:20 ` Tu, Lijuan
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Yuan @ 2021-04-13  2:17 UTC (permalink / raw)
  To: dts; +Cc: Peng Yuan

adapt to the scenario that there are two or more hash values in the hashes list.

Signed-off-by: Peng Yuan <yuan.peng@intel.com>
--
v1

diff --git a/tests/rte_flow_common.py b/tests/rte_flow_common.py
index e0a378f3..d8443d3b 100644
--- a/tests/rte_flow_common.py
+++ b/tests/rte_flow_common.py
@@ -728,17 +728,19 @@ class RssProcessing(object):
     def check_hash_different(self, out, key='', port_id=0):
         hashes, rss_distribute = self.get_hash_verify_rss_distribute(out, port_id)
         if len(key) == 0:
-            if hashes == self.current_saved_hash:
-                error_msg = 'hash value {} should be different ' \
-                            'with current saved hash {}'.format(hashes, self.current_saved_hash)
-                self.logger.error(error_msg)
-                self.error_msgs.append(error_msg)
+            for item in hashes:
+                if item in self.current_saved_hash:
+                    error_msg = 'hash value {} should be different ' \
+                    'with current saved hash {}'.format(item, self.current_saved_hash)
+                    self.logger.error(error_msg)
+                    self.error_msgs.append(error_msg)
         else:
-            if hashes == self.hash_records[key]:
-                error_msg = 'hash value {} should be different ' \
-                            'with {} {}'.format(hashes, key, self.hash_records[key])
-                self.logger.error(error_msg)
-                self.error_msgs.append(error_msg)
+            for item in hashes:
+                if item in self.hash_records[key]:
+                    error_msg = 'hash value {} should be different ' \
+                                'with {} {}'.format(item, key, self.hash_records[key])
+                    self.logger.error(error_msg)
+                    self.error_msgs.append(error_msg)
         if not rss_distribute:
             error_msg = 'the packet do not distribute by rss'
             self.logger.error(error_msg)
-- 
2.17.1


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

* Re: [dts] [PATCH]tests: change function check_hash_different
  2021-04-13  2:17 [dts] [PATCH]tests: change function check_hash_different Peng Yuan
@ 2021-05-07  3:20 ` Tu, Lijuan
  0 siblings, 0 replies; 2+ messages in thread
From: Tu, Lijuan @ 2021-05-07  3:20 UTC (permalink / raw)
  To: Peng, Yuan, dts; +Cc: Peng, Yuan

> -----Original Message-----
> From: dts <dts-bounces@dpdk.org> On Behalf Of Peng Yuan
> Sent: 2021年4月13日 10:17
> To: dts@dpdk.org
> Cc: Peng, Yuan <yuan.peng@intel.com>
> Subject: [dts] [PATCH]tests: change function check_hash_different
> 
> adapt to the scenario that there are two or more hash values in the hashes list.
> 
> Signed-off-by: Peng Yuan <yuan.peng@intel.com>

Applied, thanks

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

end of thread, other threads:[~2021-05-07  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13  2:17 [dts] [PATCH]tests: change function check_hash_different Peng Yuan
2021-05-07  3:20 ` Tu, Lijuan

test suite reviews and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dts/0 dts/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dts dts/ https://inbox.dpdk.org/dts \
		dts@dpdk.org
	public-inbox-index dts

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dts


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git