def defer_fake_storm(self, port, queue, start_defer, stop_defer): time.sleep(start_defer) DUT_ACTIVE.wait() PfcCmd.set_storm_status(self.dut, self.oid_map[(port, queue)], "enabled") time.sleep(stop_defer) DUT_ACTIVE.wait() PfcCmd.set_storm_status(self.dut, self.oid_map[(port, queue)], "disabled")
def pfcwd_wb_test_cleanup(self): """ Cleanup method """ yield # stop all threads that might stuck in wait DUT_ACTIVE.set() for thread in self.storm_threads: thread_exception = thread.join(timeout=0.1, suppress_exception=True) if thread_exception: logger.debug("Exception in thread %r:", thread) logger.debug("".join( traceback.format_exception(*thread_exception))) self.stop_all_storm() time.sleep(5) logger.info("--- Stop PFC WD ---") self.dut.command("pfcwd stop")