] if len(path) == 0: raise RuntimeError("can't find toplevel directory!") sys.path.append(os.path.join(path[0], "scripts")) import FreezeTestUtil as TestUtil testdir = os.path.dirname(os.path.abspath(__file__)) # # 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()
TestUtil.cleanDbDir(dbdir) check_dbdir = os.path.join(os.getcwd(), "db_check") if os.path.exists(check_dbdir): shutil.rmtree(check_dbdir) os.mkdir(check_dbdir) tmp_dbdir = os.path.join(os.getcwd(), "db_tmp") if os.path.exists(tmp_dbdir): shutil.rmtree(tmp_dbdir) os.mkdir(tmp_dbdir) sys.stdout.write("creating test database... ") sys.stdout.flush() 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)
else: line1 = regex2.sub("", lines1[i].decode("utf-8")).strip() line2 = regex2.sub("", lines2[i]).strip() if line1 != line2: print("failed! (2)") print("line1 = " + line1) print("line2 = " + line2) # sys.exit(1) i = i + 1 print("ok") sys.stdout.write("creating test database... ") sys.stdout.flush() 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") initxml = os.path.join(os.getcwd(), "init.xml") checkxml = os.path.join(os.getcwd(), "check.xml") sys.stdout.write("initializing test database... ") sys.stdout.flush() command = '"' + transformdb + '" --old "' + testold + '" --new "' + testold + '" -f "' + initxml + '" "' + dbdir + \ '" default.db "' + init_dbdir + '" '
#!/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])