summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2018-04-12 17:06:28 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2018-04-12 17:06:28 +0800
commit8298cd6f93c39bd2077d71ece1af93e6d51286c0 (patch)
treedab96ac950a0d971faf630f0bc369b10fb3d3bb4
parent4c1ff363e85c9f49b783c99b6f45dac66b045c60 (diff)
get 'test_case' option form environment variable
Get 'test_case' option form environment variable. If no environment variable, use the default value so that we can specify the test case in doctor verify job. Change-Id: I1bc25d024ca56637d779006d685b57254af355a5 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
-rw-r--r--doctor_tests/scenario/__init__.py5
-rw-r--r--etc/doctor.sample.conf3
2 files changed, 7 insertions, 1 deletions
diff --git a/doctor_tests/scenario/__init__.py b/doctor_tests/scenario/__init__.py
index b9dfa307..4278bb26 100644
--- a/doctor_tests/scenario/__init__.py
+++ b/doctor_tests/scenario/__init__.py
@@ -6,12 +6,15 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
+import os
+
from oslo_config import cfg
OPTS = [
cfg.StrOpt('test_case',
- default='fault_management',
+ default=os.environ.get('TEST_CASE', 'fault_management'),
+ choices=['all', 'fault_management', 'maintenance'],
help="A name of test case to be executed,"
" choices are 'all', 'fault_management' or 'maintenance'."
" Set 'all' to execute all the test cases existing in"
diff --git a/etc/doctor.sample.conf b/etc/doctor.sample.conf
index 6eeea3a5..0e8a49bb 100644
--- a/etc/doctor.sample.conf
+++ b/etc/doctor.sample.conf
@@ -51,3 +51,6 @@
#type = sample
#ip = 127.0.0.1
#port = 12346
+
+[scenario]
+#test_case = fault_management