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()
else: iceGrid = os.path.join(TestUtil.getCppBinDir(), "icegridregistry") command = ' --nowarn ' + IceGridAdmin.registryOptions dataDir = os.path.join(testdir, "db", "registry") if not os.path.exists(dataDir): os.mkdir(dataDir) cmd = command + ' ' + TestUtil.getQtSqlOptions('IceGrid') + \ r' --Ice.ProgramName=registry' + \ 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 registryProcs = IceGridAdmin.startIceGridRegistry(testdir) sys.stdout.write("testing IceGrid file lock... ") iceGrid = runIceGridRegistry() iceGrid.expect(".*IceUtil::FileLockedException.*") iceGrid.wait() print("ok") IceGridAdmin.shutdownIceGridRegistry(registryProcs)
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)
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"'
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 # Test IceGrid discovery with multiple replicas IceGridAdmin.nreplicas = 2 # # Test client/server without on demand activation. # IceGridAdmin.iceGridClientServerTest( "", "--TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter") # # Test client/server with on demand activation. # IceGridAdmin.iceGridTest("simple_server.xml", "--with-deploy")
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)
# 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 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() + " \"$@\"\n") else: iceBoxWrapper.write("#!/bin/sh\narch -i386 -x86_64 " + TestUtil.getIceBox() + " \"$@\"\n") iceBoxWrapper.close() os.chmod(iceBox, 0o700) else: iceBox = TestUtil.getIceBox() IceGridAdmin.iceGridTest("application.xml", "--Ice.RetryIntervals=\"0 50 100 250\"", "icebox.exe='%s'" % iceBox) if TestUtil.isDarwin(): os.unlink("iceboxwrapper")
# # 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 TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("testservice"))]) serverDir = os.path.join(os.getcwd(), TestUtil.getTestDirectory("server")) os.environ["MY_FOO"] = "12" IceGridAdmin.iceGridTest("application.xml", '--TestDir="%s"' % serverDir, ("icebox.exe='%s' server.dir='%s'" % (TestUtil.getIceBox(), serverDir))) # Tests with targets IceGridAdmin.iceGridTest("application.xml", '-t --TestDir="%s"' % serverDir, ("icebox.exe='%s' server.dir='%s' moreservers moreservices moreproperties" % (TestUtil.getIceBox(), serverDir)))
[ "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"))
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", "deployer") testdir = os.path.join(toplevel, "test", name) TestUtil.addLdPath(testdir) iceBox = TestUtil.getIceBox(testdir) IceGridAdmin.iceGridTest(name, "application.xml", "--TestDir=\"" + testdir + "\"", \ '"icebox.exe=' + TestUtil.getIceBox(testdir) + '"') # Tests with targets IceGridAdmin.iceGridTest(name, "application.xml", "-t --TestDir=\"" + testdir + "\"", \ "icebox.exe=" + TestUtil.getIceBox(testdir) + \ " moreservers moreservices moreproperties") sys.exit(0)
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")))
["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"], ] 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", "",
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 # Test IceGrid discovery with multiple replicas IceGridAdmin.nreplicas = 2 testdir = os.path.join(os.getcwd(), ) # # Test client/server without on demand activation. # IceGridAdmin.iceGridClientServerTest( "", "--TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter") # # Test client/server with on demand activation. # IceGridAdmin.iceGridTest( "simple_server.xml", "--with-deploy", "server.dir='%s'" % TestUtil.getTestDirectory("server"))
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)
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"' + \
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, IceStormUtil, IceGridAdmin targets = [] if TestUtil.appverifier: targets = [TestUtil.getIceBox()] TestUtil.setAppVerifierSettings(targets, cwd = os.getcwd()) 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())
#!/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", "allocation") IceGridAdmin.iceGridTest(name, "application.xml") sys.exit(0)
[ "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", "")
# ********************************************************************** # # 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=( "properties-override='%s' icegridnode.exe='%s' server.dir='%s'" % (IceGridAdmin.iceGridNodePropertiesOverride(), TestUtil.getIceGridNode(), TestUtil.getTestDirectory("server"))))
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", "noRestartUpdate") 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) nodeOverrideOptions = '--IceBinDir="%s" --TestDir="%s" --NodePropertiesOverride="%s Ice.ServerIdleTime=0 Ice.PrintProcessId=0 Ice.PrintAdapterReady=0"' % ( TestUtil.getCppBinDir("cpp"), os.getcwd(), TestUtil.getCommandLine("", TestUtil.DriverConfig("server")).replace( "--", "")) IceGridAdmin.iceGridTest("", nodeOverrideOptions)
#!/usr/bin/env python # ********************************************************************** # # 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 IceGridAdmin.iceGridTest("application.xml", "", "properties-override='%s' icegridnode.exe='%s'" % (IceGridAdmin.iceGridNodePropertiesOverride(), TestUtil.getIceGridNode()))
# 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 # Test IceGrid discovery with multiple replicas IceGridAdmin.nreplicas=2 testdir = os.path.join(os.getcwd(),) # # Test client/server without on demand activation. # IceGridAdmin.iceGridClientServerTest("", "--TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter") # # Test client/server with on demand activation. # IceGridAdmin.iceGridTest("simple_server.xml", "--with-deploy", "server.dir='%s'" % TestUtil.getTestDirectory("server"))
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"'
# 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 # # 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.iceGridTest("application.xml", "--Ice.RetryIntervals=\"0 50 100 250\"", "icebox.exe='%s'" % TestUtil.getIceBox())
#!/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", "", "properties-override='%s'" % IceGridAdmin.iceGridNodePropertiesOverride())
# # ********************************************************************** 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()) serverdir = os.path.join(os.getcwd(), TestUtil.getTestDirectory("server")) variables = ( "properties-override='%s' icegridnode.exe='%s' icegridregistry.exe='%s' server.dir='%s'" % (IceGridAdmin.iceGridNodePropertiesOverride(), TestUtil.getIceGridNode(), TestUtil.getIceGridRegistry(), serverdir)) IceGridAdmin.iceGridTest( "application.xml", '--IceDir="%s" --ServerDir="%s"' % (TestUtil.toplevel, serverdir), variables)
#!/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)
#!/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")))
#!/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 TestUtil.addLdPath(os.getcwd()) serverdir = os.path.join(os.getcwd(), TestUtil.getTestDirectory("server")) variables = ("properties-override='%s' icegridnode.exe='%s' icegridregistry.exe='%s' server.dir='%s'" % (IceGridAdmin.iceGridNodePropertiesOverride(), TestUtil.getIceGridNode(), TestUtil.getIceGridRegistry(), serverdir)) IceGridAdmin.iceGridTest("application.xml", '--IceDir="%s" --ServerDir="%s"' % (TestUtil.toplevel, serverdir), variables)
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"' + \
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() + " \"$@\"\n") else: iceBoxWrapper.write("#!/bin/sh\narch -i386 -x86_64 " + TestUtil.getIceBox() + " \"$@\"\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")
#!/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")
# ********************************************************************** # # 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", "replicaGroup") testdir = os.path.join(toplevel, "test", name) TestUtil.addLdPath(testdir) IceGridAdmin.iceGridTest(name, "application.xml", "--Ice.RetryIntervals=\"0 50 100 250\"", \ "icebox.exe=" + TestUtil.getIceBox(testdir)) sys.exit(0)
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()) if TestUtil.sqlType != None and TestUtil.sqlType != "QSQLITE": print("*** This test only supports Freeze or SQLite databases") sys.exit(0) variables = "properties-override='%s'" % IceGridAdmin.iceGridNodePropertiesOverride( ) if TestUtil.sqlType != None: variables += " db-plugin=IceGridSqlDB:createSqlDB" else: variables += " db-plugin=IceGridFreezeDB:createFreezeDB" IceGridAdmin.iceGridTest( "application.xml", '--IceDir="%s" --TestDir="%s"' % (TestUtil.toplevel, os.getcwd()), variables)
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")))
# 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 )
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"'
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())
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() + " \"$@\"\n") else: iceBoxWrapper.write("#!/bin/sh\narch -i386 -x86_64 " + TestUtil.getIceBox() + " \"$@\"\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")
# 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 # Test IceGrid discovery with multiple replicas IceGridAdmin.nreplicas=2 # # Test client/server without on demand activation. # IceGridAdmin.iceGridClientServerTest("", "--TestAdapter.Endpoints=default --TestAdapter.AdapterId=TestAdapter") # # Test client/server with on demand activation. # IceGridAdmin.iceGridTest("simple_server.xml", "--with-deploy")
["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"], ] 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")
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) nodeOverrideOptions = '--IceBinDir="%s" --TestDir="%s" ' % (TestUtil.getCppBinDir(), os.getcwd()) + \ '--NodePropertiesOverride=\"%s Ice.ServerIdleTime=0 Ice.PrintProcessId=0 Ice.PrintAdapterReady=0\"' % \ IceGridAdmin.iceGridNodePropertiesOverride() IceGridAdmin.iceGridTest("", nodeOverrideOptions)
#!/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", "", "properties-override='%s'" % IceGridAdmin.iceGridNodePropertiesOverride())
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 name = os.path.join("IceGrid", "noRestartUpdate") 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) nodeOverrideOptions = '--IceBinDir="%s" --TestDir="%s" --NodePropertiesOverride="%s Ice.ServerIdleTime=0 Ice.PrintProcessId=0 Ice.PrintAdapterReady=0"' % ( TestUtil.getCppBinDir("cpp"), os.getcwd(), TestUtil.getCommandLine("", TestUtil.DriverConfig("server")).replace("--", "")) IceGridAdmin.iceGridTest("", nodeOverrideOptions)
#!/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 = ("properties-override='%s' icegridnode.exe='%s' server.dir='%s'" % (IceGridAdmin.iceGridNodePropertiesOverride(), TestUtil.getIceGridNode(), TestUtil.getTestDirectory("server"))))