#!/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) testOptions = ' --Freeze.Warn.Deadlocks=0 --Freeze.DbEnv.db.DbHome="%s/db" --Ice.Config="%s/config" ' % (os.getcwd(), os.getcwd()) TestUtil.clientServerTest(testOptions, testOptions)
# 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])
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 # # Clean the contents of the database directory. # dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) sys.stdout.write("starting populate... ") sys.stdout.flush() populateProc = TestUtil.startClient("test.Freeze.complex.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("test.Freeze.complex.Client", ' --dbdir "%s" validate' % os.getcwd(), startReader=False) print("ok")
# # ********************************************************************** import os, sys, re, shutil 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 os.getcwd()!") sys.path.append(os.path.join(path[0], "scripts")) import FreezeTestUtil as TestUtil transformdb = TestUtil.getFreezeExe("transformdb") if TestUtil.appverifier: TestUtil.setAppVerifierSettings([transformdb]) dbdir = os.path.join(os.getcwd(), "db") 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)
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 # # Clean the contents of the database directory. # dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) sys.stdout.write("starting populate... ") sys.stdout.flush() populateProc = TestUtil.startClient("test.Freeze.complex.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("test.Freeze.complex.Client", ' --dbdir "%s" validate' % os.getcwd(),
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 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()
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 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()
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. # # ********************************************************************** import os, sys, imp sys.path.append(os.path.join(os.path.dirname(__file__), "scripts")) import FreezeTestUtil as TestUtil testGroups = [] languages = ["cpp", "java"] for d in languages: filename = os.path.abspath(os.path.join(os.path.dirname(__file__), d, "allTests.py")) f = open(filename, "r") current_mod = imp.load_module("allTests", f, filename, (".py", "r", imp.PY_SOURCE)) f.close() tests = [] tests = [(os.path.join(d, "test", x), y) for x, y in current_mod.tests] if len(tests) > 0: testGroups.extend(tests) TestUtil.run(testGroups, root=True)
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) sys.stdout.write("testing Freeze file lock... ") sys.stdout.flush() client = os.path.join("test.Freeze.fileLock.Client") clientFail = os.path.join("test.Freeze.fileLock.ClientFail") clientExe = TestUtil.startClient(client, "", None, None, False) clientExe.expect('File lock acquired.\.*') clientFailExe = TestUtil.startClient(clientFail, "", None, None, False) clientFailExe.expect('File lock not acquired.') clientFailExe.wait() # send some output to client to terminate it.
#!/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) sys.stdout.write("starting client... ") sys.stdout.flush() clientProc = TestUtil.startClient("test.Freeze.dbmap.Client", '"' + os.getcwd() + '"', startReader=False) print("ok") clientProc.startReader() clientProc.waitTestSuccess()
#!/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) testOptions = ' --Freeze.DbEnv.db.DbHome="%s" --Ice.Config="%s"' % (dbdir, os.path.join(os.getcwd(), "config")) TestUtil.clientServerTest(additionalServerOptions= testOptions, additionalClientOptions= testOptions)
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 # # List of all basic tests. # tests = [ ("Freeze/dbmap", ["once"]), ("Freeze/complex", ["once"]), ("Freeze/evictor", ["once"]), ("Freeze/fileLock", ["once"]), ("FreezeScript/dbmap", ["once"]), ("FreezeScript/evictor", ["once"]), ] if __name__ == "__main__": TestUtil.run(tests)
# # Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. # # ********************************************************************** import os, sys, imp sys.path.append(os.path.join(os.path.dirname(__file__), "scripts")) import FreezeTestUtil as TestUtil testGroups = [] languages = ["cpp", "java"] for d in languages: filename = os.path.abspath( os.path.join(os.path.dirname(__file__), d, "allTests.py")) f = open(filename, "r") current_mod = imp.load_module("allTests", f, filename, (".py", "r", imp.PY_SOURCE)) f.close() tests = [] tests = [(os.path.join(d, "test", x), y) for x, y in current_mod.tests] if len(tests) > 0: testGroups.extend(tests) TestUtil.run(testGroups, root=True)
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 sys.stdout.write("testing process file lock... ") sys.stdout.flush() client = os.path.join("test.Freeze.simpleFileLock.Client") clientFail = os.path.join("test.Freeze.simpleFileLock.ClientFail") clientExe = TestUtil.startClient(client, "", None, None, False) clientExe.expect('File lock acquired.\.*') # # Ensure that the file lock exists. # assert (os.path.exists("file.lock")) clientFailExe = TestUtil.startClient(clientFail, "", None, None, False) clientFailExe.expect('File lock not acquired.') clientFailExe.wait() # send some output to client to terminate it. clientExe.sendline('go') clientExe.expect('File lock released.') clientExe.wait()
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 sys.stdout.write("testing process file lock... ") sys.stdout.flush() client = os.path.join("test.Freeze.simpleFileLock.Client") clientFail = os.path.join("test.Freeze.simpleFileLock.ClientFail") clientExe = TestUtil.startClient(client, "", None, None, False) clientExe.expect('File lock acquired.\.*') # # Ensure that the file lock exists. # assert(os.path.exists("file.lock")); clientFailExe = TestUtil.startClient(clientFail, "", None, None, False) clientFailExe.expect('File lock not acquired.') clientFailExe.wait() # send some output to client to terminate it. clientExe.sendline('go') clientExe.expect('File lock released.') clientExe.wait()
#!/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])
import os, sys, re, shutil 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 transformdb = TestUtil.getFreezeExe("transformdb") if TestUtil.appverifier: TestUtil.setAppVerifierSettings([transformdb]) dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) init_dbdir = os.path.join(os.getcwd(), "db_init") if os.path.exists(init_dbdir): shutil.rmtree(init_dbdir) os.mkdir(init_dbdir) check_dbdir = os.path.join(os.getcwd(), "db_check") if os.path.exists(check_dbdir): shutil.rmtree(check_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) testOptions = ' --Freeze.DbEnv.db.DbHome="%s" --Ice.Config="%s"' % ( dbdir, os.path.join(os.getcwd(), "config")) TestUtil.clientServerTest(additionalServerOptions=testOptions, additionalClientOptions=testOptions)
import os, sys, re, getopt 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 # # List of all basic tests. # tests = [ ("Freeze/dbmap", ["once"]), ("Freeze/complex", ["once"]), ("Freeze/evictor", ["once"]), ("Freeze/fileLock", ["once"]), ("FreezeScript/dbmap", ["once"]), ("FreezeScript/evictor", ["once"]), ] if __name__ == "__main__": TestUtil.run(tests)
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 sys.stdout.write("testing Freeze file lock... ") sys.stdout.flush() client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client")) clientExe = TestUtil.startClient(client, "", None, None, False) clientExe.expect('File lock acquired.\.*') clientFail = os.path.join(os.getcwd(), TestUtil.getTestExecutable("clientFail")) clientFailExe = TestUtil.startClient(clientFail, "", None, None, False) clientFailExe.expect('File lock not acquired') clientFailExe.waitTestSuccess() # send some output to client to terminate it. clientExe.sendline('go') clientExe.expect('File lock released.') clientExe.waitTestSuccess() # The lock is gone try to acquire it again.