change test_case option 15/50615/1
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Mon, 15 Jan 2018 06:48:45 +0000 (15:48 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Mon, 15 Jan 2018 07:00:23 +0000 (16:00 +0900)
This patch changes the way to specify target test case to be run,
'test_fault_management' --> 'fault_management'.

Also, the default is set to 'fault_management'. The reason to this
is not to block any other on-going activities for Fraser release.

Change-Id: I92305477a84ffa0e703c36d309fbdf97435782aa
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
doctor_tests/main.py
doctor_tests/scenario/__init__.py

index f54b640..5bd3c59 100644 (file)
@@ -163,7 +163,13 @@ class DoctorTest(object):
                 self.test_fault_management()
                 self.test_maintenance()
             else:
-                getattr(self, self.conf.test_case)()
+                function = 'test_%s' % self.conf.test_case
+                if hasattr(self, function):
+                    getattr(self, function)()
+                else:
+                    raise Exception('Can not find function <%s> in'
+                                    'DoctorTest, see config manual'
+                                    % function)
         except Exception as e:
             LOG.error('doctor test failed, Exception=%s' % e)
             sys.exit(1)
index 9e7cd11..b9dfa30 100644 (file)
@@ -11,7 +11,12 @@ from oslo_config import cfg
 
 OPTS = [
     cfg.StrOpt('test_case',
-               default='all',
-               help='the name of test case',
+               default='fault_management',
+               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"
+                    " this repo. Default is 'fault_management'. Another test"
+                    " case can be specified only if a function named"
+                    " test_<test_case>() was implemented in DoctorTest.",
                required=False),
 ]