From: Marc Fiuczynski Date: Fri, 8 Feb 2008 20:11:40 +0000 (+0000) Subject: can now pass in config file as argument, which will then be used as the configuration... X-Git-Tag: 2008-02-11-last-vmware-support~3 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b77da44ed551cda4655b186dfce58a97df4db60c;p=tests.git can now pass in config file as argument, which will then be used as the configuration to the various tests --- diff --git a/qaapi/runtests.py b/qaapi/runtests.py index dd7a253..bc23bce 100755 --- a/qaapi/runtests.py +++ b/qaapi/runtests.py @@ -14,36 +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 -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()(node) - +def main(args): + if len(args) > 0: + config = Config(args[0]) + else: + config = Config() + + node = config.TEST_NODE_HOSTNAME_1 + + plc_configure(config)() + plc_start(config)() + + # Add test site, node, person and slice data + # Adds slice to node and person to slice + 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:])