X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=doctor_tests%2Fmain.py;h=5bd3c596360e630d68f2a020b7a2687982ae942e;hb=ffb504843611959b983614bd7b316cd3c205fd49;hp=f54b6403e12fa2f2c8860690ea76264fbc33bc81;hpb=8b4fa81e06057e2e0fbda2071c6fbf46cda7a45f;p=doctor.git 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)