summaryrefslogtreecommitdiff
path: root/cpp/config/IcePackAdmin.py
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-11-08 18:14:53 +0000
committerMarc Laukien <marc@zeroc.com>2002-11-08 18:14:53 +0000
commit4b2433c82b06bbda1b604e0baaa559e83bac5ce9 (patch)
tree6211a8e432034fd0b05532ca7e7ceaabe1c763f2 /cpp/config/IcePackAdmin.py
parentRemoved redundant iostream include that was left behind for tracing. (diff)
downloadice-4b2433c82b06bbda1b604e0baaa559e83bac5ce9.tar.bz2
ice-4b2433c82b06bbda1b604e0baaa559e83bac5ce9.tar.xz
ice-4b2433c82b06bbda1b604e0baaa559e83bac5ce9.zip
fixes
Diffstat (limited to 'cpp/config/IcePackAdmin.py')
-rw-r--r--cpp/config/IcePackAdmin.py69
1 files changed, 28 insertions, 41 deletions
diff --git a/cpp/config/IcePackAdmin.py b/cpp/config/IcePackAdmin.py
index 8ead5badf69..37364da0d21 100644
--- a/cpp/config/IcePackAdmin.py
+++ b/cpp/config/IcePackAdmin.py
@@ -15,14 +15,19 @@
import sys, os, TestUtil
+for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
+ toplevel = os.path.normpath(toplevel)
+ if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")):
+ break
+else:
+ raise "can't find toplevel directory!"
+
icePackPort = "0";
-def startIcePackRegistry(toplevel, port, testdir):
+def startIcePackRegistry(port, testdir):
global icePackPort
- options = TestUtil.clientServerOptions.replace("TOPLEVELDIR", toplevel)
-
icePackPort = port
icePack = os.path.join(toplevel, "bin", "icepackregistry")
@@ -32,7 +37,7 @@ def startIcePackRegistry(toplevel, port, testdir):
os.mkdir(dataDir)
print "starting icepack registry...",
- command = icePack + options + ' --nowarn ' + \
+ command = icePack + TestUtil.clientServerOptions + ' --nowarn ' + \
r' --IcePack.Registry.Locator.Endpoints="default -p ' + icePackPort + ' -t 5000" ' + \
r' --IcePack.Registry.LocatorRegistry.Endpoints=default' + \
r' --IcePack.Registry.Internal.Endpoints=default' + \
@@ -51,20 +56,18 @@ def startIcePackRegistry(toplevel, port, testdir):
return icePackPipe
-def startIcePackNode(toplevel, testdir):
+def startIcePackNode(testdir):
- options = TestUtil.clientServerOptions.replace("TOPLEVELDIR", toplevel)
-
icePack = os.path.join(toplevel, "bin", "icepacknode")
dataDir = os.path.join(testdir, "db", "node")
if not os.path.exists(dataDir):
os.mkdir(dataDir)
- overrideOptions = '"' + options.replace("--", "") + '"'
+ overrideOptions = '"' + TestUtil.clientServerOptions.replace("--", "") + '"'
print "starting icepack node...",
- command = icePack + options + ' --nowarn ' + \
+ command = icePack + TestUtil.clientServerOptions + ' --nowarn ' + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' --IcePack.Node.Endpoints=default' + \
r' --IcePack.Node.Data=' + dataDir + \
@@ -81,15 +84,13 @@ def startIcePackNode(toplevel, testdir):
print "ok"
return icePackPipe
-def shutdownIcePackRegistry(toplevel, icePackPipe):
+def shutdownIcePackRegistry(icePackPipe):
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
print "shutting down icepack registry...",
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "shutdown" '
@@ -102,15 +103,13 @@ def shutdownIcePackRegistry(toplevel, icePackPipe):
TestUtil.killServers()
sys.exit(1)
-def shutdownIcePackNode(toplevel, icePackPipe):
+def shutdownIcePackNode(icePackPipe):
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
print "shutting down icepack node...",
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "node shutdown localnode" '
@@ -123,14 +122,12 @@ def shutdownIcePackNode(toplevel, icePackPipe):
TestUtil.killServers()
sys.exit(1)
-def addApplication(toplevel, descriptor, targets):
+def addApplication(descriptor, targets):
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "application add \"' + descriptor + '\\" ' + targets + ' \"'
@@ -140,14 +137,12 @@ def addApplication(toplevel, descriptor, targets):
TestUtil.killServers()
sys.exit(1)
-def removeApplication(toplevel, descriptor):
+def removeApplication(descriptor):
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "application remove \"' + descriptor + '\\" \"'
@@ -157,14 +152,12 @@ def removeApplication(toplevel, descriptor):
TestUtil.killServers()
sys.exit(1)
-def addServer(toplevel, name, serverDescriptor, server, libpath, targets):
+def addServer(name, serverDescriptor, server, libpath, targets):
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "server add localnode \"' + name + '\\" \\"' + serverDescriptor + '\\" ' + \
r' \"' + server + '\\" \\"' + libpath + '\\" ' + targets + '\"'
@@ -175,14 +168,12 @@ def addServer(toplevel, name, serverDescriptor, server, libpath, targets):
TestUtil.killServers()
sys.exit(1)
-def removeServer(toplevel, name):
+def removeServer(name):
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "server remove \"' + name + '\\" \"'
@@ -192,13 +183,11 @@ def removeServer(toplevel, name):
TestUtil.killServers()
sys.exit(1)
-def startServer(toplevel, name):
+def startServer(name):
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "server start \"' + name + '\\""'
@@ -208,13 +197,11 @@ def startServer(toplevel, name):
TestUtil.killServers()
sys.exit(1)
-def listAdapters(toplevel):
+def listAdapters():
global icePackPort
icePackAdmin = os.path.join(toplevel, "bin", "icepackadmin")
- options = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel)
-
- command = icePackAdmin + options + \
+ command = icePackAdmin + TestUtil.clientOptions + \
r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \
r' -e "adapter list"'