diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-09-30 04:58:01 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-09-30 04:58:01 +0000 |
commit | a795900d002f4182b13b32f6ebf3391458786123 (patch) | |
tree | 3a75ed09a7ce57e0253f54ee6f0cbcf08dfba3ac /cpp/test/IceGrid/replication/run.py | |
parent | Bug 498. (diff) | |
download | ice-a795900d002f4182b13b32f6ebf3391458786123.tar.bz2 ice-a795900d002f4182b13b32f6ebf3391458786123.tar.xz ice-a795900d002f4182b13b32f6ebf3391458786123.zip |
Added support for <adapter name>.ReplicaId.
Diffstat (limited to 'cpp/test/IceGrid/replication/run.py')
-rwxr-xr-x | cpp/test/IceGrid/replication/run.py | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/cpp/test/IceGrid/replication/run.py b/cpp/test/IceGrid/replication/run.py new file mode 100755 index 00000000000..d6b5483107d --- /dev/null +++ b/cpp/test/IceGrid/replication/run.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import os, sys + +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!" + +sys.path.append(os.path.join(toplevel, "config")) +import TestUtil +import IceGridAdmin + +name = os.path.join("IceGrid", "replication") +testdir = os.path.join(toplevel, "test", name) +client = os.path.join(testdir, "client") + +if TestUtil.isWin32(): + os.environ["PATH"] = testdir + ";" + os.getenv("PATH", "") +elif TestUtil.isAIX(): + os.environ["LIBPATH"] = testdir + ":" + os.getenv("LIBPATH", "") +else: + os.environ["LD_LIBRARY_PATH"] = testdir + ":" + os.getenv("LD_LIBRARY_PATH", "") + os.environ["LD_LIBRARY_PATH_64"] = testdir + ":" + os.getenv("LD_LIBRARY_PATH_64", "") + +# +# 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=\"IceGrid/Locator:default -p 12345\" " + \ + "--Ice.PrintAdapterReady=0 --Ice.PrintProcessId=0 --IceDir=\"" + toplevel + "\" --TestDir=\"" + testdir + "\"" + +IceGridAdmin.cleanDbDir(os.path.join(testdir, "db")) +iceGridRegistryThread = IceGridAdmin.startIceGridRegistry("12345", testdir) +iceGridNodeThread = IceGridAdmin.startIceGridNode(testdir) + +print "registering application with icegrid...", +IceGridAdmin.addApplication(os.path.join(testdir, "application.xml"), + "ice.dir=" + toplevel + " " + "test.dir=" + testdir); +print "ok" + +print "starting client...", +clientPipe = os.popen(client + TestUtil.clientServerOptions + additionalOptions + " 2>&1") +print "ok" + +try: + TestUtil.printOutputFromPipe(clientPipe) +except: + pass + +clientStatus = clientPipe.close() + +print "unregister application with icegrid...", +#IceGridAdmin.removeApplication("test"); +print "ok" + +IceGridAdmin.shutdownIceGridNode() +iceGridNodeThread.join() +IceGridAdmin.shutdownIceGridRegistry() +iceGridRegistryThread.join() + +sys.exit(0) |