def _realStart(self, transmissions, **parameters):
        sys.path.insert(0, self.playgroundPath)
        import playground
        print "Starting test for", self.playgroundPath, playground
        import test_throughput_core as core
        from playground import playgroundlog
        logctx = playgroundlog.LoggingContext("peer_%s" % self.testId())

        # Uncomment the next line to turn on "packet tracing"
        #logctx.doPacketTracing = True

        playgroundlog.startLogging(logctx)
        #playgroundlog.UseStdErrHandler(True)
        if self.stackName:
            print "importing stack", stackName
            try:
                exec("import " + self.stackName)
            except Exception, e:
                print "Failed to start because could not import stack", self.stackName, e
                return
            stack = eval(self.stackName)
Esempio n. 2
0
'''
Created on Sep 10, 2016

@author: sethjn
'''

from playground import playgroundlog
from playground.network.gate import Service, ConnectionData
from playground.twisted.error.ErrorHandlers import TwistedShutdownErrorHandler
from twisted.internet import reactor
import sys

if __name__ == "__main__":
    gateConfig = len(sys.argv) == 2 and sys.argv[1] or None
    g2gConnect = ConnectionData.CreateFromConfig(gateConfig)
    logctx = playgroundlog.LoggingContext("GATE_%s" %
                                          g2gConnect.playgroundAddr)

    # Uncomment the next line to turn on "packet tracing"
    #logctx.doPacketTracing = True

    playgroundlog.startLogging(logctx)
    playgroundlog.UseStdErrHandler(True)
    TwistedShutdownErrorHandler.HandleRootFatalErrors()
    Service.Create(reactor, gateConfig)
    reactor.run()