diff options
Diffstat (limited to 'cpp/test/Glacier2/attack/run.py')
-rwxr-xr-x | cpp/test/Glacier2/attack/run.py | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/cpp/test/Glacier2/attack/run.py b/cpp/test/Glacier2/attack/run.py index 6c483400c4c..3669b385297 100755 --- a/cpp/test/Glacier2/attack/run.py +++ b/cpp/test/Glacier2/attack/run.py @@ -10,34 +10,29 @@ import os, sys -for toplevel in [".", "..", "../..", "../../..", "../../../.."]: - toplevel = os.path.normpath(toplevel) - if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")): - break -else: +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: raise "can't find toplevel directory!" +sys.path.append(os.path.join(path[0])) +from scripts import * -sys.path.append(os.path.join(toplevel, "config")) -import TestUtil -TestUtil.processCmdLine() - +testdir = os.getcwd() router = os.path.join(TestUtil.getCppBinDir(), "glacier2router") -args = r' --Glacier2.RoutingTable.MaxSize=10' + \ - r' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \ - r' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \ - r' --Ice.Admin.InstanceName=Glacier2' + \ - r' --Glacier2.CryptPasswords="' + TestUtil.getMappingDir(__file__) + \ - r'/test/Glacier2/attack/passwords" 2>&1' +args = ' --Glacier2.RoutingTable.MaxSize=10' + \ + ' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \ + ' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \ + ' --Ice.Admin.InstanceName=Glacier2' + \ + ' --Glacier2.CryptPasswords="' + os.path.join(testdir, "passwords") + '"' print "starting router...", -starterPipe = TestUtil.startServer(router, args) -TestUtil.getServerPid(starterPipe) -TestUtil.getAdapterReady(starterPipe, True, 2) +starterProc = TestUtil.startServer(router, args, count=2) print "ok" -name = os.path.join("Glacier2", "attack") - -TestUtil.mixedClientServerTest(name) +TestUtil.clientServerTest() -sys.exit(0) +starterProc.waitTestSuccess() |