def __init__(self, test): logger.debug("Agent INIT") self.test = test self.ti = test.rwmain.new_tasklet_info("AGENT", 0) self.apih = RwDts.Api.new(self.ti, RwDtsYang.get_schema(), self.dts_state_change_cb, self)
def start(self): """ The task start callback """ super(RwLogTestTasklet, self).start() self._dts = rift.tasklets.DTS(self.tasklet_info, RwDtsYang.get_schema(), self.loop, self.on_dts_state_change)
def setUp(self): """ 1. Creates an asyncio loop 2. Triggers the hook configure_test """ def scheduler_tick(self, *args): self.call_soon(self.stop) self.run_forever() # Init params: loop & timers self.loop = asyncio.new_event_loop() self.loop.scheduler_tick = types.MethodType(scheduler_tick, self.loop) self.asyncio_timer = None self.stop_timer = None self.__class__.id_cnt += 1 self.dts_mgmt = rift.tasklets.DTS(self.tinfo, RwDtsYang.get_schema(), self.loop) self.configure_test(self.loop, self.__class__.id_cnt)