def subtest_done(self, subtest): self.nsubtests_running -= 1 if subtest.rval == 0: self.rval -= 1 if self.nsubtests_running == 0: if self.rval == 1: self.rval = 0 ED2.breakLoop()
def results_received(results): global external_command external_command.shutdown() # Give threads time to finish sleep(0.05) if not results == test_data: print(test_data, results) exit(1) ED2.breakLoop()
def pong_received(self, data, address, udp_server, rtime): if udp_server.uopts.family == socket.AF_INET: print('pong_received') if data != self.pong_data or address != self.ping_raddr: print(data, address, self.pong_data, self.ping_raddr) exit(1) else: print('pong_received6') if data != self.pong_data6 or address != self.ping_raddr6: print(data, address, self.pong_data6, self.ping_raddr6) exit(1) self.npongs -= 1 if self.npongs == 0: ED2.breakLoop()
def executeStop(self): if not self.safe_stop: return self.global_config['_executeStop_count'] += 1 acalls = [x for x in self.ccmap if x.state in (CCStateConnected, CCStateARComplete)] nactive = len(acalls) print('[%d]: executeStop is invoked, %d calls in map, %d active' % \ (self.global_config['_my_pid'], len(self.ccmap), nactive)) if self.global_config['_executeStop_count'] >= 5 and nactive > 0: print('executeStop: some sessions would not die, forcing exit:') for cc in acalls: print('\t' + str(cc)) nactive = 0 if nactive > 0: return self.er_timer.cancel() del self.er_timer sys.stdout.flush() sys.stderr.flush() ED2.breakLoop() return
def executeStop(self): if not self.safe_stop: return self.global_config['_executeStop_count'] += 1 acalls = [ x for x in self.ccmap if x.state in (CCStateConnected, CCStateARComplete) ] nactive = len(acalls) print('[%d]: executeStop is invoked, %d calls in map, %d active' % \ (self.global_config['_my_pid'], len(self.ccmap), nactive)) if self.global_config['_executeStop_count'] >= 5 and nactive > 0: print('executeStop: some sessions would not die, forcing exit:') for cc in acalls: print('\t' + str(cc)) nactive = 0 if nactive > 0: return self.er_timer.cancel() del self.er_timer sys.stdout.flush() sys.stderr.flush() ED2.breakLoop() return
def test2(arguments, testnum, mtm): arguments['delay'] = mtm.offsetFromNow() print(testnum, arguments['delay']) arguments['test'] = 'bar' ED2.breakLoop()
def test(arguments): arguments['test'] = not arguments['test'] ED2.breakLoop()
def display(*args): print('got:', args) ED2.breakLoop()
def test1(arguments, testnum): print(testnum) arguments['test'] = True ED2.breakLoop()
def terminate(): ED2.breakLoop()
def display(res, ro, arg): print(res, arg) ro.rval = (res, arg) ED2.breakLoop()
def timeout(self): ED2.breakLoop()
def test2(arguments, testnum): print(testnum) arguments['test'] = 'bar' ED2.breakLoop()
def callback(clm, cmd): print('in:', cmd) clm.send('hello, there!\n') clm.close() ED2.breakLoop()
def waitonline(rpc): if rpc.online: ED2.breakLoop()
def terminate(signum): ED2.breakLoop()
def gotreply(self, *args): print(args) ED2.breakLoop()
def display(*args): print(args) ED2.breakLoop()