summaryrefslogtreecommitdiff
path: root/jstests/tool
diff options
context:
space:
mode:
authorAmalia Hawkins <amalia.hawkins@10gen.com>2014-04-21 18:43:25 -0400
committerAmalia Hawkins <amalia.hawkins@10gen.com>2014-05-22 20:29:39 -0400
commit1b4b52a9d413e145478a303b63ab760894938c80 (patch)
tree3286cdd06d688d4345a80215f84b4674a398b753 /jstests/tool
parent7a85cae38fba537980d6c9fc573ef077fd2df74e (diff)
downloadmongo-1b4b52a9d413e145478a303b63ab760894938c80.tar.gz
SERVER-12621 narrow the localhost exception when auth is enabled
Diffstat (limited to 'jstests/tool')
-rw-r--r--jstests/tool/dumpauth.js7
-rw-r--r--jstests/tool/stat1.js6
2 files changed, 3 insertions, 10 deletions
diff --git a/jstests/tool/dumpauth.js b/jstests/tool/dumpauth.js
index 2fcd32a9157..7ae165f5ce1 100644
--- a/jstests/tool/dumpauth.js
+++ b/jstests/tool/dumpauth.js
@@ -6,6 +6,9 @@ baseName = "tool_dumpauth";
m = startMongod( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
db = m.getDB( "admin" );
+db.createUser({user: "testuser" , pwd: "testuser", roles: jsTest.adminUserRoles});
+assert( db.auth( "testuser" , "testuser" ) , "auth failed" );
+
t = db[ baseName ];
t.drop();
@@ -13,10 +16,6 @@ for(var i = 0; i < 100; i++) {
t["testcol"].save({ "x": i });
}
-db.createUser({user: "testuser" , pwd: "testuser", roles: jsTest.adminUserRoles});
-
-assert( db.auth( "testuser" , "testuser" ) , "auth failed" );
-
x = runMongoProgram( "mongodump",
"--db", baseName,
"--authenticationDatabase=admin",
diff --git a/jstests/tool/stat1.js b/jstests/tool/stat1.js
index 96211f7d3f2..4c6d718a522 100644
--- a/jstests/tool/stat1.js
+++ b/jstests/tool/stat1.js
@@ -6,13 +6,7 @@ baseName = "tool_stat1";
m = startMongod( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
db = m.getDB( "admin" );
-t = db[ baseName ];
-t.drop();
-
-db.dropAllUsers();
-
db.createUser({user: "eliot" , pwd: "eliot", roles: jsTest.adminUserRoles});
-
assert( db.auth( "eliot" , "eliot" ) , "auth failed" );
x = runMongoProgram( "mongostat", "--host", "127.0.0.1:"+port, "--username", "eliot", "--password", "eliot", "--rowcount", "1" );