Beispiel #1
0
def main(config, test_run_file):
    """Main routine - assess which tests should be run, and create
    output file"""
    
    session = get_xapi_session(config)

    # Release current logger before running logrotate.
    utils.release_logging()

    # Run log rotate before ACK produces any log.
    for host_ref in session.xenapi.host.get_all():
        res = session.xenapi.host.call_plugin(host_ref, 
                                    'autocertkit',
                                    'run_ack_logrotate', 
                                    {})
    utils.configure_logging('auto-cert-kit')

    pre_flight_checks(session, config)

    config['xs_version'] = utils.get_xenserver_version(session)
    config['xcp_version'] = utils.get_xcp_version(session)

    generate_test_config(session, config, test_run_file)
    # Logout of XAPI session anyway - the test runner will create a new session
    # if needed. (We might only be generating).
    session.logout()

    if 'generate' in config:
        #Generate config file only
        utils.log.info("Test file generated")
        return "OK"

    #Kick off the testrunner
    utils.log.info("Starting Test Runner from ACK CLI.")
    test_file, output = test_runner.run_tests_from_file(test_run_file)
Beispiel #2
0
def main(config, test_run_file):
    """Main routine - assess which tests should be run, and create
    output file"""

    session = get_xapi_session(config)

    # Release current logger before running logrotate.
    utils.release_logging()

    # Run log rotate before ACK produces any log.
    for host_ref in session.xenapi.host.get_all():
        session.xenapi.host.call_plugin(host_ref, 'autocertkit',
                                        'run_ack_logrotate', {})
    utils.configure_logging('auto-cert-kit')

    pre_flight_checks(session, config)

    config['xs_version'] = utils.get_xenserver_version(session)
    config['xcp_version'] = utils.get_xcp_version(session)

    generate_test_config(session, config, test_run_file)
    # Logout of XAPI session anyway - the test runner will create a new session
    # if needed. (We might only be generating).
    session.logout()

    if 'generate' in config:
        # Generate config file only
        utils.log.info("Test file generated")
        return "OK"

    # Kick off the testrunner
    utils.log.info("Starting Test Runner from ACK CLI.")
    test_file, output = test_runner.run_tests_from_file(test_run_file)
Beispiel #3
0
def main(config, test_run_file):
    """Main routine - assess which tests should be run, and create
    output file"""
    
    session = get_xapi_session(config)
    config['xs_version'] = utils.get_xenserver_version(session)

    pre_flight_checks(session, config)

    generate_test_config(session, config, test_run_file)
    # Logout of XAPI session anyway - the test runner will create a new session
    # if needed. (We might only be generating).
    session.logout()

    if 'generate' in config:
        #Generate config file only
        utils.log.info("Test file generated")
        return "OK"

    #Kick off the testrunner
    test_file, output = test_runner.run_tests_from_file(test_run_file)
Beispiel #4
0
def main(config, test_run_file):
    """Main routine - assess which tests should be run, and create
    output file"""

    session = get_xapi_session(config)

    # Ensure that all hosts in the pool have booted up.
    utils.wait_for_hosts(session)

    # Start Logger
    utils.init_ack_logging(session)

    utils.log.info("Options: %s" % config)

    # Pre checks before running tests
    pre_flight_checks(session, config)

    config['xs_version'] = utils.get_xenserver_version(session)
    config['xcp_version'] = utils.get_xcp_version(session)

    generate_test_config(session, config, test_run_file)

    if 'generate' in config:
        # Generate config file only
        utils.log.info("Test file generated")
        session.logout()
        return "OK"

    # cleanup in case previous run did not complete entirely
    if utils.pool_wide_cleanup(session):
        utils.reboot_normally(session)

    # Logout of XAPI session anyway - the test runner will create a new session
    # if needed. (We might only be generating).
    session.logout()

    # Kick off the testrunner
    utils.log.info("Starting Test Runner from ACK CLI.")
    test_file, output = test_runner.run_tests_from_file(test_run_file)
Beispiel #5
0
def main(config, test_run_file):
    """Main routine - assess which tests should be run, and create
    output file"""

    session = get_xapi_session(config)

    # Start Logger
    utils.init_ack_logging(session)

    utils.log.info("Options: %s" % config)

    # Pre checks before running tests
    pre_flight_checks(session, config)

    config['xs_version'] = utils.get_xenserver_version(session)
    config['xcp_version'] = utils.get_xcp_version(session)

    generate_test_config(session, config, test_run_file)

    if 'generate' in config:
        # Generate config file only
        utils.log.info("Test file generated")
        session.logout()
        return "OK"

    # cleanup in case previous run did not complete entirely
    if utils.pool_wide_cleanup(session):
        utils.reboot_normally(session)

    # Logout of XAPI session anyway - the test runner will create a new session
    # if needed. (We might only be generating).
    session.logout()

    # Kick off the testrunner
    utils.log.info("Starting Test Runner from ACK CLI.")
    test_file, output = test_runner.run_tests_from_file(test_run_file)