コード例 #1
0
# Clean the contents of the database directory.
#
dbdir = os.path.join(os.getcwd(), "db")
TestUtil.cleanDbDir(dbdir)

client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))

if TestUtil.appverifier:
    TestUtil.setAppVerifierSettings([client])

sys.stdout.write("starting populate... ")
sys.stdout.flush()
populateProc = TestUtil.startClient(client,
                                    ' --dbdir "%s" populate' % os.getcwd(),
                                    startReader=False)
print("ok")
populateProc.startReader()
populateProc.waitTestSuccess()

sys.stdout.write("starting verification client... ")
sys.stdout.flush()
clientProc = TestUtil.startClient(client,
                                  ' --dbdir "%s" validate' % os.getcwd(),
                                  startReader=False)
print("ok")
clientProc.startReader()
clientProc.waitTestSuccess()

if TestUtil.appverifier:
    TestUtil.appVerifierAfterTestEnd([client])
コード例 #2
0
ファイル: run.py プロジェクト: zhangwei5095/zeroc-ice-freeze
makedb = os.path.join(os.getcwd(), TestUtil.getTestExecutable("makedb"))
proc = TestUtil.spawn(makedb)
proc.waitTestSuccess()
print("ok")

testold = os.path.join(os.getcwd(), "TestOld.ice")
testnew = os.path.join(os.getcwd(), "TestNew.ice")
transformxml = os.path.join(os.getcwd(), "transform.xml")
checkxml = os.path.join(os.getcwd(), "check.xml")

sys.stdout.write("executing evictor transformations... ")
sys.stdout.flush()

command = '"' + transformdb + '" -e -p --old "' + testold + '" --new "' + testnew + '" -f "' + transformxml + '" "' + dbdir + \
    '" evictor.db "' + check_dbdir + '" '
proc = TestUtil.spawn(command)
proc.waitTestSuccess()
print("ok")

sys.stdout.write("validating database... ")
sys.stdout.flush()

command = '"' + transformdb + '" -e --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + check_dbdir + \
    '" evictor.db "' + tmp_dbdir + '"'
proc = TestUtil.spawn(command)
proc.waitTestSuccess()
print("ok")

if TestUtil.appverifier:
    TestUtil.appVerifierAfterTestEnd([transformdb])
コード例 #3
0
ファイル: run.py プロジェクト: citms/freeze
command = '"' + transformdb + '" --old "' + testold + '" --new "' + testold + '" -f "' + initxml + '" "' + dbdir + \
    '" default.db "' + init_dbdir + '" '

TestUtil.spawn(command).waitTestSuccess()

print("ok")

sys.stdout.write("executing default transformations... ")
sys.stdout.flush()

command = '"' + transformdb + '" --old "' + testold + '" --new "' + testnew + '" --key int --value ::Test::S "' + \
    init_dbdir + '" default.db "' + check_dbdir + '" '

TestUtil.spawn(command).waitTestSuccess()

print("ok")

sys.stdout.write("validating database... ")
sys.stdout.flush()

command = '"' + transformdb + '" --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + \
    check_dbdir + '" default.db "' + tmp_dbdir + '" '

TestUtil.spawn(command).waitTestSuccess()

print("ok")

if TestUtil.appverifier:
    TestUtil.appVerifierAfterTestEnd([transformdb])
コード例 #4
0
ファイル: run.py プロジェクト: zhangwei5095/zeroc-ice-freeze
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
#
# **********************************************************************

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", "FreezeTestUtil.py")) ]
if len(path) == 0:
    raise RuntimeError("can't find toplevel directory!")
sys.path.append(os.path.join(path[0], "scripts"))
import FreezeTestUtil as TestUtil

dbdir = os.path.join(os.getcwd(), "db")
TestUtil.cleanDbDir(dbdir)

if TestUtil.appverifier:
    TestUtil.setAppVerifierSettings([client])

client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
TestUtil.simpleTest(client, ' --Freeze.Warn.Rollback=0 "%s"' % os.getcwd())

if TestUtil.appverifier:
    TestUtil.appVerifierAfterTestEnd([client])