0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

allow nopreallocj in smoke.py

This commit is contained in:
gregs 2011-08-03 17:11:43 -04:00
parent 5833aa3be3
commit 5bd4f5885c

View File

@ -151,6 +151,8 @@ class mongod(object):
argv += ['--slave', '--source', 'localhost:' + str(srcport)]
if self.kwargs.get('no_journal'):
argv += ['--nojournal']
if self.kwargs.get('no_preallocj'):
argv += ['--nopreallocj']
print "running " + " ".join(argv)
self.proc = Popen(argv)
if not self.did_mongod_start(self.port):
@ -288,7 +290,8 @@ def runTest(test):
'TestData.testPath = "' + path + '";' +
'TestData.testFile = "' + os.path.basename( path ) + '";' +
'TestData.testName = "' + re.sub( ".js$", "", os.path.basename( path ) ) + '";' +
'TestData.noJournal = ' + ( 'true' if no_journal else 'false' ) + ";" ]
'TestData.noJournal = ' + ( 'true' if no_journal else 'false' ) + ";" +
'TestData.noJournalPrealloc = ' + ( 'true' if no_preallocj else 'false' ) + ";" ]
print argv
r = call(argv, cwd=test_path)
t2 = time.time()
@ -311,7 +314,7 @@ def run_tests(tests):
# The reason we use with is so that we get __exit__ semantics
with mongod(small_oplog=small_oplog,no_journal=no_journal) as master:
with mongod(small_oplog=small_oplog,no_journal=no_journal,no_preallocj=no_preallocj) as master:
with mongod(slave=True) if small_oplog else Nothing() as slave:
if small_oplog:
master.wait_for_repl()
@ -431,7 +434,7 @@ def add_exe(e):
return e
def main():
global mongod_executable, mongod_port, shell_executable, continue_on_failure, small_oplog, no_journal, smoke_db_prefix, test_path
global mongod_executable, mongod_port, shell_executable, continue_on_failure, small_oplog, no_journal, no_preallocj, smoke_db_prefix, test_path
parser = OptionParser(usage="usage: smoke.py [OPTIONS] ARGS*")
parser.add_option('--mode', dest='mode', default='suite',
help='If "files", ARGS are filenames; if "suite", ARGS are sets of tests (%default)')
@ -460,6 +463,9 @@ def main():
parser.add_option('--nojournal', dest='no_journal', default=False,
action="store_true",
help='Do not turn on journaling in tests')
parser.add_option('--nopreallocj', dest='no_preallocj', default=False,
action="store_true",
help='Do not preallocate journal files in tests')
global tests
(options, tests) = parser.parse_args()
@ -481,6 +487,7 @@ def main():
smoke_db_prefix = options.smoke_db_prefix
small_oplog = options.small_oplog
no_journal = options.no_journal
no_preallocj = options.no_preallocj
if options.File:
if options.File == '-':