2017-06-02 21:29:32 +02:00
|
|
|
// Tests the internalValidateFeaturesAsMaster server parameter.
|
2016-10-07 22:01:03 +02:00
|
|
|
|
|
|
|
(function() {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
load("jstests/libs/get_index_helpers.js");
|
|
|
|
|
|
|
|
// internalValidateFeaturesAsMaster can be set via startup parameter.
|
|
|
|
let conn = MongoRunner.runMongod({setParameter: "internalValidateFeaturesAsMaster=1"});
|
|
|
|
assert.neq(null, conn, "mongod was unable to start up");
|
|
|
|
let res = conn.adminCommand({getParameter: 1, internalValidateFeaturesAsMaster: 1});
|
|
|
|
assert.commandWorked(res);
|
|
|
|
assert.eq(res.internalValidateFeaturesAsMaster, true);
|
|
|
|
MongoRunner.stopMongod(conn);
|
|
|
|
|
2018-03-13 20:26:04 +01:00
|
|
|
// internalValidateFeaturesAsMaster cannot be set with --replSet.
|
2016-10-07 22:01:03 +02:00
|
|
|
conn = MongoRunner.runMongod(
|
|
|
|
{replSet: "replSetName", setParameter: "internalValidateFeaturesAsMaster=0"});
|
|
|
|
assert.eq(null, conn, "mongod was unexpectedly able to start up");
|
|
|
|
|
|
|
|
conn = MongoRunner.runMongod(
|
|
|
|
{replSet: "replSetName", setParameter: "internalValidateFeaturesAsMaster=1"});
|
|
|
|
assert.eq(null, conn, "mongod was unexpectedly able to start up");
|
|
|
|
|
|
|
|
// internalValidateFeaturesAsMaster cannot be set via runtime parameter.
|
|
|
|
conn = MongoRunner.runMongod({});
|
|
|
|
assert.commandFailed(
|
|
|
|
conn.adminCommand({setParameter: 1, internalValidateFeaturesAsMaster: true}));
|
|
|
|
assert.commandFailed(
|
|
|
|
conn.adminCommand({setParameter: 1, internalValidateFeaturesAsMaster: false}));
|
|
|
|
MongoRunner.stopMongod(conn);
|
|
|
|
}());
|