summaryrefslogtreecommitdiff
path: root/jstests/sharding/ismaster.js
diff options
context:
space:
mode:
authorPavi Vetriselvan <pvselvan@umich.edu>2020-05-06 11:25:31 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-26 18:09:44 +0000
commit545ea895bfd90ea274a2b8da34c4534d6dc9c0af (patch)
treec85b7f56ec812fdb2d60486b67f57e1c3acc6dd3 /jstests/sharding/ismaster.js
parentba7d21608131d8236f2c2b66a93c9d6311f8506c (diff)
downloadmongo-545ea895bfd90ea274a2b8da34c4534d6dc9c0af.tar.gz
SERVER-47798 ismaster.js tests should ensure ismaster field is a boolean
(cherry picked from commit d5d0401e518beab5b659c1a01a092286f8a9c792) (cherry picked from commit 9c1ce38d7c87f625be1c2d5d7f5a6b709ebfb72e)
Diffstat (limited to 'jstests/sharding/ismaster.js')
-rw-r--r--jstests/sharding/ismaster.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/jstests/sharding/ismaster.js b/jstests/sharding/ismaster.js
index 47dff297e96..2d5cea7b586 100644
--- a/jstests/sharding/ismaster.js
+++ b/jstests/sharding/ismaster.js
@@ -1,3 +1,4 @@
+"use strict";
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
@@ -5,7 +6,8 @@ assert(res.maxBsonObjectSize && isNumber(res.maxBsonObjectSize) && res.maxBsonOb
"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.eq("boolean", typeof res.ismaster, "ismaster field is not a boolean" + tojson(res));
+assert(res.ismaster === true, "ismaster field is 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 = [
@@ -26,6 +28,7 @@ var unwantedFields = [
];
// check that the fields that shouldn't be there are not there
var badFields = [];
+var field;
for (field in res) {
if (!res.hasOwnProperty(field)) {
continue;