From patchwork Fri Oct 28 14:22:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jiale, SongX" X-Patchwork-Id: 119245 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48368A0542; Fri, 28 Oct 2022 08:01:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3F9DD40696; Fri, 28 Oct 2022 08:01:28 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 50A3B40041 for ; Fri, 28 Oct 2022 08:01:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666936886; x=1698472886; h=from:to:cc:subject:date:message-id; bh=tloIP5Xo9zvKfI2PQdKFKC3GuzwjjwbE3hgIHFkb27c=; b=VaDhmMCycF77pJqk6l5e0MZ1CjqvL1qbp+Ia5U5iwJOcRkqqVmZH/BQB 2SBolVgpQkFarIOiCdrbCTfRhIIefESQM0tELLq770hVKFwpvsJmTafei l1de2R9jB7vhqzGf42dyXZ8plsLsFwauiDxHj3XOEsRWyn/QVynFzjhMw ARaKy63lI8glqSQa8F9o3HOgmP6v0xPTLWjeOiV9e9RQwCv9EVroerR/g 7CcQkswIlSYrFXOhxvjdi4IqaYSndXittA4ADDo99CRLDXUQyDSHYCCfl 2n021yH7T55oUGu1FQIJ+kiLgp1SijlVdkfkr98TSjyU6M/0ne8gQAADs Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="308408203" X-IronPort-AV: E=Sophos;i="5.95,220,1661842800"; d="scan'208";a="308408203" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 23:01:10 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10513"; a="737981229" X-IronPort-AV: E=Sophos;i="5.95,220,1661842800"; d="scan'208";a="737981229" Received: from unknown (HELO cvl_tetser_105.icx.intel.com) ([10.239.252.94]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Oct 2022 23:01:09 -0700 From: Song Jiale To: dts@dpdk.org Cc: Song Jiale Subject: [dts] [PATCH v1] tests/rte_flow_common: optimize scripts Date: Fri, 28 Oct 2022 14:22:02 +0000 Message-Id: <20221028142202.28341-1-songx.jiale@intel.com> X-Mailer: git-send-email 2.17.1 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 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 --- 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)