0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/replsets/repl_options.js
2016-05-28 17:55:12 -04:00

31 lines
1.1 KiB
JavaScript

var baseName = "jstests_repl_repl_options";
load('jstests/libs/command_line/test_parsed_options.js');
jsTest.log("Testing \"replSet\" command line option");
var expectedResult = {"parsed": {"replication": {"replSet": "mycmdlinename"}}};
testGetCmdLineOptsMongod({replSet: "mycmdlinename"}, expectedResult);
jsTest.log("Testing \"replication.replSetName\" config file option");
expectedResult = {
"parsed": {
"config": "jstests/libs/config_files/set_replsetname.json",
"replication": {"replSetName": "myconfigname"}
}
};
testGetCmdLineOptsMongod({config: "jstests/libs/config_files/set_replsetname.json"},
expectedResult);
jsTest.log("Testing override of \"replication.replSetName\" config file option with \"replSet\"");
expectedResult = {
"parsed": {
"config": "jstests/libs/config_files/set_replsetname.json",
"replication": {"replSet": "mycmdlinename"}
}
};
testGetCmdLineOptsMongod(
{config: "jstests/libs/config_files/set_replsetname.json", replSet: "mycmdlinename"},
expectedResult);
print(baseName + " succeeded.");