summaryrefslogtreecommitdiff
path: root/java/config/IceGridAdmin.py
diff options
context:
space:
mode:
Diffstat (limited to 'java/config/IceGridAdmin.py')
-rw-r--r--java/config/IceGridAdmin.py53
1 files changed, 38 insertions, 15 deletions
diff --git a/java/config/IceGridAdmin.py b/java/config/IceGridAdmin.py
index 90ad3122601..13b17fabb85 100644
--- a/java/config/IceGridAdmin.py
+++ b/java/config/IceGridAdmin.py
@@ -11,6 +11,9 @@
import sys, os, TestUtil
from threading import Thread
+debug = 0
+#debug = 1
+
for toplevel in [".", "..", "../..", "../../..", "../../../.."]:
toplevel = os.path.normpath(toplevel)
if os.path.exists(os.path.join(toplevel, "config", "TestUtil.py")):
@@ -30,12 +33,12 @@ nodeOptions = r' --Ice.Warn.Connections=0' + \
r' --IceGrid.Node.Endpoints=default' + \
r' --IceGrid.Node.WaitTime=30' + \
r' --Ice.ProgramName=icegridnode' + \
+ r' --IceGrid.Node.Trace.Replica=0' + \
r' --IceGrid.Node.Trace.Activator=0' + \
r' --IceGrid.Node.Trace.Adapter=0' + \
r' --IceGrid.Node.Trace.Server=0' + \
r' --IceGrid.Node.PrintServersReady=node' + \
r' --Ice.NullHandleAbort' + \
- r' --Ice.PrintProcessId' \
r' --Ice.ThreadPool.Server.Size=0';
registryOptions = r' --Ice.Warn.Connections=0' + \
@@ -43,17 +46,13 @@ registryOptions = r' --Ice.Warn.Connections=0' + \
r' --IceGrid.Registry.AdminPermissionsVerifier=IceGrid/NullPermissionsVerifier' + \
r' --IceGrid.Registry.Server.Endpoints=default' + \
r' --IceGrid.Registry.Internal.Endpoints=default' + \
- r' --IceGrid.Registry.Admin.Endpoints=default' + \
- r' --IceGrid.Registry.Server.Endpoints=default' + \
- r' --IceGrid.Registry.Internal.Endpoints=default' + \
- r' --IceGrid.Registry.Admin.Endpoints=default' + \
+ r' --IceGrid.Registry.SessionManager.Endpoints=default' + \
r' --IceGrid.Registry.Trace.Session=0' + \
r' --IceGrid.Registry.Trace.Application=0' + \
r' --IceGrid.Registry.Trace.Adapter=0' + \
r' --IceGrid.Registry.Trace.Object=0' + \
r' --IceGrid.Registry.Trace.Server=0' + \
r' --IceGrid.Registry.Trace.Locator=0' + \
- r' --Ice.PrintProcessId' \
r' --Ice.ThreadPool.Server.Size=0';
def startIceGridRegistry(testdir, dynamicRegistration = False):
@@ -77,7 +76,10 @@ def startIceGridRegistry(testdir, dynamicRegistration = False):
if dynamicRegistration:
command += ' --IceGrid.Registry.DynamicRegistration'
- (stdin, iceGridPipe) = os.popen4(command)
+ if TestUtil.debug:
+ print "(" + command + ")"
+
+ iceGridPipe = os.popen(command + " 2>&1")
TestUtil.getServerPid(iceGridPipe)
TestUtil.getAdapterReady(iceGridPipe, True, 4)
print "ok"
@@ -104,7 +106,10 @@ def startIceGridNode(testdir):
r' --IceGrid.Node.Name=localnode' + \
r' --IceGrid.Node.PropertiesOverride=' + overrideOptions
- (stdin, iceGridPipe) = os.popen4(command)
+ if TestUtil.debug:
+ print "(" + command +")",
+
+ iceGridPipe = os.popen(command + " 2>&1")
TestUtil.getServerPid(iceGridPipe)
TestUtil.getAdapterReady(iceGridPipe, False)
TestUtil.waitServiceReady(iceGridPipe, 'node')
@@ -118,22 +123,31 @@ def iceGridAdmin(cmd, ignoreFailure = False):
global iceGridPort
iceGridAdmin = os.path.join(ice_home, "bin", "icegridadmin")
+ user = r"admin1"
+ if cmd == "shutdown":
+ user = r"shutdown"
command = iceGridAdmin + TestUtil.cppClientOptions + \
r' --Ice.Default.Locator="IceGrid/Locator:default -p ' + iceGridPort + '" ' + \
- r' -e "' + cmd + '" 2>&1'
+ r" --IceGridAdmin.Username=" + user + " --IceGridAdmin.Password=test1 " + \
+ r' -e "' + cmd + '"'
+
+ if TestUtil.debug:
+ print "(" + command + ")",
- iceGridAdminPipe = os.popen(command)
+ iceGridAdminPipe = os.popen(command + " 2>&1")
output = iceGridAdminPipe.readlines()
- iceGridAdminStatus = iceGridAdminPipe.close()
+ iceGridAdminStatus = TestUtil.closePipe(iceGridAdminPipe)
if not ignoreFailure and iceGridAdminStatus:
print "icegridadmin command failed: " + cmd
+ for line in output:
+ print line
TestUtil.killServers()
sys.exit(1)
return output
-
+
def killNodeServers():
global iceGridPort
@@ -160,7 +174,10 @@ def iceGridTest(name, application, additionalOptions = "", applicationOptions =
print "ok"
print "starting client...",
- clientPipe = os.popen(client + TestUtil.clientOptions + " " + clientOptions + " 2>&1")
+ command = client + TestUtil.clientOptions + " " + clientOptions
+ if TestUtil.debug:
+ print "(" + command +")",
+ clientPipe = os.popen(command + " 2>&1")
print "ok"
TestUtil.printOutputFromPipe(clientPipe)
@@ -203,12 +220,18 @@ def iceGridClientServerTest(name, additionalClientOptions, additionalServerOptio
iceGridRegistryPipe = startIceGridRegistry(testdir, True)
print "starting server...",
- serverPipe = os.popen(server + TestUtil.clientServerOptions + " " + serverOptions + " 2>&1")
+ command = server + TestUtil.clientServerOptions + " " + serverOptions
+ if TestUtil.debug:
+ print "(" + command +")",
+ serverPipe = os.popen(command + " 2>&1")
TestUtil.getAdapterReady(serverPipe)
print "ok"
print "starting client...",
- clientPipe = os.popen(client + TestUtil.clientOptions + " " + clientOptions + " 2>&1")
+ command = client + TestUtil.clientOptions + " " + clientOptions
+ if TestUtil.debug:
+ print "(" + command +")",
+ clientPipe = os.popen(command + " 2>&1")
print "ok"
TestUtil.printOutputFromPipe(clientPipe)