summaryrefslogtreecommitdiff
path: root/jstests/auth/repl.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/auth/repl.js')
-rw-r--r--jstests/auth/repl.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/jstests/auth/repl.js b/jstests/auth/repl.js
index 3dfd01df6f5..25129cfd821 100644
--- a/jstests/auth/repl.js
+++ b/jstests/auth/repl.js
@@ -183,7 +183,7 @@ jsTest.log("1 test replica sets");
var rs = new ReplSetTest({name: rsName, nodes: 2});
var nodes = rs.startSet(mongoOptions);
rs.initiate();
-rs.awaitReplication();
+authutil.asCluster(nodes, "jstests/libs/key1", function() { rs.awaitReplication(); });
var primary = rs.getPrimary();
var secondary = rs.getSecondary();
@@ -200,7 +200,7 @@ jsTest.log("2 test initial sync");
rs = new ReplSetTest({name: rsName, nodes: 1, nodeOptions: mongoOptions});
nodes = rs.startSet();
rs.initiate();
-rs.awaitReplication();
+authutil.asCluster(nodes, "jstests/libs/key1", function() { rs.awaitReplication(); });
primary = rs.getPrimary();
@@ -235,6 +235,9 @@ master = rt.start(true, mongoOptions, true);
slave = rt.start(false, mongoOptions, true);
var masterDB = master.getDB("admin");
+masterDB.createUser({user: "root", pwd: "pass", roles: ["root"]});
+masterDB.auth("root", "pass");
+
// ensure that master/slave replication is up and running
masterDB.foo.save({}, { writeConcern: { w: 2, wtimeout: 5000 }});
masterDB.foo.drop();