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

SERVER-13635: allow smoke.py to use alternate storage engines

This commit is contained in:
Eliot Horowitz 2014-07-24 15:19:02 -04:00
parent 03048e3ab4
commit 6d2e9273bb
2 changed files with 12 additions and 4 deletions

View File

@ -206,6 +206,8 @@ class mongod(NullMongod):
argv += ['--setParameter', 'enableTestCommands=1', '--httpinterface']
if self.kwargs.get('small_oplog'):
argv += ["--master", "--oplogSize", "511"]
if self.kwargs.get('storage_engine'):
argv += ["--storageEngine", self.kwargs.get('storage_engine')]
params = self.kwargs.get('set_parameters', None)
if params:
for p in params.split(','): argv += ['--setParameter', p]
@ -638,6 +640,7 @@ def run_tests(tests):
master = mongod(small_oplog_rs=small_oplog_rs,
small_oplog=small_oplog,
no_journal=no_journal,
storage_engine=storage_engine,
set_parameters=set_parameters,
no_preallocj=no_preallocj,
auth=auth,
@ -655,6 +658,7 @@ def run_tests(tests):
small_oplog_rs=small_oplog_rs,
small_oplog=small_oplog,
no_journal=no_journal,
storage_engine=storage_engine,
set_parameters=set_parameters,
no_preallocj=no_preallocj,
auth=auth,
@ -721,6 +725,7 @@ def run_tests(tests):
master = mongod(small_oplog_rs=small_oplog_rs,
small_oplog=small_oplog,
no_journal=no_journal,
storage_engine=storage_engine,
set_parameters=set_parameters,
no_preallocj=no_preallocj,
auth=auth,
@ -987,7 +992,7 @@ def add_exe(e):
def set_globals(options, tests):
global mongod_executable, mongod_port, shell_executable, continue_on_failure
global small_oplog, small_oplog_rs
global no_journal, set_parameters, set_parameters_mongos, no_preallocj
global no_journal, set_parameters, set_parameters_mongos, no_preallocj, storage_engine
global auth, authMechanism, keyFile, keyFileData, smoke_db_prefix, test_path, start_mongod
global use_ssl, use_x509
global file_of_commands_mode
@ -1021,6 +1026,7 @@ def set_globals(options, tests):
if hasattr(options, "small_oplog_rs"):
small_oplog_rs = options.small_oplog_rs
no_journal = options.no_journal
storage_engine = options.storage_engine
set_parameters = options.set_parameters
set_parameters_mongos = options.set_parameters_mongos
no_preallocj = options.no_preallocj
@ -1135,7 +1141,7 @@ def add_to_failfile(tests, options):
def main():
global mongod_executable, mongod_port, shell_executable, continue_on_failure, small_oplog
global no_journal, set_parameters, set_parameters_mongos, no_preallocj, auth
global no_journal, set_parameters, set_parameters_mongos, no_preallocj, auth, storage_engine
global keyFile, smoke_db_prefix, test_path, use_write_commands
parser = OptionParser(usage="usage: smoke.py [OPTIONS] ARGS*")
@ -1166,6 +1172,8 @@ def main():
parser.add_option('--small-oplog-rs', dest='small_oplog_rs', default=False,
action="store_true",
help='Run tests with replica set replication & use a small oplog')
parser.add_option('--storageEngine', dest='storage_engine', default=None,
help='What storage engine to start mongod with')
parser.add_option('--nojournal', dest='no_journal', default=False,
action="store_true",
help='Do not turn on journaling in tests')

View File

@ -29,13 +29,13 @@ dd( "c" );
*/
db.getCollection( "test" ).drop();
db.getCollection( "system.namespaces" ).find().forEach( function(x) { assert(x.name != "test.test"); });
db.getCollectionNames().forEach( function(x) { assert(x != "test"); });
dd( "d" );
db.createCollection("test");
var found = false;
db.getCollection( "system.namespaces" ).find().forEach( function(x) { if (x.name == "test.test") found = true; });
db.getCollectionNames().forEach( function(x) { if (x == "test") found = true; });
assert(found, "found test.test in system.namespaces");
dd( "e" );