Exemple #1
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

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()
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
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"'
Exemple #5
0
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")
Exemple #6
0
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)
Exemple #7
0
# 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")
Exemple #8
0
#
# 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)))
Exemple #9
0
  [ "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"))
Exemple #10
0
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)
Exemple #11
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")))
Exemple #12
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"],
]

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", "",
Exemple #13
0
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"))
Exemple #14
0
    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)
Exemple #15
0
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"' + \
Exemple #16
0
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())
Exemple #17
0
#!/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)
Exemple #18
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", "")
Exemple #19
0
# **********************************************************************
#
# 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"))))
Exemple #20
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)
Exemple #21
0
#!/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()))
Exemple #22
0
# 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"))
Exemple #23
0
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"'
Exemple #24
0
# 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())
Exemple #25
0
#!/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())
Exemple #26
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

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)
Exemple #27
0
#!/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)
Exemple #28
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")))
Exemple #29
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

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)
Exemple #30
0
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"' + \
Exemple #31
0
    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")
Exemple #32
0
#!/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")
Exemple #33
0
# **********************************************************************
#
# 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)
Exemple #34
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)
Exemple #35
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")))
Exemple #36
0
# 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
)
Exemple #37
0
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"'
Exemple #38
0
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())
Exemple #39
0
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")
Exemple #40
0
# 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")
Exemple #41
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"],
]

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")
Exemple #42
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)

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)
Exemple #43
0
#!/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())
Exemple #44
0
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)
Exemple #45
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 = ("properties-override='%s' icegridnode.exe='%s' server.dir='%s'" %
	                     (IceGridAdmin.iceGridNodePropertiesOverride(),
                          TestUtil.getIceGridNode(),
                          TestUtil.getTestDirectory("server"))))