summaryrefslogtreecommitdiffstats
path: root/tests/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/main.py')
-rw-r--r--tests/main.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/main.py b/tests/main.py
index e36bb4f0..50e0821b 100644
--- a/tests/main.py
+++ b/tests/main.py
@@ -9,16 +9,18 @@
import sys
import config
+from image import Image
import logger as doctor_log
-LOG = doctor_log.Logger(__name__).getLogger()
+LOG = doctor_log.Logger('doctor').getLogger()
class DoctorTest(object):
def __init__(self, conf):
self.conf = conf
+ self.image = Image(self.conf)
def run(self):
"""run doctor test"""
@@ -27,6 +29,7 @@ class DoctorTest(object):
# prepare the cloud env
# preparing VM image...
+ self.image.create()
# creating test user...
@@ -40,7 +43,10 @@ class DoctorTest(object):
# verify the test results
except Exception as e:
- LOG.error('doctor test failed: %s ', e)
+ LOG.error('doctor test failed, Exception=%s' % e)
+ sys.exit(1)
+ finally:
+ self.image.delete()
def main():