def __init__(self, runner, interface, working_dir=None, radvd_binary=None): """ Args: runner: Object that has run_async and run methods for executing shell commands (e.g. connection.SshConnection) interface: string, The name of the interface to use (eg. wlan0). working_dir: The directory to work out of. radvd_binary: Location of the radvd binary """ if not radvd_binary: logging.debug('No radvd binary specified. ' 'Assuming radvd is in the path.') radvd_binary = 'radvd' else: logging.debug('Using radvd binary located at %s' % radvd_binary) if working_dir is None and runner == job.run: working_dir = tempfile.gettempdir() else: working_dir = '/tmp' self._radvd_binary = radvd_binary self._runner = runner self._interface = interface self._working_dir = working_dir self.config = None self._shell = shell.ShellCommand(runner, working_dir) self._log_file = '%s/radvd-%s.log' % (working_dir, self._interface) self._config_file = '%s/radvd-%s.conf' % (working_dir, self._interface) self._pid_file = '%s/radvd-%s.pid' % (working_dir, self._interface) self._ps_identifier = '%s.*%s' % (self._radvd_binary, self._config_file)
def __init__(self, runner, interface, working_dir='/tmp'): """ Args: runner: Object that has a run_async and run methods for running shell commands. interface: string, The name of the interface to use. working_dir: The directory to work out of. """ self._runner = runner self._working_dir = working_dir self._shell = shell.ShellCommand(runner, working_dir) self._log_file = 'dhcpd_%s.log' % interface self._config_file = 'dhcpd_%s.conf' % interface self._lease_file = 'dhcpd_%s.leases' % interface self._identifier = '%s.*%s' % (self.PROGRAM_FILE, self._config_file)
def __init__(self, runner, interface, working_dir='/tmp'): """ Args: runner: Object that has run_async and run methods for executing shell commands (e.g. connection.SshConnection) interface: string, The name of the interface to use (eg. wlan0). working_dir: The directory to work out of. """ self._runner = runner self._interface = interface self._working_dir = working_dir self.config = None self._shell = shell.ShellCommand(runner, working_dir) self._log_file = 'hostapd-%s.log' % self._interface self._ctrl_file = 'hostapd-%s.ctrl' % self._interface self._config_file = 'hostapd-%s.conf' % self._interface self._identifier = '%s.*%s' % (self.PROGRAM_FILE, self._config_file)