summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-06-14 19:35:57 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-06-14 19:35:57 +0000
commit0d98f55950b1fc62c12f57416677d410d7b5599a (patch)
treeb74e207f6af4250af42caa8bb864be196e77dd40 /cpp
parentminor fix (diff)
downloadice-0d98f55950b1fc62c12f57416677d410d7b5599a.tar.bz2
ice-0d98f55950b1fc62c12f57416677d410d7b5599a.tar.xz
ice-0d98f55950b1fc62c12f57416677d410d7b5599a.zip
More simplifications...
Diffstat (limited to 'cpp')
-rw-r--r--cpp/config/IceGridAdmin.py81
-rwxr-xr-xcpp/test/IceGrid/simple/run.py30
2 files changed, 42 insertions, 69 deletions
diff --git a/cpp/config/IceGridAdmin.py b/cpp/config/IceGridAdmin.py
index 6211770a4e0..181e86f5541 100644
--- a/cpp/config/IceGridAdmin.py
+++ b/cpp/config/IceGridAdmin.py
@@ -48,7 +48,7 @@ registryOptions = r' --Ice.Warn.Connections=0' + \
r' --IceGrid.Registry.Trace.Locator=0' + \
r' --Ice.ThreadPool.Server.Size=0';
-def startIceGridRegistry(testdir, dynamicRegistration):
+def startIceGridRegistry(testdir, dynamicRegistration = False):
global iceGridPort
@@ -106,42 +106,6 @@ def startIceGridNode(testdir):
return iceGridPipe
-def shutdownIceGridRegistry():
-
- global iceGridPort
- iceGridAdmin = os.path.join(toplevel, "bin", "icegridadmin")
-
- print "shutting down icegrid registry...",
- command = iceGridAdmin + TestUtil.clientOptions + \
- r' "--Ice.Default.Locator=IceGrid/Locator:default -p ' + iceGridPort + '" ' + \
- r' -e "shutdown" ' + " 2>&1"
-
- iceGridAdminPipe = os.popen(command)
- TestUtil.printOutputFromPipe(iceGridAdminPipe)
- iceGridAdminStatus = iceGridAdminPipe.close()
- if iceGridAdminStatus:
- TestUtil.killServers()
- sys.exit(1)
- print "ok"
-
-def shutdownIceGridNode():
-
- global iceGridPort
- iceGridAdmin = os.path.join(toplevel, "bin", "icegridadmin")
-
- print "shutting down icegrid node...",
- command = iceGridAdmin + TestUtil.clientOptions + \
- r' "--Ice.Default.Locator=IceGrid/Locator:default -p ' + iceGridPort + '" ' + \
- r' -e "node shutdown localnode" ' + " 2>&1"
-
- iceGridAdminPipe = os.popen(command)
- TestUtil.printOutputFromPipe(iceGridAdminPipe)
- iceGridAdminStatus = iceGridAdminPipe.close()
- if iceGridAdminStatus:
- TestUtil.killServers()
- sys.exit(1)
- print "ok"
-
def iceGridAdmin(cmd, ignoreFailure = False):
global iceGridPort
@@ -179,7 +143,7 @@ def iceGridTest(name, application, additionalOptions = "", applicationOptions =
clientOptions = " --Ice.Default.Locator=\"IceGrid/Locator:default -p " + iceGridPort + "\" " + additionalOptions
- iceGridRegistryPipe = startIceGridRegistry(testdir, 0)
+ iceGridRegistryPipe = startIceGridRegistry(testdir)
iceGridNodePipe = startIceGridNode(testdir)
if application != "":
@@ -209,14 +173,51 @@ def iceGridTest(name, application, additionalOptions = "", applicationOptions =
iceGridAdmin("application remove Test")
print "ok"
- shutdownIceGridNode()
- shutdownIceGridRegistry()
+ iceGridAdmin("node shutdown localnode")
+ iceGridAdmin("shutdown")
TestUtil.joinServers()
if TestUtil.serverStatus():
sys.exit(1)
+def iceGridClientServerTest(name, additionalClientOptions, additionalServerOptions):
+
+ testdir = os.path.join(toplevel, "test", name)
+ server = os.path.join(testdir, "server")
+ client = os.path.join(testdir, "client")
+
+ clientOptions = "--Ice.Default.Locator=\"IceGrid/Locator:default -p " + iceGridPort + "\" " + \
+ additionalClientOptions
+
+ serverOptions = "--Ice.Default.Locator=\"IceGrid/Locator:default -p " + iceGridPort + "\" " + \
+ additionalServerOptions
+
+ iceGridRegistryPipe = startIceGridRegistry(testdir, True)
+
+ print "starting sever...",
+ serverPipe = os.popen(server + TestUtil.clientServerOptions + " " + serverOptions + " 2>&1")
+ TestUtil.getAdapterReady(serverPipe)
+ print "ok"
+
+ print "starting client...",
+ clientPipe = os.popen(client + TestUtil.clientOptions + " " + clientOptions + " 2>&1")
+ print "ok"
+
+ TestUtil.printOutputFromPipe(clientPipe)
+
+ clientStatus = TestUtil.closePipe(clientPipe)
+ if clientStatus:
+ TestUtil.killServers()
+ sys.exit(1)
+
+ iceGridAdmin("shutdown")
+
+ TestUtil.joinServers()
+
+ if TestUtil.serverStatus():
+ sys.exit(1)
+
def cleanDbDir(path):
files = os.listdir(path)
diff --git a/cpp/test/IceGrid/simple/run.py b/cpp/test/IceGrid/simple/run.py
index 2137048f0c0..41ba6654786 100755
--- a/cpp/test/IceGrid/simple/run.py
+++ b/cpp/test/IceGrid/simple/run.py
@@ -22,39 +22,11 @@ import TestUtil
import IceGridAdmin
name = os.path.join("IceGrid", "simple")
-testdir = os.path.join(toplevel, "test", name)
-server = os.path.join(testdir, "server")
-client = os.path.join(testdir, "client")
-
-additionalOptions = " --Ice.Default.Locator=\"IceGrid/Locator:default -p 12010\""
-additionalServerOptions=" --TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter " + additionalOptions
-
-iceGridRegistryPipe = IceGridAdmin.startIceGridRegistry(testdir, 1)
#
# Test client/server without on demand activation.
#
-print "starting sever...",
-serverPipe = os.popen(server + TestUtil.serverOptions + additionalServerOptions + " 2>&1")
-TestUtil.getServerPid(serverPipe)
-TestUtil.getAdapterReady(serverPipe)
-print "ok"
-
-print "starting client...",
-clientPipe = os.popen(client + TestUtil.clientOptions + additionalOptions + " 2>&1")
-print "ok"
-
-TestUtil.printOutputFromPipe(clientPipe)
-
-clientStatus = TestUtil.closePipe(clientPipe)
-if clientStatus:
- killServers()
-
-IceGridAdmin.shutdownIceGridRegistry()
-TestUtil.joinServers()
-
-if clientStatus or TestUtil.serverStatus():
- sys.exit(1)
+IceGridAdmin.iceGridClientServerTest(name, "", "--TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter")
#
# Test client/server with on demand activation.