summaryrefslogtreecommitdiff
path: root/cpp/test/IceGrid/activation/run.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-01-10 09:24:12 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-01-10 09:24:12 +0000
commitc4bf4bc99155df8414f63daa138879d8ccacb0f2 (patch)
tree6d48fd077ff8d56095bd11db2d9c2157ce93a0ac /cpp/test/IceGrid/activation/run.py
parentfile OpenSSLRuntime.ism was initially added on branch R3_0_branch. (diff)
downloadice-c4bf4bc99155df8414f63daa138879d8ccacb0f2.tar.bz2
ice-c4bf4bc99155df8414f63daa138879d8ccacb0f2.tar.xz
ice-c4bf4bc99155df8414f63daa138879d8ccacb0f2.zip
Added "always" activation mode.
Diffstat (limited to 'cpp/test/IceGrid/activation/run.py')
-rwxr-xr-xcpp/test/IceGrid/activation/run.py77
1 files changed, 77 insertions, 0 deletions
diff --git a/cpp/test/IceGrid/activation/run.py b/cpp/test/IceGrid/activation/run.py
new file mode 100755
index 00000000000..20ed344d558
--- /dev/null
+++ b/cpp/test/IceGrid/activation/run.py
@@ -0,0 +1,77 @@
+#!/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", "activation")
+testdir = os.path.join(toplevel, "test", name)
+
+#
+# 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\""
+
+IceGridAdmin.cleanDbDir(os.path.join(testdir, "db"))
+
+#
+# Start IceGrid registry and a node.
+#
+iceGridRegistryThread = IceGridAdmin.startIceGridRegistry("12345", testdir, 0)
+iceGridNodeThread = IceGridAdmin.startIceGridNode(testdir)
+
+#
+# Test client/server with on demand activation.
+#
+server = os.path.join(testdir, "server")
+client = os.path.join(testdir, "client")
+
+print "registering server with icegrid...",
+IceGridAdmin.addApplication(os.path.join(testdir, "application.xml"),
+ "test.dir=" + testdir + " ice.dir=" + toplevel + \
+ " \\\"properties-override=" + TestUtil.clientServerOptions.replace("--", "") + "\\\"");
+IceGridAdmin.startServer("node-1");
+IceGridAdmin.startServer("node-2");
+print "ok"
+
+print "starting client...",
+clientPipe = os.popen(client + TestUtil.clientOptions + additionalOptions + " --with-deploy" + " 2>&1")
+print "ok"
+
+TestUtil.printOutputFromPipe(clientPipe)
+
+clientStatus = clientPipe.close()
+
+print "unregister server with icegrid...",
+IceGridAdmin.stopServer("node-1");
+IceGridAdmin.stopServer("node-2");
+IceGridAdmin.removeApplication("Test");
+print "ok"
+
+IceGridAdmin.shutdownIceGridNode()
+iceGridNodeThread.join()
+IceGridAdmin.shutdownIceGridRegistry()
+iceGridRegistryThread.join()
+
+if clientStatus:
+ sys.exit(1)
+else:
+ sys.exit(0)