diff options
Diffstat (limited to 'jstests/sharding/drop_configdb.js')
-rw-r--r-- | jstests/sharding/drop_configdb.js | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/jstests/sharding/drop_configdb.js b/jstests/sharding/drop_configdb.js index 8ac87648dfa..63a3b533597 100644 --- a/jstests/sharding/drop_configdb.js +++ b/jstests/sharding/drop_configdb.js @@ -1,35 +1,35 @@ // Test that dropping the config database is completely disabled via // mongos and via mongod, if started with --configsvr (function() { -"use strict"; + "use strict"; -var getConfigsvrToWriteTo = function(st) { - if (st.configRS) { - return st.configRS.getPrimary(); - } else { - return st._configServers[0]; - } -}; + var getConfigsvrToWriteTo = function(st) { + if (st.configRS) { + return st.configRS.getPrimary(); + } else { + return st._configServers[0]; + } + }; -var st = new ShardingTest({ shards : 2 }); -var mongos = st.s; -var config = getConfigsvrToWriteTo(st).getDB('config'); + var st = new ShardingTest({shards: 2}); + var mongos = st.s; + var config = getConfigsvrToWriteTo(st).getDB('config'); -// Try to drop config db via configsvr + // Try to drop config db via configsvr -print ( "1: Try to drop config database via configsvr" ); -assert.eq(0, config.dropDatabase().ok); -assert.eq("Cannot drop 'config' database if mongod started with --configsvr", - config.dropDatabase().errmsg); + print("1: Try to drop config database via configsvr"); + assert.eq(0, config.dropDatabase().ok); + assert.eq("Cannot drop 'config' database if mongod started with --configsvr", + config.dropDatabase().errmsg); -// Try to drop config db via mongos -var config = mongos.getDB( "config" ); + // Try to drop config db via mongos + var config = mongos.getDB("config"); -print ( "1: Try to drop config database via mongos" ); -assert.eq(0, config.dropDatabase().ok); + print("1: Try to drop config database via mongos"); + assert.eq(0, config.dropDatabase().ok); -// 20 = ErrorCodes::IllegalOperation -assert.eq(20, config.dropDatabase().code); + // 20 = ErrorCodes::IllegalOperation + assert.eq(20, config.dropDatabase().code); -st.stop(); + st.stop(); }());
\ No newline at end of file |