本文整理汇总了Python中IceGridAdmin类的典型用法代码示例。如果您正苦于以下问题:Python IceGridAdmin类的具体用法?Python IceGridAdmin怎么用?Python IceGridAdmin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了IceGridAdmin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
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 RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
name = os.path.join("IceGrid", "update")
node1Dir = os.path.join(os.getcwd(), "db", "node-1")
if not os.path.exists(node1Dir):
os.mkdir(node1Dir)
else:
IceGridAdmin.cleanDbDir(node1Dir)
node2Dir = os.path.join(os.getcwd(), "db", "node-2")
if not os.path.exists(node2Dir):
os.mkdir(node2Dir)
else:
IceGridAdmin.cleanDbDir(node2Dir)
bindir = TestUtil.getCppBinDir()
testdir = os.getcwd()
serverdir = os.path.join(os.getcwd(), TestUtil.getTestDirectory("server"))
nodeOverrideOptions = '--IceBinDir="%s" --TestDir="%s" --ServerDir="%s" ' % (bindir, testdir, serverdir) + \
'--NodePropertiesOverride=\"%s Ice.ServerIdleTime=0 Ice.PrintProcessId=0 Ice.PrintAdapterReady=0\"' % \
IceGridAdmin.iceGridNodePropertiesOverride()
示例2: print
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
if not TestUtil.isWin32() and os.getuid() == 0:
sys.stdout.write("\n")
sys.stdout.write("*** can't run test as root ***\n")
sys.stdout.write("\n")
sys.exit(0)
name = os.path.join("IceGrid", "session")
node1Dir = os.path.join(os.getcwd(), "db", "node-1")
if not os.path.exists(node1Dir):
os.mkdir(node1Dir)
else:
IceGridAdmin.cleanDbDir(node1Dir)
print("Running test with default encoding...")
verifier = os.path.join(os.getcwd(), TestUtil.getTestExecutable("verifier"))
sys.stdout.write("starting admin permissions verifier... ")
verifierProc = TestUtil.startServer(verifier, config=TestUtil.DriverConfig("server"))
print("ok")
IceGridAdmin.registryOptions += (
r" --Ice.Warn.Dispatch=0"
+ r" --IceGrid.Registry.DynamicRegistration"
+ r" --IceGrid.Registry.SessionFilters"
+ r" --IceGrid.Registry.AdminSessionFilters"
+ r' --IceGrid.Registry.PermissionsVerifier="ClientPermissionsVerifier"'
+ r' --IceGrid.Registry.AdminPermissionsVerifier="AdminPermissionsVerifier:tcp -p 12002"'
示例3: len
if len(path) == 0:
raise RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceStormUtil, IceGridAdmin
targets = []
if TestUtil.appverifier:
targets = [TestUtil.getIceBox()]
TestUtil.setAppVerifierSettings(targets, cwd = os.getcwd())
#
# Remove IceStorm databases possibly left from SQL run.
#
for filename in [os.path.join("db", f) for f in os.listdir("db") if f.endswith(".db")]:
os.remove(filename)
variables = "icebox.exe='%s'" % TestUtil.getIceBox()
#
# Don't use a slave registry for this test.
#
IceGridAdmin.nreplicas=0
#
# Test client/server without on demand activation.
#
IceGridAdmin.iceGridTest("application.xml", "", variables)
if TestUtil.appverifier:
TestUtil.appVerifierAfterTestEnd(targets, cwd = os.getcwd())
示例4:
if not TestUtil.isWin32() and os.getuid() == 0:
sys.stdout.write("\n")
sys.stdout.write("*** can't run test as root ***\n")
sys.stdout.write("\n")
sys.exit(0)
testdir = os.getcwd();
router = TestUtil.getGlacier2Router()
targets = []
if TestUtil.appverifier:
targets = [ TestUtil.getIceGridNode(), TestUtil.getIceGridRegistry(), router]
TestUtil.setAppVerifierSettings(targets)
registryProcs = IceGridAdmin.startIceGridRegistry(testdir)
nodeProc = IceGridAdmin.startIceGridNode(testdir)
sys.stdout.write("starting glacier2... ")
sys.stdout.flush()
args = ' --Glacier2.SessionTimeout=5' + \
' --Glacier2.Client.Endpoints="default -p 12347"' + \
' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1"' \
' --Glacier2.SessionManager=TestIceGrid/AdminSessionManager' + \
' --Glacier2.PermissionsVerifier=Glacier2/NullPermissionsVerifier' + \
' --Glacier2.SSLSessionManager=TestIceGrid/AdminSSLSessionManager' + \
' --Glacier2.SSLPermissionsVerifier=Glacier2/NullSSLPermissionsVerifier' + \
' --Ice.Default.Locator="TestIceGrid/Locator:default -p 12010"' + \
' --IceSSL.VerifyPeer=1'
routerProc = TestUtil.startServer(router, args, count=2)
示例5: Copyright
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2013 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 RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
IceGridAdmin.iceGridTest("application.xml")
示例6: Copyright
# Copyright (c) 2003-2014 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 RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
TestUtil.addLdPath(os.getcwd())
variables = "properties-override='%s' icegridnode.exe='%s' icegridregistry.exe='%s'" % (
IceGridAdmin.iceGridNodePropertiesOverride(),
TestUtil.getIceGridNode(),
TestUtil.getIceGridRegistry(),
)
IceGridAdmin.iceGridTest(
"application.xml", '--IceDir="%s" --TestDir="%s"' % (TestUtil.toplevel, os.getcwd()), variables
)
示例7: Copyright
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2007 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")
IceGridAdmin.iceGridTest(name, "application.xml", "", \
' \\"properties-override=' + TestUtil.clientServerOptions.replace("--", "") + '\\"')
sys.exit(0)
示例8:
import IceGridAdmin
if not TestUtil.isWin32() and os.getuid() == 0:
print
print "*** can't run test as root ***"
print
sys.exit(0)
name = os.path.join("IceGrid", "session")
testdir = os.path.join(toplevel, "test", name)
node1Dir = os.path.join(testdir, "db", "node-1")
if not os.path.exists(node1Dir):
os.mkdir(node1Dir)
else:
IceGridAdmin.cleanDbDir(node1Dir)
print "starting admin permissions verifier...",
serverCmd = os.path.join(testdir, "verifier") + TestUtil.commonServerOptions + TestUtil.defaultHost
if TestUtil.debug:
print "(" + serverCmd + ")",
verifierPipe = os.popen(serverCmd + " 2>&1")
TestUtil.getServerPid(verifierPipe)
TestUtil.getAdapterReady(verifierPipe)
print "ok"
IceGridAdmin.registryOptions += \
r' --IceGrid.Registry.DynamicRegistration' + \
r' --IceGrid.Registry.PermissionsVerifier="ClientPermissionsVerifier"' + \
r' --IceGrid.Registry.AdminPermissionsVerifier="AdminPermissionsVerifier:tcp -p 12002"'+ \
r' --IceGrid.Registry.SSLPermissionsVerifier="SSLPermissionsVerifier"'
示例9: open
[ "original/dir1/file1", "dummy-file1"],
[ "original/dir1/file2", "dummy-file2"],
[ "original/dir2/file3", "dummy-file3"],
[ "updated/rootfile", "rootfile-updated!" ],
[ "updated/dir1/file2", "dummy-file2-updated!"],
[ "updated/dir2/file3", "dummy-file3"],
[ "updated/dir2/file4", "dummy-file4"],
]
sys.stdout.write("creating IcePatch2 data directory... ")
sys.stdout.flush()
if not os.path.exists(datadir):
os.mkdir(datadir)
else:
IceGridAdmin.cleanDbDir(datadir)
for [file, content] in files:
file = os.path.join(datadir, file)
if not os.path.exists(os.path.dirname(file)):
os.makedirs(os.path.dirname(file))
f = open(file, 'w')
f.write(content)
f.close()
icepatch2Calc(datadir, "original")
icepatch2Calc(datadir, "updated")
print("ok")
IceGridAdmin.iceGridTest("application.xml", "", "server.dir='%s'" % TestUtil.getTestDirectory("server"))
示例10: len
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 RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
#
# Don't use a slave registry for this test. This can lead to race
# conditions when resolving endpoints of round-robin replica groups if
# the slave didn't fully load the servers at the time of the client
# invocation
#
IceGridAdmin.nreplicas=0
IceGridAdmin.registryOptions += " --Ice.Plugin.RegistryPlugin=RegistryPlugin:createRegistryPlugin"
IceGridAdmin.registryOptions += " --IceGrid.Registry.DynamicRegistration"
TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("registryplugin"))])
TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("testservice"))])
IceGridAdmin.iceGridTest("application.xml",
"--Ice.RetryIntervals=\"0 50 100 250\"", "icebox.exe='%s' server.dir='%s'" % (TestUtil.getIceBox(), TestUtil.getTestDirectory("server")))
示例11: Copyright
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2016 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 RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
IceGridAdmin.iceGridTest("application.xml", applicationOptions = "server.dir='%s' verifier.dir='%s'" %
(TestUtil.getTestDirectory("server"), TestUtil.getTestDirectory("verifier")))
示例12: str
iceGrid = TestUtil.getIceGridRegistry()
command = ' --nowarn ' + IceGridAdmin.registryOptions
dataDir = os.path.join(testdir, "db", "registry")
if not os.path.exists(dataDir):
os.mkdir(dataDir)
cmd = command + ' ' + \
r' --Ice.ProgramName=registry' + \
r' --IceGrid.Registry.Client.Endpoints="default -p ' + str(IceGridAdmin.iceGridPort) + '" ' + \
r' --IceGrid.Registry.LMDB.MapSize=1 --IceGrid.Registry.LMDB.Path="' + dataDir + '"'
driverConfig = TestUtil.DriverConfig("server")
driverConfig.lang = "cpp"
cmd = TestUtil.getCommandLine(iceGrid, driverConfig) + ' ' + cmd
proc = TestUtil.spawn(cmd)
return proc
registryProcs = IceGridAdmin.startIceGridRegistry(testdir)
sys.stdout.write("testing IceGrid file lock... ")
IceGridAdmin.iceGridPort = 12011
iceGrid = runIceGridRegistry()
iceGrid.expect(".*IceUtil::FileLockException.*")
iceGrid.wait()
IceGridAdmin.iceGridPort = 12010
print("ok")
IceGridAdmin.shutdownIceGridRegistry(registryProcs)
示例13: RuntimeError
raise RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
os.environ["MY_FOO"] = "12"
if TestUtil.isDarwin():
#
# On OS X, make sure to also run the IceBox services in 32bits mode if
# x64 isn't specified and the service is built for 32bits.
#
iceBox = os.path.join(os.getcwd(), "iceboxwrapper")
iceBoxWrapper = open(iceBox, "w")
if TestUtil.x64:
iceBoxWrapper.write("#!/bin/sh\narch -x86_64 " + TestUtil.getIceBox() + " \"[email protected]\"\n")
else:
iceBoxWrapper.write("#!/bin/sh\narch -i386 -x86_64 " + TestUtil.getIceBox() + " \"[email protected]\"\n")
iceBoxWrapper.close()
os.chmod(iceBox, 0o700)
else:
iceBox = TestUtil.getIceBox()
IceGridAdmin.iceGridTest("application.xml", '--TestDir="%s"' % os.getcwd(), "icebox.exe='%s'" % iceBox)
# Tests with targets
IceGridAdmin.iceGridTest("application.xml", '-t --TestDir="%s"' % os.getcwd(),
"icebox.exe='%s' moreservers moreservices moreproperties" % iceBox)
if TestUtil.isDarwin():
os.unlink("iceboxwrapper")
示例14: open
[ "original/rootfile", "rootfile" ],
[ "original/dir1/file1", "dummy-file1"],
[ "original/dir1/file2", "dummy-file2"],
[ "original/dir2/file3", "dummy-file3"],
[ "updated/rootfile", "rootfile-updated!" ],
[ "updated/dir1/file2", "dummy-file2-updated!"],
[ "updated/dir2/file3", "dummy-file3"],
[ "updated/dir2/file4", "dummy-file4"],
]
print "creating IcePatch2 data directory...",
if not os.path.exists(datadir):
os.mkdir(datadir)
else:
IceGridAdmin.cleanDbDir(datadir)
for [file, content] in files:
file = os.path.join(datadir, file)
if not os.path.exists(os.path.dirname(file)):
os.makedirs(os.path.dirname(file))
f = open(file, 'w')
f.write(content)
f.close()
icepatch2Calc(datadir, "original")
icepatch2Calc(datadir, "updated")
print "ok"
IceGridAdmin.iceGridTest(name, "application.xml", "")
示例15: print
sys.path.append(os.path.join(path[0], "scripts"))
import TestUtil, IceGridAdmin
if not TestUtil.isWin32() and os.getuid() == 0:
sys.stdout.write("\n")
sys.stdout.write("*** can't run test as root ***\n")
sys.stdout.write("\n")
sys.exit(0)
name = os.path.join("IceGrid", "session")
node1Dir = os.path.join(os.getcwd(), "db", "node-1")
if not os.path.exists(node1Dir):
os.mkdir(node1Dir)
else:
IceGridAdmin.cleanDbDir(node1Dir)
print("Running test with default encoding...")
sys.stdout.write("starting admin permissions verifier... ")
verifierProc = TestUtil.startServer(os.path.join(os.getcwd(), "verifier"), config=TestUtil.DriverConfig("server"))
print("ok")
IceGridAdmin.registryOptions += \
r' --IceGrid.Registry.DynamicRegistration' + \
r' --IceGrid.Registry.SessionFilters' + \
r' --IceGrid.Registry.AdminSessionFilters' + \
r' --IceGrid.Registry.PermissionsVerifier="ClientPermissionsVerifier"' + \
r' --IceGrid.Registry.AdminPermissionsVerifier="AdminPermissionsVerifier:tcp -p 12002"'+ \
r' --IceGrid.Registry.SSLPermissionsVerifier="SSLPermissionsVerifier"' + \
r' --IceGrid.Registry.AdminSSLPermissionsVerifier="SSLPermissionsVerifier"'