summaryrefslogtreecommitdiff
path: root/cpp/test/Glacier2/sessionControl/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Glacier2/sessionControl/run.py')
-rwxr-xr-xcpp/test/Glacier2/sessionControl/run.py59
1 files changed, 22 insertions, 37 deletions
diff --git a/cpp/test/Glacier2/sessionControl/run.py b/cpp/test/Glacier2/sessionControl/run.py
index 790b71662a5..8b28a57ec0d 100755
--- a/cpp/test/Glacier2/sessionControl/run.py
+++ b/cpp/test/Glacier2/sessionControl/run.py
@@ -10,44 +10,36 @@
import os, sys, time
-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", "sessionControl")
-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' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \
- r' --Ice.Admin.Endpoints="tcp -p 12348 -t 10000"' + \
- r' --Ice.Admin.InstanceName=Glacier2' + \
- r' --Glacier2.Server.Endpoints="default -p 12349 -t 10000"' + \
- r' --Glacier2.SessionManager="SessionManager:tcp -p 12010 -t 10000"' \
- r' --Glacier2.PermissionsVerifier="Glacier2/NullPermissionsVerifier" 2>&1'
+args = ' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \
+ ' --Ice.Admin.Endpoints="tcp -p 12348 -t 10000"' + \
+ ' --Ice.Admin.InstanceName=Glacier2' + \
+ ' --Glacier2.Server.Endpoints="default -p 12349 -t 10000"' + \
+ ' --Glacier2.SessionManager="SessionManager:tcp -p 12010 -t 10000"' \
+ ' --Glacier2.PermissionsVerifier="Glacier2/NullPermissionsVerifier"'
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"
-client = os.path.join(testdir, "client")
+client = os.path.join(os.getcwd(), "client")
#
# The test may sporadically fail without this slight pause.
@@ -55,16 +47,9 @@ client = os.path.join(testdir, "client")
time.sleep(1)
print "starting client...",
-clientPipe = TestUtil.startClient(client, " 2>&1")
-#TestUtil.getServerPid(clientPipe)
+clientProc = TestUtil.startClient(client)
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()