1
// Regression test for SERVER-7428.
3
// Verify that the copyDatabase command works appropriately when the
4
// target mongo instance has authentication enabled.
6
// Setup fromDb with no auth
7
var fromDb = MongoRunner.runMongod({ port: 29000 });
9
// Setup toDb with auth
10
var toDb = MongoRunner.runMongod({auth : "", port : 31001});
11
var admin = toDb.getDB("admin");
12
admin.addUser("foo","bar");
13
admin.auth("foo","bar");
15
admin.copyDatabase('test', 'test', fromDb.host)