define PLC_MAIL_FROM_ADDRESS
[tests.git] / qaapi / runtests.py
1 #!/usr/bin/python
2 #
3 # Sample myplc testing script that makes use of 
4 # qaapi modules. 
5 import sys
6 from pprint import pprint
7 from qa.Config import Config
8 from qa.tests.plc_configure import plc_configure
9 from qa.tests.plc_start import plc_start
10 from qa.tests.add_test_data import add_test_data
11 from qa.tests.sync_person_key import sync_person_key
12 from qa.tests.boot_node import boot_node
13 from qa.tests.get_boot_state import get_boot_state
14 from qa.tests.node_remote_call import node_remote_call
15 from qa.tests.access_slice import access_slice
16
17 def main(args):
18     if len(args) > 0:
19         config = Config(args[0])
20     else:
21         config = Config()
22     config.load("qa/qa_config.py")
23
24     plc_configure(config)("TestPLC")
25     plc_start(config)()
26
27     # Add test site, node, person and slice data
28     # Adds slice to node and person to slice 
29     config.update_api()
30     add_test_data(config)()
31
32     # Update plc with tests user's current public key
33     # person = config.TEST_PERSON_EMAIL
34     # sync_person_key(config)(person)
35
36
37     sys.exit(0)
38     # Boot test node and confirm boot state
39     boot_node(config)(node)
40
41     # Restart node manager on the node
42     restart_nm = 'service nm restart'   
43     node_remote_call(node, restart_nm)
44
45     # Try to access the test  slice on the test node
46     email = config.TEST_PERSON_EMAIL
47     slice = config.TEST_SLICE_NAME
48     access_slice(email, slice, node)
49
50     # Run node tests
51     node_run_tests(config)(node)
52
53 if __name__ == '__main__':
54     main(sys.argv[1:])