diff options
Diffstat (limited to 'jstests/sharding/auth_repl.js')
-rw-r--r-- | jstests/sharding/auth_repl.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/jstests/sharding/auth_repl.js b/jstests/sharding/auth_repl.js index cd89c91f136..b806090fc3a 100644 --- a/jstests/sharding/auth_repl.js +++ b/jstests/sharding/auth_repl.js @@ -19,7 +19,7 @@ var testColl = testDB.user; // before setting up authentication assert.commandWorked(adminDB.runCommand({replSetGetStatus: 1})); -conn.setSlaveOk(); +conn.setSecondaryOk(); assert.commandWorked(adminDB.runCommand({replSetGetStatus: 1})); // Add admin user using direct connection to primary to simulate connection from remote host @@ -38,19 +38,19 @@ assert.eq(1, testDB.auth('a', 'a')); jsTest.log('Sending an authorized query that should be ok'); assert.commandWorked(testColl.insert({x: 1}, {writeConcern: {w: nodeCount}})); -conn.setSlaveOk(true); +conn.setSecondaryOk(); doc = testColl.findOne(); assert(doc != null); doc = testColl.find().readPref('secondary').next(); assert(doc != null); -conn.setSlaveOk(false); +conn.setSecondaryOk(false); doc = testColl.findOne(); assert(doc != null); var queryToPriShouldFail = function() { - conn.setSlaveOk(false); + conn.setSecondaryOk(false); assert.throws(function() { testColl.findOne(); @@ -63,7 +63,7 @@ var queryToPriShouldFail = function() { }; var queryToSecShouldFail = function() { - conn.setSlaveOk(true); + conn.setSecondaryOk(); assert.throws(function() { testColl.findOne(); @@ -104,7 +104,7 @@ queryToPriShouldFail(); assert.eq(1, testDB.auth('a', 'a')); // Find out the current cached secondary in the repl connection -conn.setSlaveOk(true); +conn.setSecondaryOk(); var serverInfo = testColl.find().readPref('secondary').explain().serverInfo; var secNodeIdx = -1; var secPortStr = serverInfo.port.toString(); |