summaryrefslogtreecommitdiff
path: root/cpp/test/IceGrid/fileLock/run.py
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2009-12-07 14:48:27 +1000
committerMichi Henning <michi@zeroc.com>2009-12-07 14:48:27 +1000
commit8d0c264fc218d2806eb610f325602353e58e6034 (patch)
tree939c96e2c7ab4ae0d8a3cd16fcba53574149dcc1 /cpp/test/IceGrid/fileLock/run.py
parentAdded Excel demo. (diff)
parent4424 - .NET FxCop Globalization Rules (diff)
downloadice-8d0c264fc218d2806eb610f325602353e58e6034.tar.bz2
ice-8d0c264fc218d2806eb610f325602353e58e6034.tar.xz
ice-8d0c264fc218d2806eb610f325602353e58e6034.zip
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Diffstat (limited to 'cpp/test/IceGrid/fileLock/run.py')
-rwxr-xr-xcpp/test/IceGrid/fileLock/run.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/cpp/test/IceGrid/fileLock/run.py b/cpp/test/IceGrid/fileLock/run.py
new file mode 100755
index 00000000000..b580890bce1
--- /dev/null
+++ b/cpp/test/IceGrid/fileLock/run.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 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
+
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
+ raise "can't find toplevel directory!"
+sys.path.append(os.path.join(path[0]))
+from scripts import *
+
+def runIceGridRegistry(testdir):
+ iceGrid = ""
+ if TestUtil.isBCC2010() or TestUtil.isVC6():
+ iceGrid = os.path.join(TestUtil.getServiceDir(), "icegridregistry")
+ else:
+ iceGrid = os.path.join(TestUtil.getCppBinDir(), "icegridregistry")
+
+ command = ' --nowarn ' + IceGridAdmin.registryOptions
+
+ name = "registry"
+
+ dataDir = os.path.join(testdir, "db", name)
+ if not os.path.exists(dataDir):
+ os.mkdir(dataDir)
+
+ cmd = command + ' ' + TestUtil.getQtSqlOptions('IceGrid') + \
+ r' --Ice.ProgramName=' + name + \
+ r' --IceGrid.Registry.Client.Endpoints="default -p ' + str(IceGridAdmin.iceGridPort) + '" ' + \
+ r' --IceGrid.Registry.Data=' + dataDir
+
+ driverConfig = TestUtil.DriverConfig("server")
+ driverConfig.lang = "cpp"
+
+ cmd = TestUtil.getCommandLine(iceGrid, driverConfig) + ' ' + cmd
+ proc = TestUtil.spawn(cmd)
+ return proc
+
+IceGridAdmin.cleanDbDir("./db/registry")
+
+print "testing IceGrid file lock...",
+iceGrid1 = runIceGridRegistry(".")
+iceGrid1.expect("[^\n]+ ready\n")
+
+iceGrid2 = runIceGridRegistry(".")
+iceGrid2.expect(".*IceUtil::FileLockedException.*")
+print "ok"
+
+IceGridAdmin.iceGridAdmin("registry shutdown")
+IceGridAdmin.cleanDbDir("./db/registry")