From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D4F38A0528; Thu, 9 Jul 2020 12:54:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B502D1E48F; Thu, 9 Jul 2020 12:54:16 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 394CC1DFE7 for ; Thu, 9 Jul 2020 12:54:15 +0200 (CEST) IronPort-SDR: Ns0imvpQWp9bhWKv4udXP9dYuKC4dRj7/qJkvNrBbTIG5JYygvZT1mo0qLaIYGNHfCQ0JcS2Yq SmoSgCCvyjNQ== X-IronPort-AV: E=McAfee;i="6000,8403,9676"; a="209505975" X-IronPort-AV: E=Sophos;i="5.75,331,1589266800"; d="scan'208";a="209505975" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jul 2020 03:54:14 -0700 IronPort-SDR: IjYvVriYneMbW89DprcdMpQo6SgyI5lBQhGZWqES9iEu6yBQaFkywyI2WR7CmDxVUbajjIj2P1 /OGdKXAEDdcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,331,1589266800"; d="scan'208";a="324185736" Received: from dpdk-lihong-ub1604.sh.intel.com ([10.67.118.174]) by orsmga007.jf.intel.com with ESMTP; 09 Jul 2020 03:54:13 -0700 From: lihong To: dts@dpdk.org Cc: zhaoyan.chen@intel.com, lihong Date: Thu, 9 Jul 2020 11:22:31 +0800 Message-Id: <1594264951-3502-1-git-send-email-lihongx.ma@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dts] [PATCH V1] framework: add support config test case in execution.cfg X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 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" can config which test_case you want to run in file execution.cfg, the format is: suite_name:test_case_1/test_case_2/test_case_3, Signed-off-by: lihong --- framework/dts.py | 7 +++++++ framework/test_case.py | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/framework/dts.py b/framework/dts.py index d6c4fe5..05cc012 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -432,6 +432,12 @@ def dts_run_suite(duts, tester, test_suites, target, subtitle): """ for suite_name in test_suites: try: + # check whether config the test cases + append_requested_case_list = None + if ':' in suite_name: + case_list = suite_name[suite_name.find(':')+1:] + append_requested_case_list = case_list.split('\\') + suite_name = suite_name[:suite_name.find(':')] result.test_suite = suite_name suite_module = __import__('TestSuite_' + suite_name) for test_classname, test_class in get_subclasses(suite_module, TestCase): @@ -439,6 +445,7 @@ def dts_run_suite(duts, tester, test_suites, target, subtitle): suite_obj = test_class(duts, tester, target, suite_name) suite_obj.init_log() suite_obj.set_requested_cases(requested_tests) + suite_obj.set_requested_cases(append_requested_case_list) suite_obj.set_check_inst(check=check_case_inst) suite_obj.set_subtitle(subtitle) result.nic = suite_obj.nic diff --git a/framework/test_case.py b/framework/test_case.py index 282c96d..110dafb 100644 --- a/framework/test_case.py +++ b/framework/test_case.py @@ -221,7 +221,10 @@ class TestCase(object): """ Pass down input cases list for check """ - self._requested_tests = case_list + if self._requested_tests is None: + self._requested_tests = case_list + elif case_list is not None: + self._requested_tests += case_list def set_subtitle(self, subtitle): """ -- 2.7.4