summaryrefslogtreecommitdiffstats
path: root/tests/main.py
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2017-04-13 09:09:41 +0800
committerdongwenjuan <dong.wenjuan@zte.com.cn>2017-05-02 11:01:56 +0800
commitd5918a87f12fdef9bd7408c4554c42606c4896d8 (patch)
treed6b5ce364ae8a425bd3a538655d14872a9f0b0e9 /tests/main.py
parent51b2ad855f0dad6527e5ec436f6b29758c21fb80 (diff)
add image code
JIRA: DOCTOR-93 Change-Id: I6551d5e31799b967ce442cb05a664c0d64a3dcf8 Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
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():