summaryrefslogtreecommitdiffstats
path: root/doctor_tests/main.py
diff options
context:
space:
mode:
authorTomi Juvonen <tomi.juvonen@nokia.com>2018-01-17 10:20:44 +0200
committerTomi Juvonen <tomi.juvonen@nokia.com>2018-08-09 12:08:49 +0300
commitb54cbc5dd2d32fcb27238680b4657ed384d021c5 (patch)
tree4a7e648892d8d1c0efe50e276452a45c754303fb /doctor_tests/main.py
parentb2bb504032ac81a2ed3f404113b097d9ce3d7f14 (diff)
Add setup and cleanup for maintenance test
JIRA: DOCTOR-106 Change-Id: Idb95e1391e8f9094f68e2c7bc79fd2d7e01af9de Signed-off-by: Tomi Juvonen <tomi.juvonen@nokia.com>
Diffstat (limited to 'doctor_tests/main.py')
-rw-r--r--doctor_tests/main.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/doctor_tests/main.py b/doctor_tests/main.py
index 79480ca1..2a8abda7 100644
--- a/doctor_tests/main.py
+++ b/doctor_tests/main.py
@@ -10,6 +10,7 @@ import os
from os.path import isfile, join
import sys
import time
+from traceback import format_exc
from doctor_tests import config
from doctor_tests.identity_auth import get_identity_auth
@@ -17,8 +18,9 @@ from doctor_tests.identity_auth import get_session
from doctor_tests.image import Image
from doctor_tests.installer import get_installer
import doctor_tests.logger as doctor_log
-from doctor_tests.os_clients import nova_client
from doctor_tests.scenario.fault_management import FaultManagement
+from doctor_tests.os_clients import nova_client
+from doctor_tests.scenario.maintenance import Maintenance
from doctor_tests.user import User
@@ -92,20 +94,33 @@ class DoctorTest(object):
LOG.info('not enough compute nodes, skipping doctor '
'maintenance test')
return
+ elif self.conf.installer.type != 'apex':
+ LOG.info('not supported installer, skipping doctor '
+ 'maintenance test')
+ return
try:
LOG.info('doctor maintenance test starting.......')
- # TODO (tojuvone) test setup and actual test
+
+ maintenance = Maintenance(self.conf, LOG)
+ maintenance.setup_maintenance(self.user)
+
+ # TODO (tojuvone) actual test
+
except Exception as e:
LOG.error('doctor maintenance test failed, Exception=%s' % e)
+ LOG.error(format_exc())
sys.exit(1)
- # TODO (tojuvone) finally: test case specific cleanup
+ finally:
+ maintenance.cleanup_maintenance()
def run(self):
"""run doctor tests"""
try:
LOG.info('doctor test starting.......')
+
# prepare common test env
self.setup()
+
if self.conf.test_case == 'all':
self.test_fault_management()
self.test_maintenance()