blob: 7e803ea49bed05041207c9574eb6d61e6b6b1870 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Test that setting readOnly mode on the command line causes readOnly to be properly set in both
// isMaster and serverStatus output.
(function() {
"use strict";
// TODO: use configured storageEngine from testData once wiredTiger supports readOnly mode.
var mongod = MongoRunner.runMongod({storageEngine: "mmapv1"});
var dbpath = mongod.dbpath;
// ensure dbpath gets set up.
assert.writeOK(mongod.getDB("foo").x.insert({x: 1}));
assert(!mongod.getDB("admin").isMaster().readOnly);
assert(!mongod.getDB("admin").serverStatus().storageEngine.readOnly);
MongoRunner.stopMongod(mongod);
mongod = MongoRunner.runMongod(
{storageEngine: "mmapv1", queryableBackupMode: "", dbpath: dbpath, noCleanData: true});
assert(mongod.getDB("admin").isMaster().readOnly);
assert(mongod.getDB("admin").serverStatus().storageEngine.readOnly);
MongoRunner.stopMongod(mongod);
}());
|