def test(): global _services protocol.startEventQueue() atexit.register(protocol.getEventQueue().shutdown) # testTimer() try: c = tcf.connect("TCP:127.0.0.1:1534") except Exception as e: protocol.log(e) sys.exit() assert c.state == channel.STATE_OPEN if __TRACE: protocol.invokeAndWait(c.addTraceListener, TraceListener()) _services = protocol.invokeAndWait(c.getRemoteServices) print "services=", _services if "RunControl" in _services: # RunControl must be first _services.remove("RunControl") _services.insert(0, "RunControl") for service in _services: testFct = globals().get("test" + service) if testFct: print "Testing service '%s'..." % service try: testFct(c) print "Completed test of service '%s'." % service except Exception as e: protocol.log("Exception testing %s" % service, e) else: print "No test for service '%s' found." % service try: testSyncCommands(c) testTasks(c) testEvents(c) testDataCache(c) except Exception as e: protocol.log(e) if c.state == channel.STATE_OPEN: time.sleep(5) protocol.invokeLater(c.close) time.sleep(2)
def test(): global _services protocol.startEventQueue() atexit.register(protocol.getEventQueue().shutdown) # testTimer() try: c = tcf.connect("TCP:127.0.0.1:1534") except Exception as e: protocol.log(e) sys.exit() assert c.state == channel.STATE_OPEN if __TRACE: protocol.invokeAndWait(c.addTraceListener, TraceListener()) _services = sorted(protocol.invokeAndWait(c.getRemoteServices)) print("services=" + str(_services)) if "RunControl" in _services: # RunControl must be first _services.remove("RunControl") _services.insert(0, "RunControl") for service in _services: testFct = globals().get("test" + service) if testFct: print("Testing service '%s'..." % service) try: testFct(c) print("Completed test of service '%s'." % service) except Exception as e: protocol.log("Exception testing %s" % service, e) else: print("No test for service '%s' found." % service) try: testSyncCommands(c) testTasks(c) testEvents(c) testDataCache(c) except Exception as e: protocol.log(e) if c.state == channel.STATE_OPEN: time.sleep(5) protocol.invokeLater(c.close) time.sleep(2)
def test(): protocol.startEventQueue() atexit.register(protocol.getEventQueue().shutdown) #testTimer() try: c = tcf.connect("TCP:127.0.0.1:1534") except Exception as e: protocol.log(e) sys.exit() assert c.state == channel.STATE_OPEN if __TRACE: protocol.invokeLater(c.addTraceListener, TraceListener()) def printServices(): print "services=", c.getRemoteServices() protocol.invokeLater(printServices) try: testRunControl(c) testStackTrace(c) testDisassembly(c) testBreakpoints(c) testSymbols(c) testRegisters(c) testExpressions(c) testLineNumbers(c) testSyncCommands(c) testTasks(c) testEvents(c) testDataCache(c) testProcesses(c) testFileSystem(c) testMemory(c) testMemoryMap(c) testPathMap(c) testSysMonitor(c) except Exception as e: protocol.log(e) if c.state == channel.STATE_OPEN: time.sleep(5) protocol.invokeLater(c.close) time.sleep(2)
# TCF requests must be called by the dispatche thread, wait for a # maximum of 10 seconds protocol.invokeLater(callSubscribe, service=svc, streamType=streamType, listener=listener, condition=lock) lock.wait(10) # --------------------------------------------------------------------------- # # TCF initialisation protocol.startEventQueue() protocol.setLogger(TcfProtocolLogger()) atexit.register(protocol.getEventQueue().shutdown) try: c = tcf.connect("TCP:127.0.0.1:1534") except Exception as e: protocol.log(e) sys.exit() # If there is a streams service, listen to it streamsSvc = getService(c, streams.NAME) if streamsSvc: subscribe(streamsSvc, 'ProcessesV1', StreamsListener(streamsSvc)) p = start(c, '/bin/ls', '-l', '-a') # this part is a bit tricky, the runcontrol contexts which accept a resume # command are the contexts which have a state. Recursively try to find the # runcontrol context which has a state, and resume it.
streamType=streamType, listener=listener, condition=lock) lock.wait(10) # --------------------------------------------------------------------------- # # TCF initialisation protocol.startEventQueue() protocol.setLogger(TcfProtocolLogger()) atexit.register(protocol.getEventQueue().shutdown) try: c = tcf.connect("TCP:127.0.0.1:1534") except Exception as e: protocol.log(e) sys.exit() # If there is a streams service, listen to it streamsSvc = getService(c, streams.NAME) if streamsSvc: subscribe(streamsSvc, 'ProcessesV1', StreamsListener(streamsSvc)) p = start(c, '/bin/ls', '-l', '-a') # this part is a bit tricky, the runcontrol contexts which accept a resume # command are the contexts which have a state. Recursively try to find the # runcontrol context which has a state, and resume it.