From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 145091F5 for ; Wed, 26 Jul 2017 11:23:09 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2017 02:23:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,414,1496127600"; d="scan'208";a="882956301" Received: from dpdk-test38.sh.intel.com ([10.67.111.97]) by FMSMGA003.fm.intel.com with ESMTP; 26 Jul 2017 02:23:08 -0700 From: Marvin Liu To: dts@dpdk.org Cc: Marvin Liu Date: Wed, 26 Jul 2017 05:20:57 -0400 Message-Id: <1501060860-63777-2-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1501060860-63777-1-git-send-email-yong.liu@intel.com> References: <1501056972-59668-1-git-send-email-yong.liu@intel.com> <1501060860-63777-1-git-send-email-yong.liu@intel.com> Subject: [dts] [PATCH v2 1/4] framework setting: support configuration file folder change 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: , X-List-Received-Date: Wed, 26 Jul 2017 09:23:10 -0000 By default, configuration files will be loaded from default folder. It will be inconvenience for backup local configuration files. In this patch, add one new environment variable "DTS_CFG_FOLDER" which can change the default folder of configuration files. Execution configuration file will also be loaded from this folder. Signed-off-by: Marvin Liu diff --git a/framework/dts.py b/framework/dts.py index 7835574..26042cf 100644 --- a/framework/dts.py +++ b/framework/dts.py @@ -474,6 +474,10 @@ def run_all(config_file, pkgName, git, patch, skip_setup, requested_tests = test_cases # Read config file + dts_cfg_folder = settings.load_global_setting(settings.DTS_CFG_FOLDER) + if dts_cfg_folder != '': + config_file = dts_cfg_folder + os.sep + config_file + config = ConfigParser.SafeConfigParser() load_cfg = config.read(config_file) if len(load_cfg) == 0: diff --git a/framework/settings.py b/framework/settings.py index f0f3c8f..d306de2 100644 --- a/framework/settings.py +++ b/framework/settings.py @@ -188,14 +188,14 @@ Global macro for dts. IXIA = "ixia" """ -The root path of framework configs. +The log name seperater. """ -CONFIG_ROOT_PATH = "./conf/" +LOG_NAME_SEP = '.' """ -The log name seperater. +Section name for suite level configuration """ -LOG_NAME_SEP = '.' +SUITE_SECTION_NAME = "suite" """ DTS global environment variable @@ -209,6 +209,8 @@ DEBUG_SETTING = "DTS_DEBUG_ENABLE" DEBUG_CASE_SETTING = "DTS_DEBUGCASE_ENABLE" DPDK_RXMODE_SETTING = "DTS_DPDK_RXMODE" DTS_ERROR_ENV = "DTS_RUNNING_ERROR" +DTS_CFG_FOLDER = "DTS_CFG_FOLDER" + """ DTS global error table @@ -335,3 +337,12 @@ def accepted_nic(pci_id): return True return False + +""" +The root path of framework configs. +""" +dts_cfg_folder = load_global_setting(DTS_CFG_FOLDER) +if dts_cfg_folder != '': + CONFIG_ROOT_PATH = dts_cfg_folder +else: + CONFIG_ROOT_PATH = "./conf" -- 1.9.3