From ffb504843611959b983614bd7b316cd3c205fd49 Mon Sep 17 00:00:00 2001 From: Ryota MIBU Date: Mon, 15 Jan 2018 15:48:45 +0900 Subject: change test_case option 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 --- doctor_tests/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'doctor_tests/main.py') diff --git a/doctor_tests/main.py b/doctor_tests/main.py index f54b6403..5bd3c596 100644 --- a/doctor_tests/main.py +++ b/doctor_tests/main.py @@ -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) -- cgit 1.2.3-korg