def start_trex(self, trex_launch_path, trex_cmd, zmq_port): self.set_status(TRexStatus.Starting) logger.info("TRex running state changed to 'Starting'.") self.set_verbose_status('TRex is starting (data is not available yet)') if not self.zmq_monitor: logger.info('Starting ZMQ monitor on port %s' % zmq_port) self.zmq_monitor = ZmqMonitorSession(self, zmq_port) self.zmq_monitor.start() else: if not self.zmq_monitor.is_alive( ) or self.zmq_monitor.zmq_port != zmq_port: if not self.zmq_monitor.is_alive(): logger.info('Old ZMQ monitor is dead, starting new') else: logger.info( 'ZMQ port is changed to %s, starting new monitor' % zmq_port) self.zmq_monitor.join() self.zmq_monitor = ZmqMonitorSession(self, zmq_port) self.zmq_monitor.start() self.zmq_monitor.first_dump = True self.errcode = None self.session = AsynchronousTRexSession(self, trex_launch_path, trex_cmd) self.session.start() self.expect_trex.set()
def start_trex(self, trex_launch_path, trex_cmd): self.set_status(TRexStatus.Starting) logger.info("TRex running state changed to 'Starting'.") self.set_verbose_status('TRex is starting (data is not available yet)') self.errcode = None self.session = AsynchronousTRexSession(self, trex_launch_path, trex_cmd) self.session.start() self.expect_trex.set()