Example #1
0
def main():
    start_time = time.time()
    log = logging.getLogger('test')
    config = read_test_configuration()
    #    _step('config:\n' + pformat(config.as_dict()))
    _step('read config file')
    test = SystemTest(config)

    try:
        _step('connecting to agent')
        test.reconnect_system(cloudinitd=False, filter=agent_id('server'))
        test.system = None

        _step('taking inventory')
        inventory = test.get_inventory()
        _step('inventory: ' + ', '.join(inventory.keys()))

        _step('performing base preload')
        preload_start_time = time.time()
        test.init_system()
        preload_time = time.time()
        _step("preload took %.2f seconds" % (preload_time-preload_start_time))

        config = test.get_preload_template()
        nrange = test.get_preload_range(config)
        for n in nrange:
            _step("starting device %d"%n)
            device_begin = time.time()
            test.init_device(config,n, catch_up_frequency=1000) # some tests do not run logging_transform
            elapsed = time.time() - device_begin
            _step("completed device %d launch in %f seconds" % (n,elapsed))
            time.sleep(120)
            _rates(test.get_message_rates())

        _step('performing test')
        results = test.perform_test()
        _step('*** test completed! ***')
        if results:
            _step('results: ' + str(results))
    except Exception,e:
        log.error('test failed', exc_info=True)
Example #2
0
def main():
    start_time = time.time()
    log = logging.getLogger('test')
    config = read_test_configuration()
    _step('read config file')
    test = SystemTest(config)

    try:
        _step('launching system')
        test.launch_system()
        launch_time = time.time()
        _step("launch took %.2f seconds" % (launch_time-start_time))

        _step('taking inventory')
        inventory = test.get_inventory()
        inventory_time = time.time()
        _step('inventory: ' + ', '.join(inventory.keys()))
        _step('performing base preload')
        test.init_system()
        preload_time = time.time()
        _step("preload took %.2f seconds" % (preload_time-launch_time))

        config = test.get_preload_template()
        nrange = test.get_preload_range(config)
        for n in nrange:
            _step("starting device %d"%n)
            device_begin = time.time()
            test.init_device(config,n, catch_up_frequency=50)
            elapsed = time.time() - device_begin
            _step("completed device %d launch in %f seconds" % (n,elapsed))
            _rates(test.get_message_rates(), n)

        _step('performing test')
        results = test.perform_test()
        _step('*** test completed! ***')
        if results:
            _step('results: ' + str(results))
    except Exception,e:
        log.error('test failed @ %s', time.ctime(), exc_info=True)