summaryrefslogtreecommitdiff
path: root/jstests/sharding/ismaster.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/ismaster.js')
-rw-r--r--jstests/sharding/ismaster.js37
1 files changed, 24 insertions, 13 deletions
diff --git a/jstests/sharding/ismaster.js b/jstests/sharding/ismaster.js
index 3f6005c4807..b3500cf6009 100644
--- a/jstests/sharding/ismaster.js
+++ b/jstests/sharding/ismaster.js
@@ -1,27 +1,38 @@
-var st = new ShardingTest({shards:1, mongos:1});
+var st = new ShardingTest({shards: 1, mongos: 1});
var res = st.s0.getDB("admin").runCommand("ismaster");
// check that the fields that should be there are there and have proper values
-assert( res.maxBsonObjectSize &&
- isNumber(res.maxBsonObjectSize) &&
- res.maxBsonObjectSize > 0, "maxBsonObjectSize possibly missing:" + tojson(res));
-assert( res.maxMessageSizeBytes &&
- isNumber(res.maxMessageSizeBytes) &&
- res.maxBsonObjectSize > 0, "maxMessageSizeBytes possibly missing:" + tojson(res));
+assert(res.maxBsonObjectSize && isNumber(res.maxBsonObjectSize) && res.maxBsonObjectSize > 0,
+ "maxBsonObjectSize possibly missing:" + tojson(res));
+assert(res.maxMessageSizeBytes && isNumber(res.maxMessageSizeBytes) && res.maxBsonObjectSize > 0,
+ "maxMessageSizeBytes possibly missing:" + tojson(res));
assert(res.ismaster, "ismaster missing or false:" + tojson(res));
assert(res.localTime, "localTime possibly missing:" + tojson(res));
assert(res.msg && res.msg == "isdbgrid", "msg possibly missing or wrong:" + tojson(res));
-var unwantedFields = ["setName", "setVersion", "secondary", "hosts", "passives", "arbiters",
- "primary", "aribterOnly", "passive", "slaveDelay", "hidden", "tags",
- "buildIndexes", "me"];
+var unwantedFields = [
+ "setName",
+ "setVersion",
+ "secondary",
+ "hosts",
+ "passives",
+ "arbiters",
+ "primary",
+ "aribterOnly",
+ "passive",
+ "slaveDelay",
+ "hidden",
+ "tags",
+ "buildIndexes",
+ "me"
+];
// check that the fields that shouldn't be there are not there
var badFields = [];
for (field in res) {
- if (!res.hasOwnProperty(field)){
+ if (!res.hasOwnProperty(field)) {
continue;
}
if (Array.contains(unwantedFields, field)) {
badFields.push(field);
}
}
-assert(badFields.length === 0, "\nthe result:\n" + tojson(res)
- + "\ncontained fields it shouldn't have: " + badFields);
+assert(badFields.length === 0,
+ "\nthe result:\n" + tojson(res) + "\ncontained fields it shouldn't have: " + badFields);