def __init__(self, recipe_path, log_ctl, res_serializer=None, pool_checks=True, packet_capture=False, defined_aliases=None, overriden_aliases=None, reduce_sync=False, restrict_pools=[]): self._res_serializer = res_serializer self._remote_capture_files = {} self._log_ctl = log_ctl self._recipe_path = Path(None, recipe_path).abs_path() self._msg_dispatcher = MessageDispatcher(log_ctl) self._packet_capture = packet_capture self._reduce_sync = reduce_sync self._parser = RecipeParser(recipe_path) self.remove_saved_machine_config() self._machines = {} self._network_bridges = {} self._tasks = [] mac_pool_range = lnst_config.get_option('environment', 'mac_pool_range') self._mac_pool = MacPool(mac_pool_range[0], mac_pool_range[1]) self._parser.set_machines(self._machines) self._parser.set_aliases(defined_aliases, overriden_aliases) self._recipe = self._parser.parse() conf_pools = lnst_config.get_pools() pools = {} if len(restrict_pools) > 0: for pool_name in restrict_pools: if pool_name in conf_pools: pools[pool_name] = conf_pools[pool_name] elif len(restrict_pools) == 1 and os.path.isdir(pool_name): pools = {"cmd_line_pool": pool_name} else: raise NetTestError("Pool %s does not exist!" % pool_name) else: pools = conf_pools sp = SlavePool(pools, pool_checks) self._slave_pool = sp mreq = self._get_machine_requirements() sp.set_machine_requirements(mreq) modules_dirs = lnst_config.get_option('environment', 'module_dirs') tools_dirs = lnst_config.get_option('environment', 'tool_dirs') self._resource_table = {} self._resource_table["module"] = self._load_test_modules(modules_dirs) self._resource_table["tools"] = self._load_test_tools(tools_dirs)
def __init__(self, recipe_path, log_ctl, res_serializer=None, pool_checks=True, packet_capture=False, defined_aliases=None, overriden_aliases=None, reduce_sync=False): self._res_serializer = res_serializer self._remote_capture_files = {} self._log_ctl = log_ctl self._recipe_path = Path(None, recipe_path).abs_path() self._msg_dispatcher = MessageDispatcher(log_ctl) self._packet_capture = packet_capture self._reduce_sync = reduce_sync self._parser = RecipeParser(recipe_path) self.remove_saved_machine_config() sp = SlavePool(lnst_config.get_option('environment', 'pool_dirs'), pool_checks) self._slave_pool = sp self._machines = {} self._network_bridges = {} self._tasks = [] mac_pool_range = lnst_config.get_option('environment', 'mac_pool_range') self._mac_pool = MacPool(mac_pool_range[0], mac_pool_range[1]) self._parser.set_machines(self._machines) self._parser.set_aliases(defined_aliases, overriden_aliases) self._recipe = self._parser.parse() mreq = self._get_machine_requirements() sp.set_machine_requirements(mreq) modules_dirs = lnst_config.get_option('environment', 'module_dirs') tools_dirs = lnst_config.get_option('environment', 'tool_dirs') self._resource_table = {} self._resource_table["module"] = self._load_test_modules(modules_dirs) self._resource_table["tools"] = self._load_test_tools(tools_dirs)
def __init__(self, recipe_path, log_ctl, cleanup=False, res_serializer=None, pool_checks=True): self._docleanup = cleanup self._res_serializer = res_serializer self._remote_capture_files = {} self._log_ctl = log_ctl self._recipe_path = recipe_path self._msg_dispatcher = MessageDispatcher(log_ctl) sp = SlavePool(lnst_config.get_option('environment', 'pool_dirs'), check_process_running("libvirtd"), pool_checks) self._slave_pool = sp self._machines = {} self._network_bridges = {} self._recipe = recipe = {} recipe["networks"] = {} recipe["machines"] = {} recipe["switches"] = {} mac_pool_range = lnst_config.get_option('environment', 'mac_pool_range') self._mac_pool = MacPool(mac_pool_range[0], mac_pool_range[1]) parser = RecipeParse(recipe_path) parser.set_target(self._recipe) parser.set_machines(self._machines) parser.register_event_handler("provisioning_requirements_ready", self._prepare_provisioning) parser.register_event_handler("interface_config_ready", self._prepare_interface) modules_dirs = lnst_config.get_option('environment', 'module_dirs') tools_dirs = lnst_config.get_option('environment', 'tool_dirs') self._resource_table = {} self._resource_table["module"] = self._load_test_modules(modules_dirs) self._resource_table["tools"] = self._load_test_tools(tools_dirs) self._parser = parser