diff options
| author | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-10-13 16:55:41 -0400 |
|---|---|---|
| committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-10-13 18:12:11 -0400 |
| commit | b3b1be01f9c8f2f6a9e303602fb070aa854f5cf3 (patch) | |
| tree | 0fdb684dea28d2186eacc7d2df5cc42dbe21521c /jstests/httpinterface/httpinterface.js | |
| parent | fa0ea5f7e932f11dfefa24691b47c3d4a7230c71 (diff) | |
| download | mongo-b3b1be01f9c8f2f6a9e303602fb070aa854f5cf3.tar.gz | |
SERVER-20414 Move httpinterface tests into their own suite
Diffstat (limited to 'jstests/httpinterface/httpinterface.js')
| -rw-r--r-- | jstests/httpinterface/httpinterface.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/jstests/httpinterface/httpinterface.js b/jstests/httpinterface/httpinterface.js new file mode 100644 index 00000000000..d3804cc40f1 --- /dev/null +++ b/jstests/httpinterface/httpinterface.js @@ -0,0 +1,24 @@ +// SERVER-9137 test that the httpinterface parameter enables the web interface +var conn = MongoRunner.runMongod({smallfiles: ""}); +var httpPort = conn.port + 1000; + +tryHttp = function() { + try { + var mongo = new Mongo('localhost:' + httpPort) ; + } + catch (e) { + return false; + } + // if we managed to start and connect a new mongo then the web interface is working + return true; +} + +assert.throws(function() {assert.soon(tryHttp, "tryHttp failed, like we expected it to")}); + +MongoRunner.stopMongod(conn); + +conn = MongoRunner.runMongod({port: conn.port, smallfiles: "", httpinterface: ""}); +assert.soon(tryHttp, + "the web interface should be running on " + httpPort); + +MongoRunner.stopMongod(conn); |
