Exemple #1
0
        usage(ArgMismatchException('Must specify at least one test with the -t or --tests option'))

    root_dir = LinuxCLI().cmd('pwd').strip()
    print 'Setting root dir to: ' + root_dir

    client_impl = None
    if client_impl_type == 'neutron':
        client_impl = create_neutron_client(**client_args)
    elif client_impl_type == 'midonet':
        client_impl = create_midonet_client(**client_args)
    else:
        raise ArgMismatchException('Invalid client API implementation:' + client_impl_type)

    print 'Setting up log manager'
    log_manager = LogManager(root_dir=log_dir)
    console_log = log_manager.add_stdout_logger(name='tsm-run-console',
                                                log_level=logging.DEBUG if debug is True else logging.INFO)
    log_manager.rollover_logs_fresh(file_filter='*.log')

    console_log.debug('Setting up PTM')
    ptm = PhysicalTopologyManager(root_dir=root_dir, log_manager=log_manager)
    ptm.configure_logging(debug=debug)

    console_log.debug('Setting up VTM')
    vtm = VirtualTopologyManager(physical_topology_manager=ptm, client_api_impl=client_impl, log_manager=log_manager)

    console_log.debug('Setting up TSM')
    tsm = TestSystemManager(ptm, vtm, log_manager=log_manager)
    tsm.configure_logging(debug=debug)

    scenario_filters = [TestScenario.get_class(s) for s in scenario_filter_list] \
        if len(scenario_filter_list) != 0 else None
 def test_stdout(self):
     lm = LogManager()
     lm.add_format('test', logging.Formatter('%(asctime)s TEST - %(levelname)s - %(message)s'))
     logger = lm.add_stdout_logger(format_name='test')
     logger.info("Test!")
     self.assertTrue(True)