X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=qaapi%2Fruntests.py;h=9ce212fc3db6202961bcc1857e3f5ffc9de50de1;hb=c60ee8339624903382f0fa98e9afc552bbedc90d;hp=a35f3f7003fc507b5bf9b4864f3244b606f3642f;hpb=566a206cbfe23bc1072df7c782e2a47031a9ebf7;p=tests.git diff --git a/qaapi/runtests.py b/qaapi/runtests.py index a35f3f7..9ce212f 100755 --- a/qaapi/runtests.py +++ b/qaapi/runtests.py @@ -14,34 +14,41 @@ from qa.tests.get_boot_state import get_boot_state from qa.tests.node_remote_call import node_remote_call from qa.tests.access_slice import access_slice -config = Config() -node = config.TEST_NODE_HOSTNAME_1 -person = config.TEST_PERSON_EMAIL - -plc_configure()() -#plc_start()() - -# Add test site, node, person and slice data -# Adds slice to node and person to slice -add_test_data()() - -# Update plc with tests user's current public key -sync_person_key()(person) - -# exit for now untill we get node booted with correct network -sys.exit(0) -# Boot test node and confirm boot state -boot_node()(node) -if get_boot_state()(node) not in ['boot']: - raise Exception, "%(node)s not fully booted" % locals() - -# Restart node manager on the node -priv_key_path = "/etc/planetlab/root_ssh_key.rsa" % locals() -restart_nm = 'service nm restart' -node_remote_call(priv_key_path, node, restart_nm) - -# Try to access the test slice on the test node -email = config.TEST_PERSON_EMAIL -slice = config.TEST_SLICE_NAME -access_slice(email, slice, node) - +def main(args): + if len(args) > 0: + config = Config(args[0]) + else: + config = Config() + config.load("qa/qa_config.py") + + plc_configure(config)("TestPLC") + plc_start(config)() + + # Add test site, node, person and slice data + # Adds slice to node and person to slice + config.update_api() + add_test_data(config)() + + # Update plc with tests user's current public key + # person = config.TEST_PERSON_EMAIL + # sync_person_key(config)(person) + + + sys.exit(0) + # Boot test node and confirm boot state + boot_node(config)(node) + + # Restart node manager on the node + restart_nm = 'service nm restart' + node_remote_call(node, restart_nm) + + # Try to access the test slice on the test node + email = config.TEST_PERSON_EMAIL + slice = config.TEST_SLICE_NAME + access_slice(email, slice, node) + + # Run node tests + node_run_tests(config)(node) + +if __name__ == '__main__': + main(sys.argv[1:])