diff options
38 files changed, 266 insertions, 302 deletions
diff --git a/cpp/src/Ice/TcpAcceptor.cpp b/cpp/src/Ice/TcpAcceptor.cpp index 44531f0c290..88aad830087 100644 --- a/cpp/src/Ice/TcpAcceptor.cpp +++ b/cpp/src/Ice/TcpAcceptor.cpp @@ -118,7 +118,7 @@ IceInternal::TcpAcceptor::TcpAcceptor(const InstancePtr& instance, const string& if(_traceLevels->network >= 2) { Trace out(_logger, _traceLevels->networkCat); - out << "attempting to bind to tcp socket\n" << toString(); + out << "attempting to bind to tcp socket " << toString(); } doBind(_fd, _addr); } diff --git a/cpp/test/Freeze/dbmap/run.py b/cpp/test/Freeze/dbmap/run.py index cadf11108e0..159a7d53fe6 100755 --- a/cpp/test/Freeze/dbmap/run.py +++ b/cpp/test/Freeze/dbmap/run.py @@ -26,7 +26,6 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Freeze", "dbmap") - testdir = os.path.join(toplevel, "test", name) dbdir = os.path.join(testdir, "db") diff --git a/cpp/test/Freeze/evictor/run.py b/cpp/test/Freeze/evictor/run.py index cc0f3522482..dbf53a2336e 100755 --- a/cpp/test/Freeze/evictor/run.py +++ b/cpp/test/Freeze/evictor/run.py @@ -26,7 +26,6 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Freeze", "evictor") - testdir = os.path.join(toplevel, "test", name) dbdir = os.path.join(testdir, "db") diff --git a/cpp/test/Glacier/starter/run.py b/cpp/test/Glacier/starter/run.py index 972037e45ec..bb806396c59 100755 --- a/cpp/test/Glacier/starter/run.py +++ b/cpp/test/Glacier/starter/run.py @@ -44,6 +44,7 @@ TestUtil.getAdapterReady(starterPipe) print "ok" name = os.path.join("Glacier", "starter") + TestUtil.mixedClientServerTest(name) # We run the test again, to check whether the glacier router starter diff --git a/cpp/test/Ice/faultTolerance/run.py b/cpp/test/Ice/faultTolerance/run.py index e06b110f939..07e4792ff76 100755 --- a/cpp/test/Ice/faultTolerance/run.py +++ b/cpp/test/Ice/faultTolerance/run.py @@ -25,7 +25,9 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel,"test", "Ice", "faultTolerance") +name = os.path.join("Ice", "faultTolerance") +testdir = os.path.join(toplevel, "test", name) + server = os.path.join(testdir, "server") client = os.path.join(testdir, "client") diff --git a/cpp/test/Ice/locationForward/run.py b/cpp/test/Ice/locationForward/run.py index 2fba1589028..722cc7dbc5e 100755 --- a/cpp/test/Ice/locationForward/run.py +++ b/cpp/test/Ice/locationForward/run.py @@ -25,7 +25,9 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel, "test", "Ice", "locationForward") +name = os.path.join("Ice", "locationForward") +testdir = os.path.join(toplevel, "test", name) + server = os.path.join(testdir, "server") client = os.path.join(testdir, "client") diff --git a/cpp/test/IcePack/deployer/run.py b/cpp/test/IcePack/deployer/run.py index 5c510903f3a..124b7e95d13 100755 --- a/cpp/test/IcePack/deployer/run.py +++ b/cpp/test/IcePack/deployer/run.py @@ -26,7 +26,8 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil import IcePackAdmin -testdir = os.path.join(toplevel, "test", "IcePack", "deployer") +name = os.path.join("IcePack", "deployer") +testdir = os.path.join(toplevel, "test", name) if not TestUtil.isWin32(): os.environ["LD_LIBRARY_PATH"] = testdir + ":" + os.environ["LD_LIBRARY_PATH"] diff --git a/cpp/test/IcePack/simple/run.py b/cpp/test/IcePack/simple/run.py index 533d38b7302..cfabc708cda 100755 --- a/cpp/test/IcePack/simple/run.py +++ b/cpp/test/IcePack/simple/run.py @@ -27,7 +27,7 @@ import TestUtil import IcePackAdmin name = os.path.join("IcePack", "simple") -testdir = os.path.join(toplevel, "test", "IcePack", "simple") +testdir = os.path.join(toplevel, "test", name) # # Add locator options for the client and server. Since the server @@ -38,7 +38,7 @@ additionalOptions = " --Ice.Default.Locator=\"IcePack/Locator:default -p 12346\" IcePackAdmin.cleanDbDir(os.path.join(testdir, "db")) # -# Start IcePack registry +# Start IcePack registry. # icePackRegistryPipe = IcePackAdmin.startIcePackRegistry("12346", testdir) @@ -56,7 +56,7 @@ IcePackAdmin.shutdownIcePackRegistry(icePackRegistryPipe) IcePackAdmin.cleanDbDir(os.path.join(testdir, "db")) # -# Start the registry and a node. +# Start IcePack registry and a node. # icePackRegistryPipe = IcePackAdmin.startIcePackRegistry("12346", testdir) icePackNodePipe = IcePackAdmin.startIcePackNode(testdir) @@ -71,10 +71,8 @@ print "registering server with icepack...", IcePackAdmin.addServer("server", os.path.join(testdir, "simple_server.xml"), server, "", ""); print "ok" -updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) + additionalOptions - print "starting client...", -clientPipe = os.popen(client + updatedClientOptions) +clientPipe = os.popen(client + TestUtil.clientOptions + additionalOptions) print "ok" for output in clientPipe.xreadlines(): diff --git a/cpp/test/IceSSL/certificateAndKeyParsing/run.py b/cpp/test/IceSSL/certificateAndKeyParsing/run.py index 20e03a10b88..1680f62256f 100755 --- a/cpp/test/IceSSL/certificateAndKeyParsing/run.py +++ b/cpp/test/IceSSL/certificateAndKeyParsing/run.py @@ -35,7 +35,9 @@ testOptions = " --IceSSL.Test.Client.CertPath=" + os.path.join(toplevel, "test", " --IceSSL.Server.CertPath=" + os.path.join(toplevel, "test", "IceSSL", "certs") + \ " --IceSSL.Server.Config= " -testdir = os.path.join(toplevel,"test", "IceSSL", "certificateAndKeyParsing") +name = os.path.join("IceSSL", "certificateAndKeyParsing") +testdir = os.path.join(toplevel, "test", name) + client = os.path.join(testdir, "certificateAndKeyParsing") localClientOptions = TestUtil.clientServerProtocol + TestUtil.defaultHost diff --git a/cpp/test/IceSSL/certificateVerification/run.py b/cpp/test/IceSSL/certificateVerification/run.py index 9038b280d80..4820bc86503 100755 --- a/cpp/test/IceSSL/certificateVerification/run.py +++ b/cpp/test/IceSSL/certificateVerification/run.py @@ -44,6 +44,7 @@ TestUtil.clientServerOptions += " --IceSSL.Test.Client.CertPath=" + \ os.path.join(toplevel, "test", "IceSSL", "certs") name = os.path.join("IceSSL", "certificateVerification") +testdir = os.path.join(toplevel, "test", name) print "testing default certificate verifier." TestUtil.clientServerTest(name) diff --git a/cpp/test/IceSSL/certificateVerifier/run.py b/cpp/test/IceSSL/certificateVerifier/run.py index 84f28dab0ff..82ef9d81a1d 100755 --- a/cpp/test/IceSSL/certificateVerifier/run.py +++ b/cpp/test/IceSSL/certificateVerifier/run.py @@ -29,7 +29,9 @@ if TestUtil.protocol != "ssl": print "This test may only be run with SSL enabled." sys.exit(0) -testdir = os.path.join(toplevel,"test", "IceSSL", "certificateVerifier") +name = os.path.join("IceSSL", "certificateVerifier") +testdir = os.path.join(toplevel, "test", name) + client = os.path.join(testdir, "certificateVerifier") localClientOptions = TestUtil.clientServerProtocol + TestUtil.defaultHost diff --git a/cpp/test/IceSSL/configuration/run.py b/cpp/test/IceSSL/configuration/run.py index fcfa47e4f51..54e3e2362cc 100755 --- a/cpp/test/IceSSL/configuration/run.py +++ b/cpp/test/IceSSL/configuration/run.py @@ -29,7 +29,9 @@ if TestUtil.protocol != "ssl": print "This test may only be run with SSL enabled." sys.exit(0) -testdir = os.path.join(toplevel,"test", "IceSSL", "configuration") +name = os.path.join("IceSSL", "configuration") +testdir = os.path.join(toplevel, "test", name) + client = os.path.join(testdir, "configuration") localClientOptions = TestUtil.clientServerProtocol + TestUtil.defaultHost diff --git a/cpp/test/IceSSL/loadPEM/run.py b/cpp/test/IceSSL/loadPEM/run.py index 1b289b4ee48..a391851d784 100755 --- a/cpp/test/IceSSL/loadPEM/run.py +++ b/cpp/test/IceSSL/loadPEM/run.py @@ -34,7 +34,9 @@ testOptions = " --IceSSL.Client.CertPath=" + os.path.join(toplevel, "test", "Ice " --IceSSL.Server.CertPath=" + os.path.join(toplevel, "test", "IceSSL", "certs") + \ " --IceSSL.Server.Config= " -testdir = os.path.join(toplevel,"test", "IceSSL", "loadPEM") +name = os.path.join("IceSSL", "loadPEM") +testdir = os.path.join(toplevel, "test", name) + client = os.path.join(testdir, "loadPEM") localClientOptions = TestUtil.clientServerProtocol + TestUtil.defaultHost diff --git a/cpp/test/IceStorm/federation2/run.py b/cpp/test/IceStorm/federation2/run.py index 019696da00b..a736b13a45a 100755 --- a/cpp/test/IceStorm/federation2/run.py +++ b/cpp/test/IceStorm/federation2/run.py @@ -25,7 +25,9 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel, "test", "IceStorm", "federation2") +name = os.path.join("IceStorm", "federation2") +testdir = os.path.join(toplevel, "test", name) + exedir = os.path.join(toplevel, "test", "IceStorm", "federation") iceBox = os.path.join(toplevel, "bin", "icebox") diff --git a/cpp/test/IceXML/encoding/run.py b/cpp/test/IceXML/encoding/run.py index bedb99983ce..51a630de65c 100755 --- a/cpp/test/IceXML/encoding/run.py +++ b/cpp/test/IceXML/encoding/run.py @@ -26,7 +26,6 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("IceXML", "encoding") - testdir = os.path.join(toplevel, "test", name) client = os.path.join(testdir, "client") diff --git a/cpp/test/XMLTransform/transform/run.py b/cpp/test/XMLTransform/transform/run.py index 1ef1cb30895..1aadcf70adc 100755 --- a/cpp/test/XMLTransform/transform/run.py +++ b/cpp/test/XMLTransform/transform/run.py @@ -26,7 +26,6 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("XMLTransform", "transform") - testdir = os.path.join(toplevel, "test", name) dbdir = os.path.join(testdir, "db") diff --git a/cpp/test/Yellow/basicYellow/run.py b/cpp/test/Yellow/basicYellow/run.py index 5ab900e2eb2..0357852c4b9 100755 --- a/cpp/test/Yellow/basicYellow/run.py +++ b/cpp/test/Yellow/basicYellow/run.py @@ -48,6 +48,7 @@ TestUtil.waitServiceReady(IceBoxPipe, "Yellow") print "ok" client = os.path.join(testdir, "client") + # # Start the client. # diff --git a/java/config/IcePackAdmin.py b/java/config/IcePackAdmin.py index 3b8d5d9764b..913dc67827e 100644 --- a/java/config/IcePackAdmin.py +++ b/java/config/IcePackAdmin.py @@ -15,32 +15,35 @@ import sys, os, TestUtil +if not os.environ.has_key('ICE_HOME'): + print "ICE_HOME is not defined." + sys.exit(0) + +ice_home = os.environ['ICE_HOME'] + 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") + icePack = os.path.join(ice_home, "bin", "icepackregistry") dataDir = os.path.join(testdir, "db", "registry") if not os.path.exists(dataDir): os.mkdir(dataDir) print "starting icepack registry...", - command = icePack + options + ' --nowarn ' + \ - r' --IcePack.Registry.Locator.Endpoints="default -p ' + icePackPort + ' -t 5000" ' + \ - r' --IcePack.Registry.LocatorRegistry.Endpoints=default' + \ - r' --IcePack.Registry.Internal.Endpoints=default' + \ - r' --IcePack.Registry.Admin.Endpoints=default' + \ - r' --IcePack.Registry.Data=' + dataDir + \ - r' --IcePack.Registry.DynamicRegistration' + \ - r' --IcePack.Registry.Trace.AdapterRegistry=0' + \ - r' --Ice.ProgramName=icepackregistry' + 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' + \ + r' --IcePack.Registry.Admin.Endpoints=default' + \ + r' --IcePack.Registry.Data=' + dataDir + \ + r' --IcePack.Registry.DynamicRegistration' + \ + r' --Ice.ProgramName=icepackregistry' icePackPipe = os.popen(command) TestUtil.getAdapterReady(icePackPipe) @@ -51,20 +54,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") + icePack = os.path.join(ice_home, "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 + \ @@ -80,15 +81,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) + icePackAdmin = os.path.join(ice_home, "bin", "icepackadmin") print "shutting down icepack registry...", - command = icePackAdmin + options + \ + command = icePackAdmin + TestUtil.clientOptions + \ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \ r' -e "shutdown" ' @@ -101,15 +100,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) + icePackAdmin = os.path.join(ice_home, "bin", "icepackadmin") 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" ' @@ -122,14 +119,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") + icePackAdmin = os.path.join(ice_home, "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 + ' \"' @@ -139,14 +134,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") + icePackAdmin = os.path.join(ice_home, "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 + '\\" \"' @@ -156,14 +149,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") + icePackAdmin = os.path.join(ice_home, "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 + '\"' @@ -174,14 +165,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") + icePackAdmin = os.path.join(ice_home, "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 + '\\" \"' @@ -191,13 +180,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) + icePackAdmin = os.path.join(ice_home, "bin", "icepackadmin") - command = icePackAdmin + options + \ + command = icePackAdmin + TestUtil.clientOptions + \ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \ r' -e "server start \"' + name + '\\""' @@ -207,13 +194,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) + icePackAdmin = os.path.join(ice_home, "bin", "icepackadmin") - command = icePackAdmin + options + \ + command = icePackAdmin + TestUtil.clientOptions + \ r' "--Ice.Default.Locator=IcePack/Locator:default -p ' + icePackPort + '" ' + \ r' -e "adapter list"' diff --git a/java/config/TestUtil.py b/java/config/TestUtil.py index df8d346c073..0067fd01fd0 100644 --- a/java/config/TestUtil.py +++ b/java/config/TestUtil.py @@ -13,16 +13,6 @@ # # ********************************************************************** -import sys, os - -# -# Set protocol to "ssl" in case you want to run the tests with the SSL -# protocol. Otherwise TCP is used. -# - -#protocol = "ssl" -protocol = "" - # # Set the host to the host name the test servers are running on. If # not set, Ice will try to find out the IP address for the @@ -37,42 +27,7 @@ host = "localhost" # Don't change anything below this line! # -if protocol == "ssl": - print "No SSL available for Ice for Java." - sys.exit(1) -# clientProtocol = " --Ice.Default.Protocol=ssl" + \ -# " --IceSSL.Client.CertPath=TOPLEVELDIR/certs --IceSSL.Client.Config=client_sslconfig.xml" -# serverProtocol = " --Ice.Default.Protocol=ssl" + \ -# " --IceSSL.Server.CertPath=TOPLEVELDIR/certs --IceSSL.Server.Config=server_sslconfig.xml" -# clientServerProtocol = " --Ice.Default.Protocol=ssl" + \ -# " --IceSSL.Client.CertPath=TOPLEVELDIR/certs --IceSSL.Client.Config=sslconfig.xml" + \ -# " --IceSSL.Server.CertPath=TOPLEVELDIR/certs --IceSSL.Server.Config=sslconfig.xml" -else: - clientProtocol = "" - serverProtocol = "" - clientServerProtocol = "" - -if host != "": - defaultHost = " --Ice.Default.Host=" + host -else: - defaultHost = "" - -sep = "" - -if sys.platform == "win32": - sep = ";" -elif sys.platform == "cygwin": - sep = ";" -else: - sep = ":" - -commonServerOptions = " --Ice.PrintAdapterReady --Ice.ServerThreadPool.Size=3" + \ - " --Ice.ConnectionWarnings --Ice.ServerIdleTime=30" - -clientOptions = clientProtocol + defaultHost -serverOptions = serverProtocol + defaultHost + commonServerOptions -clientServerOptions = clientServerProtocol + defaultHost + commonServerOptions -collocatedOptions = clientServerProtocol + defaultHost +import sys, os def isCygwin(): @@ -97,10 +52,10 @@ def killServers(): global serverPids for pid in serverPids: - if sys.platform == "cygwin": + if isCygwin(): print "killServers(): not implemented for cygwin python." sys.exit(1) - elif sys.platform == "win32": + elif isWin32(): try: import win32api handle = win32api.OpenProcess(1, 0, pid) @@ -136,24 +91,51 @@ def getAdapterReady(serverPipe): killServers() sys.exit(1) -def clientServerTestWithOptions(toplevel, name, additionalServerOptions, additionalClientOptions): +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!" - testdir = os.path.join(toplevel, "test", name) - classpath = os.path.join(toplevel, "lib") + sep + os.path.join(testdir, "classes") + sep + \ - os.getenv("CLASSPATH", "") - server = "java -ea -classpath \"" + classpath + "\" Server --Ice.ProgramName=Server " - client = "java -ea -classpath \"" + classpath + "\" Client --Ice.ProgramName=Client " +sep = "" +if isWin32(): + sep = ";" +else: + sep = ":" + +os.environ["CLASSPATH"] = os.path.join(toplevel, "lib") + sep + os.environ["CLASSPATH"] + +clientProtocol = "" +serverProtocol = "" +clientServerProtocol = "" + +if host != "": + defaultHost = " --Ice.Default.Host=" + host +else: + defaultHost = "" - updatedServerOptions = serverOptions.replace("TOPLEVELDIR", toplevel) - updatedClientOptions = clientOptions.replace("TOPLEVELDIR", toplevel) +commonServerOptions = " --Ice.PrintAdapterReady --Ice.ServerThreadPool.Size=3" + \ + " --Ice.ConnectionWarnings --Ice.ServerIdleTime=30" + +clientOptions = clientProtocol + defaultHost +serverOptions = serverProtocol + defaultHost + commonServerOptions +clientServerOptions = clientServerProtocol + defaultHost + commonServerOptions +collocatedOptions = clientServerProtocol + defaultHost + +def clientServerTestWithOptions(name, additionalServerOptions, additionalClientOptions): + + testdir = os.path.join(toplevel, "test", name) + server = "java -ea Server --Ice.ProgramName=Server " + client = "java -ea Client --Ice.ProgramName=Client " print "starting server...", - serverPipe = os.popen(server + updatedServerOptions + additionalServerOptions) + serverPipe = os.popen(server + serverOptions + additionalServerOptions) getAdapterReady(serverPipe) print "ok" print "starting client...", - clientPipe = os.popen(client + updatedClientOptions + additionalClientOptions) + clientPipe = os.popen(client + clientOptions + additionalClientOptions) print "ok" for output in clientPipe.xreadlines(): @@ -166,28 +148,23 @@ def clientServerTestWithOptions(toplevel, name, additionalServerOptions, additio killServers() sys.exit(1) -def clientServerTest(toplevel, name): +def clientServerTest(name): - clientServerTestWithOptions(toplevel, name, "", "") + clientServerTestWithOptions(name, "", "") -def mixedClientServerTestWithOptions(toplevel, name, additionalServerOptions, additionalClientOptions): +def mixedClientServerTestWithOptions(name, additionalServerOptions, additionalClientOptions): testdir = os.path.join(toplevel, "test", name) - classpath = os.path.join(toplevel, "lib") + sep + os.path.join(testdir, "classes") + sep + \ - os.getenv("CLASSPATH", "") - server = "java -ea -classpath \"" + classpath + "\" Server --Ice.ProgramName=Server " - client = "java -ea -classpath \"" + classpath + "\" Client --Ice.ProgramName=Client " - - updatedServerOptions = clientServerOptions.replace("TOPLEVELDIR", toplevel) - updatedClientOptions = updatedServerOptions + server = "java -ea Server --Ice.ProgramName=Server " + client = "java -ea Client --Ice.ProgramName=Client " print "starting server...", - serverPipe = os.popen(server + updatedServerOptions + additionalServerOptions) + serverPipe = os.popen(server + serverOptions + additionalServerOptions) getAdapterReady(serverPipe) print "ok" print "starting client...", - clientPipe = os.popen(client + updatedClientOptions + additionalClientOptions) + clientPipe = os.popen(client + clientOptions + additionalClientOptions) print "ok" for output in clientPipe.xreadlines(): @@ -200,21 +177,17 @@ def mixedClientServerTestWithOptions(toplevel, name, additionalServerOptions, ad killServers() sys.exit(1) -def mixedClientServerTest(toplevel, name): +def mixedClientServerTest(name): - mixedClientServerTestWithOptions(toplevel, name, "", "") + mixedClientServerTestWithOptions(name, "", "") -def collocatedTestWithOptions(toplevel, name, additionalOptions): +def collocatedTestWithOptions(name, additionalOptions): testdir = os.path.join(toplevel, "test", name) - classpath = os.path.join(toplevel, "lib") + sep + os.path.join(testdir, "classes") + sep + \ - os.getenv("CLASSPATH", "") - collocated = "java -ea -classpath \"" + classpath + "\" Collocated --Ice.ProgramName=Collocated " - - updatedCollocatedOptions = collocatedOptions.replace("TOPLEVELDIR", toplevel) + collocated = "java -ea Collocated --Ice.ProgramName=Collocated " print "starting collocated...", - collocatedPipe = os.popen(collocated + updatedCollocatedOptions + additionalOptions) + collocatedPipe = os.popen(collocated + collocatedOptions + additionalOptions) print "ok" for output in collocatedPipe.xreadlines(): @@ -226,9 +199,9 @@ def collocatedTestWithOptions(toplevel, name, additionalOptions): killServers() sys.exit(1) -def collocatedTest(toplevel, name): +def collocatedTest(name): - collocatedTestWithOptions(toplevel, name, "") + collocatedTestWithOptions(name, "") def cleanDbDir(path): diff --git a/java/src/IceInternal/TcpAcceptor.java b/java/src/IceInternal/TcpAcceptor.java index 062cfbb1c1b..282822d112d 100644 --- a/java/src/IceInternal/TcpAcceptor.java +++ b/java/src/IceInternal/TcpAcceptor.java @@ -108,8 +108,13 @@ class TcpAcceptor implements Acceptor { _fd = Network.createTcpServerSocket(); Network.setBlock(_fd, false); - java.net.InetSocketAddress addr = new java.net.InetSocketAddress(host, port); - _addr = Network.doBind(_fd, addr); + _addr = new java.net.InetSocketAddress(host, port); + if(_traceLevels.network >= 2) + { + String s = "attempting to bind to tcp socket " + toString(); + _logger.trace(_traceLevels.networkCat, s); + } + _addr = Network.doBind(_fd, _addr); } catch(RuntimeException ex) { diff --git a/java/src/IceInternal/UdpTransceiver.java b/java/src/IceInternal/UdpTransceiver.java index 6d1cd767ba3..fb28b39a226 100644 --- a/java/src/IceInternal/UdpTransceiver.java +++ b/java/src/IceInternal/UdpTransceiver.java @@ -226,8 +226,13 @@ final class UdpTransceiver implements Transceiver { _fd = Network.createUdpSocket(); Network.setBlock(_fd, false); - java.net.InetSocketAddress addr = new java.net.InetSocketAddress(host, port); - _addr = Network.doBind(_fd, addr); + _addr = new java.net.InetSocketAddress(host, port); + if(_traceLevels.network >= 2) + { + String s = "attempting to bind to udp socket\n" + toString(); + _logger.trace(_traceLevels.networkCat, s); + } + _addr = Network.doBind(_fd, _addr); if(_traceLevels.network >= 1) { diff --git a/java/test/Freeze/complex/run.py b/java/test/Freeze/complex/run.py index 6057457d91a..62517733168 100755 --- a/java/test/Freeze/complex/run.py +++ b/java/test/Freeze/complex/run.py @@ -25,36 +25,37 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel,"test", "Freeze", "complex") +name = os.path.join("Freeze", "complex") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] +# +# Clean the contents of the database directory. +# dbdir = os.path.join(testdir, "db") TestUtil.cleanDbDir(dbdir) -classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + \ - TestUtil.sep + os.getenv("CLASSPATH", "") -client = "java -classpath \"" + classpath + "\" Client --dbdir " + testdir +client = "java -ea Client" +clientOptions = " --dbdir " + testdir; print "starting populate...", -clientPipe = os.popen(client + " populate") +populatePipe = os.popen(client + clientOptions + " populate") print "ok" -for output in clientPipe.xreadlines(): +for output in populatePipe.xreadlines(): print output, -clientStatus = clientPipe.close() +populateStatus = populatePipe.close() -if clientStatus: +if populateStatus: sys.exit(1) -print "starting validate...", -clientPipe = os.popen(client + " validate") -output = clientPipe.read().strip() -if not output: - print "failed!" - clientPipe.close() - sys.exit(1) +print "starting verification client...", +clientPipe = os.popen(client + clientOptions + " validate") print "ok" -print output + +for output in clientPipe.xreadlines(): + print output, clientStatus = clientPipe.close() diff --git a/java/test/Freeze/cursor/run.py b/java/test/Freeze/cursor/run.py index 757bd31bfe5..221603210d8 100755 --- a/java/test/Freeze/cursor/run.py +++ b/java/test/Freeze/cursor/run.py @@ -25,17 +25,18 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel,"test", "Freeze", "cursor") +name = os.path.join("Freeze", "cursor") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] dbdir = os.path.join(testdir, "db") TestUtil.cleanDbDir(dbdir) -classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + \ - TestUtil.sep + os.getenv("CLASSPATH", "") -client = "java -classpath \"" + classpath + "\" Client " + testdir +client = "java -ea Client" +clientOptions = ' ' + testdir; print "starting client...", -clientPipe = os.popen(client) +clientPipe = os.popen(client + clientOptions) print "ok" for output in clientPipe.xreadlines(): diff --git a/java/test/Freeze/dbmap/run.py b/java/test/Freeze/dbmap/run.py index 862d2a72cf3..7c40b6854ee 100755 --- a/java/test/Freeze/dbmap/run.py +++ b/java/test/Freeze/dbmap/run.py @@ -25,17 +25,18 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel,"test", "Freeze", "dbmap") +name = os.path.join("Freeze", "dbmap") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] dbdir = os.path.join(testdir, "db") TestUtil.cleanDbDir(dbdir) -classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + \ - TestUtil.sep + os.getenv("CLASSPATH", "") -client = "java -classpath \"" + classpath + "\" Client " + testdir +client = "java -ea Client" +clientOptions = ' ' + testdir; print "starting client...", -clientPipe = os.popen(client) +clientPipe = os.popen(client + clientOptions) print "ok" for output in clientPipe.xreadlines(): diff --git a/java/test/Freeze/evictor/run.py b/java/test/Freeze/evictor/run.py index bbb507fbde3..0c55168ea44 100755 --- a/java/test/Freeze/evictor/run.py +++ b/java/test/Freeze/evictor/run.py @@ -25,10 +25,12 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel,"test", "Freeze", "evictor") +name = os.path.join("Freeze", "evictor") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] dbdir = os.path.join(testdir, "db") TestUtil.cleanDbDir(dbdir) -TestUtil.clientServerTestWithOptions(toplevel, "Freeze/evictor", " " + testdir, "") +TestUtil.clientServerTestWithOptions(name, " " + testdir, "") sys.exit(0) diff --git a/java/test/Glacier/starter/run.py b/java/test/Glacier/starter/run.py index 23d0a0493e4..d20698d729e 100755 --- a/java/test/Glacier/starter/run.py +++ b/java/test/Glacier/starter/run.py @@ -34,11 +34,7 @@ ice_home = os.environ['ICE_HOME'] starter = os.path.join(ice_home, "bin", "glacierstarter") router = os.path.join(ice_home, "bin", "glacierrouter") -updatedServerOptions = TestUtil.serverOptions.replace("TOPLEVELDIR", toplevel) -updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) -updatedClientServerOptions = TestUtil.clientServerOptions.replace("TOPLEVELDIR", toplevel) - -command = starter + updatedClientServerOptions + \ +command = starter + TestUtil.clientServerOptions + \ r' --Ice.PrintProcessId' \ r' --Glacier.Starter.RouterPath=' + router + \ r' --Glacier.Starter.PropertiesOverwrite=Ice.ServerIdleTime=10' \ @@ -55,11 +51,14 @@ TestUtil.getAdapterReady(starterPipe) print "ok" name = os.path.join("Glacier", "starter") -TestUtil.mixedClientServerTest(toplevel, name) +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] + +TestUtil.mixedClientServerTest(name) -# We run the test again, to check whether the glacier starter can -# start up multiple routers. -TestUtil.mixedClientServerTest(toplevel, name) +# We run the test again, to check whether the glacier router starter +# can start up multiple routers. +TestUtil.mixedClientServerTest(name) print "shutting down glacier starter...", TestUtil.killServers() # TODO: Graceful shutdown. diff --git a/java/test/Ice/adapterDeactivation/run.py b/java/test/Ice/adapterDeactivation/run.py index d230bc3657c..6a637ef945b 100755 --- a/java/test/Ice/adapterDeactivation/run.py +++ b/java/test/Ice/adapterDeactivation/run.py @@ -26,7 +26,9 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Ice", "adapterDeactivation") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] -TestUtil.clientServerTest(toplevel, name) -TestUtil.collocatedTest(toplevel, name) +TestUtil.clientServerTest(name) +TestUtil.collocatedTest(name) sys.exit(0) diff --git a/java/test/Ice/exceptions/run.py b/java/test/Ice/exceptions/run.py index b832ebefcc0..255fc484e2c 100755 --- a/java/test/Ice/exceptions/run.py +++ b/java/test/Ice/exceptions/run.py @@ -26,7 +26,9 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Ice", "exceptions") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] -TestUtil.clientServerTest(toplevel, name) -TestUtil.collocatedTest(toplevel, name) +TestUtil.clientServerTest(name) +TestUtil.collocatedTest(name) sys.exit(0) diff --git a/java/test/Ice/facets/run.py b/java/test/Ice/facets/run.py index 1fd4846df21..a8b6c10db60 100755 --- a/java/test/Ice/facets/run.py +++ b/java/test/Ice/facets/run.py @@ -26,7 +26,9 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Ice", "facets") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] -TestUtil.clientServerTest(toplevel, name) -TestUtil.collocatedTest(toplevel, name) +TestUtil.clientServerTest(name) +TestUtil.collocatedTest(name) sys.exit(0) diff --git a/java/test/Ice/faultTolerance/run.py b/java/test/Ice/faultTolerance/run.py index f2452e71757..68b61543efd 100755 --- a/java/test/Ice/faultTolerance/run.py +++ b/java/test/Ice/faultTolerance/run.py @@ -25,22 +25,20 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel,"test", "Ice", "faultTolerance") -classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + \ - TestUtil.sep + os.getenv("CLASSPATH", "") -server = "java -classpath \"" + classpath + "\" Server" -client = "java -classpath \"" + classpath + "\" Client" +name = os.path.join("Ice", "faultTolerance") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] + +server = "java -ea Server" +client = "java -ea Client" num = 6 base = 12340 -updatedServerOptions = TestUtil.serverOptions.replace("TOPLEVELDIR", toplevel) -updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) - serverPipes = { } for i in range(0, num): print "starting server #%d..." % (i + 1), - serverPipes[i] = os.popen(server + updatedServerOptions + " %d" % (base + i)) + serverPipes[i] = os.popen(server + TestUtil.serverOptions + " %d" % (base + i)) TestUtil.getAdapterReady(serverPipes[i]) print "ok" @@ -48,7 +46,7 @@ ports = "" for i in range(0, num): ports = "%s %d" % (ports, base + i) print "starting client...", -clientPipe = os.popen(client + updatedClientOptions + " " + ports) +clientPipe = os.popen(client + TestUtil.clientOptions + " " + ports) print "ok" for output in clientPipe.xreadlines(): diff --git a/java/test/Ice/inheritance/run.py b/java/test/Ice/inheritance/run.py index 1f7dd687e29..76b54aab357 100755 --- a/java/test/Ice/inheritance/run.py +++ b/java/test/Ice/inheritance/run.py @@ -26,7 +26,9 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Ice", "inheritance") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] -TestUtil.clientServerTest(toplevel, name) -TestUtil.collocatedTest(toplevel, name) +TestUtil.clientServerTest(name) +TestUtil.collocatedTest(name) sys.exit(0) diff --git a/java/test/Ice/location/run.py b/java/test/Ice/location/run.py index 2971c29b33e..f4af7193109 100755 --- a/java/test/Ice/location/run.py +++ b/java/test/Ice/location/run.py @@ -26,6 +26,8 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Ice", "location") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] -TestUtil.clientServerTest(toplevel, name) +TestUtil.mixedClientServerTest(name) sys.exit(0) diff --git a/java/test/Ice/locationForward/run.py b/java/test/Ice/locationForward/run.py index 2db27d134df..3734e10b5ae 100755 --- a/java/test/Ice/locationForward/run.py +++ b/java/test/Ice/locationForward/run.py @@ -25,18 +25,16 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel, "test", "Ice", "locationForward") -classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + \ - TestUtil.sep + os.getenv("CLASSPATH", "") -server = "java -classpath \"" + classpath + "\" Server" -client = "java -classpath \"" + classpath + "\" Client" +name = os.path.join("Ice", "locationForward") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] + +server = "java -ea Server" +client = "java -ea Client" num = 5 base = 12340 -updatedServerOptions = TestUtil.serverOptions.replace("TOPLEVELDIR", toplevel) -updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) - serverPipes = { } for i in range(0, num): if i + 1 < num: @@ -44,14 +42,14 @@ for i in range(0, num): else: s = " %d" % (base + i) print "starting server #%d..." % (i + 1), - command = server + updatedServerOptions + s; + command = server + TestUtil.serverOptions + s; serverPipes[i] = os.popen(command) TestUtil.getAdapterReady(serverPipes[i]) print "ok" print "starting client...", s = " %d %d" % (base, (base + num - 1)) -command = client + updatedClientOptions + s +command = client + TestUtil.clientOptions + s clientPipe = os.popen(command) print "ok" diff --git a/java/test/Ice/objects/run.py b/java/test/Ice/objects/run.py index 29706d1678b..1ec23f28dee 100755 --- a/java/test/Ice/objects/run.py +++ b/java/test/Ice/objects/run.py @@ -26,7 +26,9 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Ice", "objects") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] -TestUtil.clientServerTest(toplevel, name) -TestUtil.collocatedTest(toplevel, name) +TestUtil.clientServerTest(name) +TestUtil.collocatedTest(name) sys.exit(0) diff --git a/java/test/Ice/operations/run.py b/java/test/Ice/operations/run.py index be59dffaf74..516d3a916e5 100755 --- a/java/test/Ice/operations/run.py +++ b/java/test/Ice/operations/run.py @@ -26,7 +26,9 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil name = os.path.join("Ice", "operations") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] -TestUtil.clientServerTest(toplevel, name) -TestUtil.collocatedTest(toplevel, name) +TestUtil.clientServerTest(name) +TestUtil.collocatedTest(name) sys.exit(0) diff --git a/java/test/IcePack/deployer/run.py b/java/test/IcePack/deployer/run.py index cf523418df2..6ced6e9840a 100755 --- a/java/test/IcePack/deployer/run.py +++ b/java/test/IcePack/deployer/run.py @@ -26,33 +26,22 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil import IcePackAdmin -if not os.environ.has_key('ICE_HOME'): - print "ICE_HOME is not defined." - sys.exit(0) - -ice_home = os.environ['ICE_HOME'] - -testdir = os.path.join(toplevel, "test", "IcePack", "deployer") - - -os.environ['CLASSPATH'] = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + \ - TestUtil.sep + os.environ['CLASSPATH'] +name = os.path.join("IcePack", "deployer") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] # # Start the client. # def startClient(options): - updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) + \ - " --Ice.Default.Locator=\"IcePack/Locator:default -p 12346\" " + \ - options + fullClientOptions = TestUtil.clientOptions + \ + " --Ice.Default.Locator=\"IcePack/Locator:default -p 12346\" " + \ + options print "starting client...", - classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + TestUtil.sep + \ - os.getenv("CLASSPATH", "") - - clientPipe = os.popen("java -ea -classpath \"" + classpath + "\" Client " + updatedClientOptions) + clientPipe = os.popen("java -ea Client " + fullClientOptions) print "ok" for output in clientPipe.xreadlines(): @@ -62,30 +51,25 @@ def startClient(options): if clientStatus: print "failed" -if TestUtil.protocol == "ssl": - targets = "ssl" -else: - targets = "" - # # Start IcePack. # IcePackAdmin.cleanDbDir(os.path.join(testdir, "db")) -icePackRegistryPipe = IcePackAdmin.startIcePackRegistry(ice_home, "12346", testdir) -icePackNodePipe = IcePackAdmin.startIcePackNode(ice_home, testdir) +icePackRegistryPipe = IcePackAdmin.startIcePackRegistry("12346", testdir) +icePackNodePipe = IcePackAdmin.startIcePackNode(testdir) # # Deploy the application, run the client and remove the application. # print "deploying application...", -IcePackAdmin.addApplication(ice_home, os.path.join(testdir, "application.xml"), targets); +IcePackAdmin.addApplication(os.path.join(testdir, "application.xml"), ""); print "ok" startClient("") print "removing application...", -IcePackAdmin.removeApplication(ice_home, os.path.join(testdir, "application.xml")); +IcePackAdmin.removeApplication(os.path.join(testdir, "application.xml")); print "ok" # @@ -93,20 +77,19 @@ print "ok" # client to test targets (-t options) and remove the application. # print "deploying application with target...", -IcePackAdmin.addApplication(ice_home, os.path.join(testdir, "application.xml"), - targets + " debug localnode.Server1.manual"); +IcePackAdmin.addApplication(os.path.join(testdir, "application.xml"), "debug localnode.Server1.manual") print "ok" startClient("-t") print "removing application...", -IcePackAdmin.removeApplication(ice_home, os.path.join(testdir, "application.xml")); +IcePackAdmin.removeApplication(os.path.join(testdir, "application.xml")); print "ok" # # Shutdown IcePack. # -IcePackAdmin.shutdownIcePackNode(ice_home, icePackNodePipe) -IcePackAdmin.shutdownIcePackRegistry(ice_home, icePackRegistryPipe) +IcePackAdmin.shutdownIcePackNode(icePackNodePipe) +IcePackAdmin.shutdownIcePackRegistry(icePackRegistryPipe) sys.exit(0) diff --git a/java/test/IcePack/simple/run.py b/java/test/IcePack/simple/run.py index 0b2896731ba..07766f8cac8 100755 --- a/java/test/IcePack/simple/run.py +++ b/java/test/IcePack/simple/run.py @@ -13,7 +13,7 @@ # # ********************************************************************** -import os, sys, time +import os, sys for toplevel in [".", "..", "../..", "../../..", "../../../.."]: toplevel = os.path.normpath(toplevel) @@ -26,18 +26,13 @@ sys.path.append(os.path.join(toplevel, "config")) import TestUtil import IcePackAdmin -if not os.environ.has_key('ICE_HOME'): - print "ICE_HOME is not defined." - sys.exit(0) - -ice_home = os.environ['ICE_HOME'] - -testdir = os.path.join(toplevel, "test", "IcePack", "simple") name = os.path.join("IcePack", "simple") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] # -# Add locator options for client and servers. All servers are now -# clients since they need to make requests to IcePack. +# Add locator options for the client and server. Since the server +# invokes on the locator it's also considered to be a client. # additionalOptions = " --Ice.Default.Locator=\"IcePack/Locator:default -p 12346\"" @@ -46,47 +41,38 @@ IcePackAdmin.cleanDbDir(os.path.join(testdir, "db")) # # Start IcePack registry. # -icePackRegistryPipe = IcePackAdmin.startIcePackRegistry(ice_home, "12346", testdir) +icePackRegistryPipe = IcePackAdmin.startIcePackRegistry("12346", testdir) # -# Test client/server w/o automatic activation. +# Test client/server without on demand activation. # additionalServerOptions=" --TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter " + additionalOptions -TestUtil.mixedClientServerTestWithOptions(toplevel, name, additionalServerOptions, additionalOptions) +TestUtil.mixedClientServerTestWithOptions(name, additionalServerOptions, additionalOptions) # # Shutdown the registry. # -IcePackAdmin.shutdownIcePackRegistry(ice_home, icePackRegistryPipe) +IcePackAdmin.shutdownIcePackRegistry(icePackRegistryPipe) IcePackAdmin.cleanDbDir(os.path.join(testdir, "db")) # # Start IcePack registry and a node. # -icePackRegistryPipe = IcePackAdmin.startIcePackRegistry(ice_home, "12346", testdir) -icePackNodePipe = IcePackAdmin.startIcePackNode(ice_home, testdir) +icePackRegistryPipe = IcePackAdmin.startIcePackRegistry("12346", testdir) +icePackNodePipe = IcePackAdmin.startIcePackNode(testdir) # # Test client/server with on demand activation. # -classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + TestUtil.sep + \ - os.getenv("CLASSPATH", "") -client = "java -ea -classpath \"" + classpath + "\" Client " - -if TestUtil.protocol == "ssl": - targets = "ssl" -else: - targets = "" +client = "java -ea Client" print "registering server with icepack...", -IcePackAdmin.addServer(ice_home, "server", os.path.join(testdir, "simple_server.xml"), "", classpath, ""); +IcePackAdmin.addServer("server", os.path.join(testdir, "simple_server.xml"), "", "", ""); print "ok" -updatedClientOptions = TestUtil.clientOptions.replace("TOPLEVELDIR", toplevel) + additionalOptions - print "starting client...", -clientPipe = os.popen(client + updatedClientOptions) +clientPipe = os.popen(client + TestUtil.clientOptions + additionalOptions) print "ok" for output in clientPipe.xreadlines(): @@ -98,10 +84,10 @@ if clientStatus: sys.exit(1) print "unregister server with icepack...", -IcePackAdmin.removeServer(ice_home, "server"); +IcePackAdmin.removeServer("server"); print "ok" -IcePackAdmin.shutdownIcePackNode(ice_home, icePackNodePipe) -IcePackAdmin.shutdownIcePackRegistry(ice_home, icePackRegistryPipe) +IcePackAdmin.shutdownIcePackNode(icePackNodePipe) +IcePackAdmin.shutdownIcePackRegistry(icePackRegistryPipe) sys.exit(0) diff --git a/java/test/IceXML/encoding/run.py b/java/test/IceXML/encoding/run.py index 6befbf0e0bc..d911d5c207d 100755 --- a/java/test/IceXML/encoding/run.py +++ b/java/test/IceXML/encoding/run.py @@ -25,18 +25,19 @@ else: sys.path.append(os.path.join(toplevel, "config")) import TestUtil -testdir = os.path.join(toplevel,"test", "IceXML", "encoding") -classpath = os.path.join(toplevel, "lib") + TestUtil.sep + os.path.join(testdir, "classes") + \ - TestUtil.sep + os.getenv("CLASSPATH", "") -client = "java -classpath \"" + classpath + "\" Client" +name = os.path.join("IceXML", "encoding") +testdir = os.path.join(toplevel, "test", name) +os.environ["CLASSPATH"] = os.path.join(testdir, "classes") + TestUtil.sep + os.environ["CLASSPATH"] + +client = "java -ea Client" print "starting client...", -clientPipe = os.popen(client) +clientPipe = os.popen(client + " " + testdir) print "ok" for output in clientPipe.xreadlines(): print output, - + clientStatus = clientPipe.close() if clientStatus: |