From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 38B96A0524; Tue, 13 Apr 2021 11:18:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8986160D3E; Tue, 13 Apr 2021 11:18:05 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id E3F6F160D36 for ; Tue, 13 Apr 2021 11:18:03 +0200 (CEST) IronPort-SDR: 54S+oUBI7IjcEZ33wDDR9LJ53M9ekcvYHerpnUfehlCURBrbT5xDSpmCjZViIERODFCJYCyWFA ryq0Qi+XmqfQ== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="174472662" X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="174472662" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 02:18:02 -0700 IronPort-SDR: NcWbNQSgTZJNdlzi2K4oPI7BK/Twsp7K7jT92uSd3FVuvhJ/9cKB1cj25ER3lceA0dNT2VhKEQ 4Ob9pPefW9Pg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="424174824" Received: from pengyuan-dpdk.sh.intel.com ([10.67.117.236]) by orsmga008.jf.intel.com with ESMTP; 13 Apr 2021 02:18:00 -0700 From: Peng Yuan To: dts@dpdk.org Cc: Peng Yuan Date: Tue, 13 Apr 2021 02:17:11 +0000 Message-Id: <20210413021711.39473-1-yuan.peng@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dts] [PATCH]tests: change function check_hash_different X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" adapt to the scenario that there are two or more hash values in the hashes list. Signed-off-by: Peng Yuan -- 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