[dts] [PATCH]tests: change function check_hash_different
Peng Yuan
yuan.peng at intel.com
Tue Apr 13 04:17:11 CEST 2021
adapt to the scenario that there are two or more hash values in the hashes list.
Signed-off-by: Peng Yuan <yuan.peng at 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
More information about the dts
mailing list