From patchwork Tue Mar 14 09:01:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 125094 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 7BFF241E90; Tue, 14 Mar 2023 10:04:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7656A41101; Tue, 14 Mar 2023 10:04:03 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 0DA6540A7E for ; Tue, 14 Mar 2023 10:04:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678784642; x=1710320642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SZOCM6PF7yfaooLJF87YSYLx0xWJa/T9/1BrIb/vytA=; b=Zpz13dmpMd+G+G7NHBIs7oYmGKPuHbGYeBoQaxGhrdY9HSicyLyZf3dP 81rN+cUK1Qxah1vLwNUifkedH/YwQezi2w4itMR07XdBeUMkVE00cSnnq ObzrUFiRlD/0pF6emD8HQbQSKRjRc1hLTGLmMUqPgl6l21lZd6SnNz3yI NE3DUZ6eIoWiIZpAJOf5CBrOPPUA7QH2OojOp9VX8cKavxE44arR4w6bl zBlk+u5aHU1oxy8mgGJkkjeEwhtgcX2lQv48By9daMOLj1D38hpCr0K5b VIX1mY2xw7Ca6IIAGxBLT29huJDICI92Ba54Vd59rxKc+NxLL3xubhGvR w==; X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="334851326" X-IronPort-AV: E=Sophos;i="5.98,259,1673942400"; d="scan'208";a="334851326" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 02:04:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="628974530" X-IronPort-AV: E=Sophos;i="5.98,259,1673942400"; d="scan'208";a="628974530" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga003.jf.intel.com with ESMTP; 14 Mar 2023 02:03:59 -0700 From: Ke Xu To: dts@dpdk.org Cc: lijuan.tu@intel.com, ke1.xu@intel.com Subject: [DTS][PATCH V1 1/2] framework/test_result: fix unsafe __set_test_case Date: Tue, 14 Mar 2023 17:01:06 +0800 Message-Id: <20230314090107.669640-2-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230314090107.669640-1-ke1.xu@intel.com> References: <20230314090107.669640-1-ke1.xu@intel.com> MIME-Version: 1.0 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 Without a pre-append check, __set_test_case method will append redundant elements when setting but locating the result at the first element. If this method is called several times, the outcome will de-organize in data structure. There is a pre-append check in __set_test_suite and __set_test_suite. This implementation imitated the methods above. Signed-off-by: Ke Xu --- framework/test_result.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/test_result.py b/framework/test_result.py index b62ed120..081b7256 100644 --- a/framework/test_result.py +++ b/framework/test_result.py @@ -232,8 +232,9 @@ class Result(object): def __set_test_case(self, test_case): cases = self.__current_cases() - cases.append(test_case) - cases.append([]) + if test_case not in cases: + cases.append(test_case) + cases.append([]) self.__test_case = cases.index(test_case) def __get_test_case(self): From patchwork Tue Mar 14 09:01:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ke Xu X-Patchwork-Id: 125095 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 A37AF41E90; Tue, 14 Mar 2023 10:04:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DAEC410DF; Tue, 14 Mar 2023 10:04:13 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 30F8440A7E for ; Tue, 14 Mar 2023 10:04:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678784652; x=1710320652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uQG51mftIjdiyug7X/j2QPTWia1092CAdr2DRPl1NEY=; b=ibmarWe0D6jWE/2zJVO3NACSiVkMrmqSB8JG2wtyK9q/k7BVnQAA7Iy1 W1v8krg6Eg5WcS8tRN01PRQAcRWhxfge02Kv52Os+QnQMeDLm2ki9hiKk x7F2QeBO+sYqDYn7zHbUbNi7UPmkYpNP48Q4yF+1V/0IHKmOzTZekwDPs m0gL3KppIZABgWdXBGP/XjngiL4+OZVjK1ndj6MFe6eU6+l/mxAzrwrPr DrSVsnPtglbEJ0xbeoqX3UnY6UlTW6B9ERb8UKucDlIZUa0Ns3tf1Y9A6 ah5HtgAct4MMUiwmj0Y/NcbaPU8+lQimT3+6Xq4LEiWu9UGagn38b+yvC g==; X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="334851371" X-IronPort-AV: E=Sophos;i="5.98,259,1673942400"; d="scan'208";a="334851371" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2023 02:04:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10648"; a="628974643" X-IronPort-AV: E=Sophos;i="5.98,259,1673942400"; d="scan'208";a="628974643" Received: from dpdk-xuke-lab.sh.intel.com ([10.67.119.8]) by orsmga003.jf.intel.com with ESMTP; 14 Mar 2023 02:04:09 -0700 From: Ke Xu To: dts@dpdk.org Cc: lijuan.tu@intel.com, ke1.xu@intel.com Subject: [DTS][PATCH V1 2/2] framework/dts: fix result output by merging cases when parsing execution requirements. Date: Tue, 14 Mar 2023 17:01:07 +0800 Message-Id: <20230314090107.669640-3-ke1.xu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230314090107.669640-1-ke1.xu@intel.com> References: <20230314090107.669640-1-ke1.xu@intel.com> MIME-Version: 1.0 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 In execution config, multi-run suites and cases are grammarly allowed. When we call for a suite multiple times, the new result will overwrite the old result totally. This fix merges duplicated lines for suites when parsing the execution configuration, preventing the potential multiple run of suites and cases. Signed-off-by: Ke Xu --- framework/dts.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/framework/dts.py b/framework/dts.py index a8e670b5..b55aed90 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -149,9 +149,32 @@ def dts_parse_config(config, section): settings.save_global_setting(settings.DPDK_RXMODE_SETTING, rx_mode) settings.save_global_setting(settings.DPDK_DCFMODE_SETTING, dcf_mode) + suite_list_dedup = {} + ## suite_list_dedup[suite_name] := { True | Set | ... } + ## True := All Cases to Run + ## Set := Listed Cases to Run for suite in test_suites: if suite == "": - test_suites.remove(suite) + pass + elif ":" in suite: + suite_name = suite[: suite.find(":")] + case_list_str = suite[suite.find(":") + 1 :] + case_list = case_list_str.split("\\") + if not suite_name in suite_list_dedup: + suite_list_dedup[suite_name] = set() + if isinstance(suite_list_dedup[suite_name], set): + suite_list_dedup[suite_name].update(case_list) + elif suite_list_dedup[suite_name] == True: + pass + else: + suite_list_dedup[suite] = True + + test_suites = [] + for suite in suite_list_dedup: + if suite_list_dedup[suite] == True: + test_suites.append(suite) + elif isinstance(suite_list_dedup[suite], set) and suite_list_dedup[suite]: + test_suites.append(suite + ":" + "\\".join(suite_list_dedup[suite])) return duts, targets, test_suites