0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/noPassthrough/disabled_test_parameters.js

45 lines
1.1 KiB
JavaScript

// Test that test-only set parameters are disabled.
(function() {
'use strict';
function assertFails(opts) {
assert.eq(null, MongoRunner.runMongod(opts), "Mongod startup up");
}
function assertStarts(opts) {
const mongod = MongoRunner.runMongod(opts);
assert(mongod, "Mongod startup up");
MongoRunner.stopMongod(mongod);
}
setJsTestOption('enableTestCommands', false);
// enableTestCommands not specified.
assertFails({
'setParameter': {
AlwaysRecordTraffic: 'false',
},
});
// enableTestCommands specified as truthy.
['1', 'true'].forEach(v => {
assertStarts({
'setParameter': {
enableTestCommands: v,
disableIndexSpecNamespaceGeneration: 'false',
},
});
});
// enableTestCommands specified as falsy.
['0', 'false'].forEach(v => {
assertFails({
'setParameter': {
enableTestCommands: v,
AlwaysRecordTraffic: 'false',
},
});
});
}());