Browse files

SERVER-579 when target is running with security as well

  • Loading branch information...
1 parent 714b242 commit b92ecb5690780c0b32ad05a0089c8e54ec01af1b @astaple astaple committed Feb 16, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 jstests/auth/copyauth.js
View
12 jstests/auth/copyauth.js
@@ -15,3 +15,15 @@ assert.throws( function() { source.getDB( baseName )[ baseName ].findOne(); } );
target.getDB( baseName ).copyDatabase( baseName, baseName, source.host, "foo", "bar" );
assert.eq( 1, target.getDB( baseName )[ baseName ].count() );
assert.eq( 1, target.getDB( baseName )[ baseName ].findOne().i );
+
+stopMongod( ports[ 1 ] );
+
+var target = startMongod( "--auth", "--port", ports[ 1 ], "--dbpath", "/data/db/" + baseName + "_target", "--nohttpinterface", "--bind_ip", "127.0.0.1", "--smallfiles" );
+
+target.getDB( "admin" ).addUser( "super1", "super1" );
+assert.throws( function() { source.getDB( baseName )[ baseName ].findOne(); } );
+target.getDB( "admin" ).auth( "super1", "super1" );
+
+target.getDB( baseName ).copyDatabase( baseName, baseName, source.host, "foo", "bar" );
+assert.eq( 1, target.getDB( baseName )[ baseName ].count() );
+assert.eq( 1, target.getDB( baseName )[ baseName ].findOne().i );

0 comments on commit b92ecb5

Please sign in to comment.