summaryrefslogtreecommitdiff
path: root/jstests/repl
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2013-06-10 13:16:06 -0400
committerSpencer T Brody <spencer@10gen.com>2013-06-10 14:23:06 -0400
commit64a1136d69b700d9e7e40e7fd8c43f9a8108ac76 (patch)
tree1885666b2843ec566d43ecf974d2e5efa58712d9 /jstests/repl
parent8ff5aecd2c0c606feefa39f0f8bd5e84c2c57bba (diff)
downloadmongo-64a1136d69b700d9e7e40e7fd8c43f9a8108ac76.tar.gz
SERVER-9846 Make master/slave auth test use keyFile
Diffstat (limited to 'jstests/repl')
-rw-r--r--jstests/repl/repl_auth.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/jstests/repl/repl_auth.js b/jstests/repl/repl_auth.js
index c914fdfd4a5..8c3318373ec 100644
--- a/jstests/repl/repl_auth.js
+++ b/jstests/repl/repl_auth.js
@@ -1,11 +1,10 @@
// Test repl with auth enabled
var baseName = "jstests_repl11test";
+var keyFilePath = "jstests/libs/key1";
setAdmin = function( n ) {
n.getDB( "admin" ).addUser( "super", "super", false, 3 );
- n.getDB( "local" ).addUser( "repl", "foo" );
- n.getDB( "local" ).system.users.findOne();
}
auth = function( n ) {
@@ -25,10 +24,10 @@ doTest = function(signal, extraOpts) {
setAdmin( s );
rt.stop( false );
- m = rt.start( true, { auth:null }, true );
+ m = rt.start( true, { auth:null, keyFile: keyFilePath }, true );
auth( m );
- var slaveOpt = { auth: null };
+ var slaveOpt = { auth: null, keyFile: keyFilePath };
slaveOpt = Object.extend(slaveOpt, extraOpts);
s = rt.start( false, slaveOpt, true );
@@ -39,7 +38,7 @@ doTest = function(signal, extraOpts) {
sa = s.getDB( baseName ).a;
assert.soon( function() { return 1 == sa.count(); } );
- s.getDB( "local" ).auth( "repl", "foo" );
+ s.getDB( "admin" ).auth( "super", "super" );
assert.commandWorked( s.getDB( "admin" )._adminCommand( {serverStatus:1,repl:1} ) );
assert.commandWorked( s.getDB( "admin" )._adminCommand( {serverStatus:1,repl:2} ) );