diff options
-rw-r--r-- | jstests/slowNightly/server7428.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/slowNightly/server7428.js b/jstests/slowNightly/server7428.js new file mode 100644 index 00000000000..6a27e102367 --- /dev/null +++ b/jstests/slowNightly/server7428.js @@ -0,0 +1,16 @@ +// Regression test for SERVER-7428. +// +// Verify that the copyDatabase command works appropriately when the +// target mongo instance has authentication enabled. + +// Setup fromDb with no auth +var fromDb = MongoRunner.runMongod({ port: 29000 }); + +// Setup toDb with auth +var toDb = MongoRunner.runMongod({auth : "", port : 31001}); +var admin = toDb.getDB("admin"); +admin.addUser("foo","bar"); +admin.auth("foo","bar"); + +admin.copyDatabase('test', 'test', fromDb.host) + |