summaryrefslogtreecommitdiff
path: root/jstests/tool/stat1.js
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2015-03-22 12:08:21 -0400
committerSpencer T Brody <spencer@mongodb.com>2015-04-06 18:19:21 -0400
commit6ccb82c987a47995fd7d8019d7fd4d1e557478b4 (patch)
tree2542816a69e9faaaff840754b42f0229dc905ccd /jstests/tool/stat1.js
parent7baac52f05a3e0cbdb7168e51836f507eda99dff (diff)
downloadmongo-6ccb82c987a47995fd7d8019d7fd4d1e557478b4.tar.gz
SERVER-17450 Standardize on a single way to start mongod in tests
Diffstat (limited to 'jstests/tool/stat1.js')
-rw-r--r--jstests/tool/stat1.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/jstests/tool/stat1.js b/jstests/tool/stat1.js
index 71ec776c170..0b5bf7f02b0 100644
--- a/jstests/tool/stat1.js
+++ b/jstests/tool/stat1.js
@@ -1,16 +1,15 @@
// stat1.js
// test mongostat with authentication SERVER-3875
-port = allocatePorts( 1 )[ 0 ];
baseName = "tool_stat1";
-m = startMongod( "--auth", "--port", port, "--dbpath", MongoRunner.dataPath + baseName, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
+var m = MongoRunner.runMongod({auth: "", bind_ip: "127.0.0.1"});
db = m.getDB( "admin" );
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", "--authenticationDatabase", "admin" );
+x = runMongoProgram( "mongostat", "--host", "127.0.0.1:"+m.port, "--username", "eliot", "--password", "eliot", "--rowcount", "1", "--authenticationDatabase", "admin" );
assert.eq(x, 0, "mongostat should exit successfully with eliot:eliot");
-x = runMongoProgram( "mongostat", "--host", "127.0.0.1:"+port, "--username", "eliot", "--password", "wrong", "--rowcount", "1", "--authenticationDatabase", "admin" );
+x = runMongoProgram( "mongostat", "--host", "127.0.0.1:"+m.port, "--username", "eliot", "--password", "wrong", "--rowcount", "1", "--authenticationDatabase", "admin" );
assert.neq(x, 0, "mongostat should exit with -1 with eliot:wrong");