summaryrefslogtreecommitdiff
path: root/cpp/test/Glacier2/router/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test/Glacier2/router/run.py')
-rwxr-xr-xcpp/test/Glacier2/router/run.py76
1 files changed, 49 insertions, 27 deletions
diff --git a/cpp/test/Glacier2/router/run.py b/cpp/test/Glacier2/router/run.py
index 0edaed9d6f6..e674550143c 100755
--- a/cpp/test/Glacier2/router/run.py
+++ b/cpp/test/Glacier2/router/run.py
@@ -22,35 +22,57 @@ import TestUtil
router = os.path.join(TestUtil.getBinDir(__file__), "glacier2router")
-args = r' --Ice.Warn.Dispatch=0' + \
- r' --Ice.Warn.Connections=0' + \
- r' --Glacier2.Filter.Category.Accept="c1 c2"' + \
- r' --Glacier2.Filter.Category.AcceptUser="2"' + \
- r' --Glacier2.SessionTimeout="30"' + \
- r' --Glacier2.Client.Endpoints="default -p 12347 -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 12348 -t 10000"' + \
- r' --Ice.Admin.InstanceName="Glacier2"' + \
- r' --Glacier2.CryptPasswords="' + TestUtil.getMappingDir(__file__) + r'/test/Glacier2/router/passwords"'
-
-print "starting router...",
-if TestUtil.debug:
- print "(" + command + ")",
-starterPipe = TestUtil.startServer(router, args + " 2>&1")
-TestUtil.getServerPid(starterPipe)
-#
-# For this test we don't want to add the router to the server threads
-# since we want the the router to run over two calls to
-# mixedClientServerTest
-#
-TestUtil.getAdapterReady(starterPipe, False)
-print "ok"
+def startRouter(buffered):
+
+ args = r' --Ice.Warn.Dispatch=0' + \
+ r' --Ice.Warn.Connections=0' + \
+ r' --Glacier2.Filter.Category.Accept="c1 c2"' + \
+ r' --Glacier2.Filter.Category.AcceptUser="2"' + \
+ r' --Glacier2.SessionTimeout="30"' + \
+ r' --Glacier2.Client.Endpoints="default -p 12347 -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 12348 -t 10000"' + \
+ r' --Ice.Admin.InstanceName="Glacier2"' + \
+ r' --Glacier2.CryptPasswords="' + TestUtil.getMappingDir(__file__) + r'/test/Glacier2/router/passwords"'
+
+ if buffered:
+ args += ' --Glacier2.Client.Buffered=1 --Glacier2.Server.Buffered=1'
+ print "starting router in buffered mode...",
+ else:
+ args += ' --Glacier2.Client.Buffered=0 --Glacier2.Server.Buffered=0'
+ print "starting router in unbuffered mode...",
+
+ starterPipe = TestUtil.startServer(router, args + " 2>&1")
+ TestUtil.getServerPid(starterPipe)
+
+ #
+ # For this test we don't want to add the router to the server threads
+ # since we want the the router to run over two calls to
+ # mixedClientServerTest
+ #
+ TestUtil.getAdapterReady(starterPipe, False)
+ print "ok"
-starterThread = TestUtil.ReaderThread(starterPipe);
-starterThread.start()
+ routerThread = TestUtil.ReaderThread(starterPipe);
+ routerThread.start()
+
+ return routerThread
name = os.path.join("Glacier2", "router")
+#
+# We first run the test with unbuffered mode.
+#
+routerThread = startRouter(False)
+TestUtil.mixedClientServerTestWithOptions(name, "", " --shutdown")
+routerThread.join()
+if routerThread.getStatus():
+ sys.exit(1)
+
+#
+# Then we run the test in buffered mode.
+#
+routerThread = startRouter(True)
TestUtil.mixedClientServerTest(name)
#
@@ -60,8 +82,8 @@ TestUtil.mixedClientServerTest(name)
#
TestUtil.mixedClientServerTestWithOptions(name, "", " --shutdown")
-starterThread.join()
-if starterThread.getStatus():
+routerThread.join()
+if routerThread.getStatus():
sys.exit(1)
sys.exit(0)