test suite reviews and discussions
 help / color / mirror / Atom feed
From: Marvin Liu <yong.liu@intel.com>
To: dts@dpdk.org
Cc: Marvin Liu <yong.liu@intel.com>
Subject: [dts] [PATCH v2 1/4] framework setting: support configuration file folder change
Date: Wed, 26 Jul 2017 05:20:57 -0400	[thread overview]
Message-ID: <1501060860-63777-2-git-send-email-yong.liu@intel.com> (raw)
In-Reply-To: <1501060860-63777-1-git-send-email-yong.liu@intel.com>

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 <yong.liu@intel.com>

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

  reply	other threads:[~2017-07-26  9:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-26  8:16 [dts] [PATCH v1 0/4] support suite and case level configuration Marvin Liu
2017-07-26  8:16 ` [dts] [PATCH v1 1/4] framework setting: support configuration file folder change Marvin Liu
2017-07-26  8:16 ` [dts] [PATCH v1 2/4] framework config: support suite&case level configuration Marvin Liu
2017-07-26  8:16 ` [dts] [PATCH v1 3/4] framework: enhance test case execution process Marvin Liu
2017-07-26  8:16 ` [dts] [PATCH v1 4/4] conf: add suite and case level configuration sample Marvin Liu
2017-07-26  9:20 ` [dts] [PATCH v2 0/4] support suite and case level configuration Marvin Liu
2017-07-26  9:20   ` Marvin Liu [this message]
2017-07-26  9:20   ` [dts] [PATCH v2 2/4] framework config: support suite&case " Marvin Liu
2017-07-26  9:20   ` [dts] [PATCH v2 3/4] framework: enhance test case execution process Marvin Liu
2017-07-26  9:21   ` [dts] [PATCH v2 4/4] conf: add suite and case level configuration sample Marvin Liu
2017-07-27  1:07   ` [dts] [PATCH v3 0/4] support suite and case level configuration Marvin Liu
2017-07-27  1:07     ` [dts] [PATCH v3 1/4] framework setting: support change configuration file folder Marvin Liu
2017-07-27  1:07     ` [dts] [PATCH v3 2/4] framework config: support suite&case level configuration Marvin Liu
2017-07-27  1:07     ` [dts] [PATCH v3 3/4] framework: enhance test case execution process Marvin Liu
2017-07-27  1:07     ` [dts] [PATCH v3 4/4] conf: add suite and case level configuration sample Marvin Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1501060860-63777-2-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).