summaryrefslogtreecommitdiffstats
path: root/tests/main.py
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2017-06-22 19:26:05 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2017-06-30 17:13:24 +0800
commit6023c50ca1a02808703ffb5a3cb18375a1c5a8fa (patch)
tree9613f46486bce5466ebe24ffbbbb76279243e868 /tests/main.py
parent1bc6eb0e8f1ed1e20edcdd7362c23c8948ed3d77 (diff)
support config file
Change-Id: Ib8e696acfe21787904fce6838341f3a256aa0267 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'tests/main.py')
-rw-r--r--tests/main.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/main.py b/tests/main.py
index 46f0c894..bb2c912d 100644
--- a/tests/main.py
+++ b/tests/main.py
@@ -6,6 +6,8 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+import os
+from os.path import isfile, join
import sys
import config
@@ -58,7 +60,13 @@ class DoctorTest(object):
def main():
"""doctor main"""
- conf = config.prepare_conf()
+ doctor_root_dir = os.path.dirname(os.getcwd())
+ config_file_dir = '{0}/{1}'.format(doctor_root_dir, 'etc/')
+ config_files = [join(config_file_dir, f) for f in os.listdir(config_file_dir)
+ if isfile(join(config_file_dir, f))]
+
+ conf = config.prepare_conf(args=sys.argv[1:],
+ config_files=config_files)
doctor = DoctorTest(conf)
doctor.run()