0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/noPassthroughWithMongod/server7428.js
Mathias Stearn d0a1e84ab2 SERVER-13391 Rename slowNightly -> noPassthroughWithMongod and slowWeekly -> noPassthrough
This better represents their purpose and the difference between them.
2014-03-27 17:35:16 -04:00

21 lines
666 B
JavaScript

// Regression test for SERVER-7428.
// TODO(spencer): move this test out of slowNightly directory once there is a better place for tests
// that start their own mongod's but aren't slow
// 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.createUser({user: "foo", pwd: "bar", roles: jsTest.adminUserRoles});
admin.auth("foo","bar");
admin.copyDatabase('test', 'test', fromDb.host)