diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-06-22 17:43:54 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-06-22 17:43:54 +0000 |
commit | 0c24068c2b2116e2e8f63cae92ef8093f0fdfe6b (patch) | |
tree | c8b82a59b3264b5a62726c1b9ec1144dfb4092e8 /cpp/test/IceGrid/session/run.py | |
parent | Committed more fixes for windows compile (diff) | |
download | ice-0c24068c2b2116e2e8f63cae92ef8093f0fdfe6b.tar.bz2 ice-0c24068c2b2116e2e8f63cae92ef8093f0fdfe6b.tar.xz ice-0c24068c2b2116e2e8f63cae92ef8093f0fdfe6b.zip |
Added session tests, completed update tests.
Diffstat (limited to 'cpp/test/IceGrid/session/run.py')
-rwxr-xr-x | cpp/test/IceGrid/session/run.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/cpp/test/IceGrid/session/run.py b/cpp/test/IceGrid/session/run.py new file mode 100755 index 00000000000..1319b654aeb --- /dev/null +++ b/cpp/test/IceGrid/session/run.py @@ -0,0 +1,63 @@ +#!/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", "update") +testdir = os.path.join(toplevel, "test", name) +client = os.path.join(testdir, "client") + +# +# 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) + +node1Dir = os.path.join(testdir, "db", "node-1") +if not os.path.exists(node1Dir): + os.mkdir(node1Dir) +IceGridAdmin.cleanServerDir(node1Dir); + +print "starting client...", +clientPipe = os.popen(client + TestUtil.clientServerOptions + additionalOptions + " 2>&1") +print "ok" + +try: + TestUtil.printOutputFromPipe(clientPipe) +except: + pass + +clientStatus = clientPipe.close() +if clientStatus: + TestUtil.killServers() + sys.exit(1) + +IceGridAdmin.shutdownIceGridNode() +iceGridNodeThread.join() +IceGridAdmin.shutdownIceGridRegistry() +iceGridRegistryThread.join() + +sys.exit(0) |