diff options
Diffstat (limited to 'cpp/test/Glacier2/ssl/run.py')
-rwxr-xr-x | cpp/test/Glacier2/ssl/run.py | 67 |
1 files changed, 26 insertions, 41 deletions
diff --git a/cpp/test/Glacier2/ssl/run.py b/cpp/test/Glacier2/ssl/run.py index 2c39f0d3e09..0b5b77d2dcd 100755 --- a/cpp/test/Glacier2/ssl/run.py +++ b/cpp/test/Glacier2/ssl/run.py @@ -10,63 +10,48 @@ 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() - -name = os.path.join("Glacier2", "ssl") - -testdir = os.path.dirname(os.path.abspath(__file__)) -server = os.path.join(testdir, "server") +server = os.path.join(os.getcwd(), "server") print "starting server...", -serverPipe = TestUtil.startServer(server, " 2>&1") -TestUtil.getServerPid(serverPipe) -TestUtil.getAdapterReady(serverPipe) +serverProc = TestUtil.startServer(server) print "ok" router = os.path.join(TestUtil.getCppBinDir(), "glacier2router") -args = r' --Ice.Warn.Dispatch=0' + \ - r' --Glacier2.AddSSLContext=1' + \ - r' --Glacier2.Client.Endpoints="tcp -h 127.0.0.1 -p 12347 -t 10000:ssl -h 127.0.0.1 -p 12348 -t 10000"' + \ - r' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1 -t 10000"' \ - r' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12349 -t 10000"' + \ - r' --Ice.Admin.InstanceName=Glacier2' + \ - r' --Glacier2.SessionManager="sessionmanager:tcp -h 127.0.0.1 -p 12350 -t 10000"' + \ - r' --Glacier2.PermissionsVerifier="Glacier2/NullPermissionsVerifier"' + \ - r' --Glacier2.SSLSessionManager="sslsessionmanager:tcp -h 127.0.0.1 -p 12350 -t 10000"' + \ - r' --Glacier2.SSLPermissionsVerifier="sslverifier:tcp -h 127.0.0.1 -p 12350 -t 10000"' +args = ' --Ice.Warn.Dispatch=0' + \ + ' --Glacier2.AddSSLContext=1' + \ + ' --Glacier2.Client.Endpoints="tcp -h 127.0.0.1 -p 12347 -t 10000:ssl -h 127.0.0.1 -p 12348 -t 10000"' + \ + ' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1 -t 10000"' \ + ' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12349 -t 10000"' + \ + ' --Ice.Admin.InstanceName=Glacier2' + \ + ' --Glacier2.SessionManager="sessionmanager:tcp -h 127.0.0.1 -p 12350 -t 10000"' + \ + ' --Glacier2.PermissionsVerifier="Glacier2/NullPermissionsVerifier"' + \ + ' --Glacier2.SSLSessionManager="sslsessionmanager:tcp -h 127.0.0.1 -p 12350 -t 10000"' + \ + ' --Glacier2.SSLPermissionsVerifier="sslverifier:tcp -h 127.0.0.1 -p 12350 -t 10000"' routerCfg = TestUtil.DriverConfig("server") routerCfg.protocol = "ssl" print "starting router...", -starterPipe = TestUtil.startServer(router, args + " 2>&1", routerCfg) -TestUtil.getServerPid(starterPipe) -TestUtil.getAdapterReady(starterPipe, True, 2) +starterProc = TestUtil.startServer(router, args, routerCfg, count = 2) print "ok" clientCfg = TestUtil.DriverConfig("client") clientCfg.protocol = "ssl" -client = os.path.join(testdir, "client") +client = os.path.join(os.getcwd(), "client") print "starting client...", -clientPipe = TestUtil.startClient(client, "", clientCfg) +clientProc = TestUtil.startClient(client, "", clientCfg) print "ok" -TestUtil.printOutputFromPipe(clientPipe) - -clientStatus = TestUtil.closePipe(clientPipe) -if clientStatus: - TestUtil.killServers() - -if clientStatus or TestUtil.serverStatus(): - sys.exit(1) - -sys.exit(0) +clientProc.waitTestSuccess() +serverProc.waitTestSuccess() +starterProc.waitTestSuccess() |