run node tests
[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 config = Config()
18 node = config.TEST_NODE_HOSTNAME_1
19 person = config.TEST_PERSON_EMAIL
20
21 #plc_configure()()
22 #plc_start()()
23
24 # Add test site, node, person and slice data
25 # Adds slice to node and person to slice 
26 add_test_data()()
27
28 # Update plc with tests user's current public key
29 sync_person_key()(person)
30
31 # exit for now untill we get node booted with correct network
32 sys.exit(0)
33 # Boot test node and confirm boot state
34 boot_node()(node)
35 if get_boot_state()(node) not in ['boot']:
36     raise Exception, "%(node)s not fully booted" % locals()
37
38 # Restart node manager on the node
39 restart_nm = 'service nm restart'       
40 node_remote_call(node, restart_nm)
41
42 # Try to access the test  slice on the test node
43 email = config.TEST_PERSON_EMAIL
44 slice = config.TEST_SLICE_NAME
45 access_slice(email, slice, node)
46
47 # Run node tests
48 node_run_tests()(node)
49