diff options
Diffstat (limited to 'jstests/replsets/auth_no_pri.js')
-rw-r--r-- | jstests/replsets/auth_no_pri.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/jstests/replsets/auth_no_pri.js b/jstests/replsets/auth_no_pri.js index 59eefa52f52..cce4e8020d6 100644 --- a/jstests/replsets/auth_no_pri.js +++ b/jstests/replsets/auth_no_pri.js @@ -1,5 +1,7 @@ // Test that you can still authenticate a replset connection to a RS with no primary (SERVER-6665). (function () { +'use strict'; + var NODE_COUNT = 3; var rs = new ReplSetTest({"nodes" : NODE_COUNT, keyFile : "jstests/libs/key1"}); var nodes = rs.startSet(); @@ -17,7 +19,7 @@ assert.writeOK(conn.getDB('admin').foo.insert({a:1}, { writeConcern: { w: NODE_C // Make sure there is no primary rs.stop(0); rs.stop(1); -rs.waitForState(nodes[2], rs.SECONDARY); +rs.waitForState(nodes[2], ReplSetTest.State.SECONDARY); // Make sure you can still authenticate a replset connection with no primary var conn2 = new Mongo(rs.getURL()); @@ -26,4 +28,5 @@ assert(conn2.getDB('admin').auth({user:'admin', pwd:'pwd', mechanism:"SCRAM-SHA- assert.eq(1, conn2.getDB('admin').foo.findOne().a); rs.stopSet(); + }()); |