add framework and tox
[doctor.git] / tests / main.py
1 ##############################################################################
2 # Copyright (c) 2017 ZTE Corporation and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 import sys
10
11 import config
12 import logger as doctor_log
13
14
15 LOG = doctor_log.Logger(__name__).getLogger()
16
17
18 class DoctorTest(object):
19
20     def __init__(self, conf):
21         self.conf = conf
22
23     def run(self):
24         """run doctor test"""
25         try:
26             LOG.info('doctor test starting.......')
27             # prepare the cloud env
28
29             # preparing VM image...
30
31             # creating test user...
32
33             # creating VM...
34
35             # creating alarm...
36
37             # starting doctor sample components...
38
39             # injecting host failure...
40
41             # verify the test results
42         except Exception as e:
43             LOG.error('doctor test failed: %s ', e)
44
45
46 def main():
47     """doctor main"""
48     conf = config.prepare_conf()
49
50     doctor = DoctorTest(conf)
51     doctor.run()
52
53
54 if __name__ == '__main__':
55     sys.exit(main())