def __init__(self, config): self.config = config self.port_targets = {} self.port_gateways = {} self.mac_targets = {} self.result_sets = {} self._active_ports = {} self._device_groups = {} self._gateway_sets = {} self._target_mac_ip = {} self._callback_queue = [] self._callback_lock = threading.Lock() self.gcp = gcp.GcpManager(self.config, self._queue_callback) self._base_config = self._load_base_config() self.description = config.get('site_description', '').strip('\"') self._daq_version = os.environ['DAQ_VERSION'] self._lsb_release = os.environ['DAQ_LSB_RELEASE'] self._sys_uname = os.environ['DAQ_SYS_UNAME'] self.network = network.TestNetwork(config) self.result_linger = config.get('result_linger', False) self._linger_exit = 0 self.faucet_events = None self.single_shot = config.get('single_shot', False) self.event_trigger = config.get('event_trigger', False) self.fail_mode = config.get('fail_mode', False) self.run_tests = True self.stream_monitor = None self.exception = None self.run_count = 0 self.run_limit = int(config.get('run_limit', 0)) self.result_log = self._open_result_log() self._system_active = False self._dhcp_ready = set() self._ip_info = {} logging_client = self.gcp.get_logging_client() self._daq_run_id = uuid.uuid4() if logging_client: logger.set_stackdriver_client( logging_client, labels={"daq_run_id": str(self._daq_run_id)}) test_list = self._get_test_list( config.get('host_tests', self._DEFAULT_TESTS_FILE), []) if self.config.get('keep_hold'): LOGGER.info('Appending test_hold to master test list') test_list.append('hold') config['test_list'] = test_list LOGGER.info('DAQ RUN id: %s' % self._daq_run_id) LOGGER.info('Configured with tests %s' % ', '.join(config['test_list'])) LOGGER.info('DAQ version %s' % self._daq_version) LOGGER.info('LSB release %s' % self._lsb_release) LOGGER.info('system uname %s' % self._sys_uname)
def __init__(self, config): self.configurator = configurator.Configurator() self.gateway_sets = set(range(1, self.MAX_GATEWAYS + 1)) self.config = config self._result_sets = {} self._devices = Devices() self._ports = {} self._callback_queue = [] self._event_lock = threading.Lock() self.gcp = gcp.GcpManager(self.config, self._queue_callback) self._base_config = self._load_base_config() self.description = config.get('site_description', '').strip('\"') self._daq_version = os.environ['DAQ_VERSION'] self._lsb_release = os.environ['DAQ_LSB_RELEASE'] self._sys_uname = os.environ['DAQ_SYS_UNAME'] self.network = network.TestNetwork(config) self.result_linger = config.get('result_linger', False) self._linger_exit = 0 self.faucet_events = None self.single_shot = config.get('single_shot', False) self.fail_mode = config.get('fail_mode', False) self.run_trigger = config.get('run_trigger', {}) self.run_tests = True self.stream_monitor = None self.exception = None self.run_count = 0 self.run_limit = int(config.get('run_limit', 0)) self._default_port_flap_timeout = int( config.get('port_flap_timeout_sec', 0)) self.result_log = self._open_result_log() self._system_active = False logging_client = self.gcp.get_logging_client() self.daq_run_id = self._init_daq_run_id() self._device_result_client = self._init_device_result_client() if logging_client: logger.set_stackdriver_client( logging_client, labels={"daq_run_id": self.daq_run_id}) test_list = self._get_test_list( config.get('host_tests', self._DEFAULT_TESTS_FILE)) if self.config.get('keep_hold'): LOGGER.info('Appending test_hold to master test list') if 'hold' not in test_list: test_list.append('hold') config['test_list'] = test_list config['test_metadata'] = self._get_test_metadata() LOGGER.info('DAQ RUN id: %s' % self.daq_run_id) LOGGER.info('Configured with tests %s' % ', '.join(config['test_list'])) LOGGER.info('DAQ version %s' % self._daq_version) LOGGER.info('LSB release %s' % self._lsb_release) LOGGER.info('system uname %s' % self._sys_uname)
def __init__(self, config): self.config = config self.port_targets = {} self.port_gateways = {} self.mac_targets = {} self.result_sets = {} self._active_ports = {} self._device_groups = {} self._gateway_sets = {} self._target_mac_ip = {} self._callback_queue = [] self._callback_lock = threading.Lock() self.gcp = gcp.GcpManager(self.config, self._queue_callback) self._base_config = self._load_base_config() self.description = config.get('site_description', '').strip('\"') self.version = os.environ['DAQ_VERSION'] self.network = network.TestNetwork(config) self.result_linger = config.get('result_linger', False) self._linger_exit = 0 self.faucet_events = None self.single_shot = config.get('single_shot', False) self.event_trigger = config.get('event_trigger', False) self.fail_mode = config.get('fail_mode', False) self.run_tests = True self.stream_monitor = None self.exception = None self.run_count = 0 self.run_limit = int(config.get('run_limit', 0)) self.result_log = self._open_result_log() self._system_active = False self._dhcp_ready = set() self._ip_info = {} logging_client = self.gcp.get_logging_client() if logging_client: logger.set_stackdriver_client(logging_client) test_list = self._get_test_list( config.get('host_tests', self._DEFAULT_TESTS_FILE), []) if self.config.get('keep_hold'): test_list.append('hold') config['test_list'] = test_list LOGGER.info('Configured with tests %s', config['test_list'])
def _init_gcp(self): self.gcp = gcp.GcpManager(self.config, self._queue_callback) logging_client = self.gcp.get_logging_client() if logging_client: logger.set_stackdriver_client( logging_client, labels={"daq_run_id": self.daq_run_id})