summaryrefslogtreecommitdiff
path: root/jstests/httpinterface/httpinterface.js
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2015-10-13 16:55:41 -0400
committerCharlie Swanson <charlie.swanson@mongodb.com>2015-10-13 18:12:11 -0400
commitb3b1be01f9c8f2f6a9e303602fb070aa854f5cf3 (patch)
tree0fdb684dea28d2186eacc7d2df5cc42dbe21521c /jstests/httpinterface/httpinterface.js
parentfa0ea5f7e932f11dfefa24691b47c3d4a7230c71 (diff)
downloadmongo-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.js24
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);