summaryrefslogtreecommitdiff
path: root/jstests/auth/copyauth_between_shards.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/auth/copyauth_between_shards.js')
-rw-r--r--jstests/auth/copyauth_between_shards.js26
1 files changed, 15 insertions, 11 deletions
diff --git a/jstests/auth/copyauth_between_shards.js b/jstests/auth/copyauth_between_shards.js
index cd95c9e1508..219d38c7f0f 100644
--- a/jstests/auth/copyauth_between_shards.js
+++ b/jstests/auth/copyauth_between_shards.js
@@ -4,9 +4,11 @@
var baseName = "jstests_clone_copyauth_between_shards";
function copydbWithinShardedCluster(useReplSets, passCredentials, useAuth) {
- var clusterConfig = {shards : 1,
- mongos : 1,
- config : 1 };
+ var clusterConfig = {
+ shards: 1,
+ mongos: 1,
+ config: 1
+ };
if (useAuth) {
clusterConfig.auth = "";
@@ -25,7 +27,9 @@ function copydbWithinShardedCluster(useReplSets, passCredentials, useAuth) {
if (useAuth) {
mongos.getDB("admin").createUser({user: "super", pwd: "super", roles: ["root"]});
- assert.throws(function() { mongos.getDB("test1")["test1"].findOne(); });
+ assert.throws(function() {
+ mongos.getDB("test1")["test1"].findOne();
+ });
mongos.getDB("admin").auth("super", "super");
}
@@ -36,9 +40,9 @@ function copydbWithinShardedCluster(useReplSets, passCredentials, useAuth) {
// The copyDatabase command acts differently depending on whether we pass username and password
if (passCredentials) {
- var result = mongos.getDB('admin').copyDatabase('test1', 'test2', undefined, "super", "super");
- }
- else {
+ var result =
+ mongos.getDB('admin').copyDatabase('test1', 'test2', undefined, "super", "super");
+ } else {
var result = mongos.getDB('admin').copyDatabase('test1', 'test2');
}
printjson(result);
@@ -49,10 +53,10 @@ function copydbWithinShardedCluster(useReplSets, passCredentials, useAuth) {
}
// SERVER-13080
-//copydbWithinShardedCluster(true, true, true);
-//copydbWithinShardedCluster(false, true, true);
-//copydbWithinShardedCluster(true, false, true);
-//copydbWithinShardedCluster(false, false, true);
+// copydbWithinShardedCluster(true, true, true);
+// copydbWithinShardedCluster(false, true, true);
+// copydbWithinShardedCluster(true, false, true);
+// copydbWithinShardedCluster(false, false, true);
copydbWithinShardedCluster(true, false, false);
copydbWithinShardedCluster(false, false, false);