diff options
author | Spencer T Brody <spencer@10gen.com> | 2013-06-10 13:16:06 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2013-06-10 14:23:06 -0400 |
commit | 64a1136d69b700d9e7e40e7fd8c43f9a8108ac76 (patch) | |
tree | 1885666b2843ec566d43ecf974d2e5efa58712d9 /jstests/repl | |
parent | 8ff5aecd2c0c606feefa39f0f8bd5e84c2c57bba (diff) | |
download | mongo-64a1136d69b700d9e7e40e7fd8c43f9a8108ac76.tar.gz |
SERVER-9846 Make master/slave auth test use keyFile
Diffstat (limited to 'jstests/repl')
-rw-r--r-- | jstests/repl/repl_auth.js | 9 |
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} ) ); |