summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/bind_ip_all.js
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2018-09-12 18:27:59 +0000
committerSara Golemon <sara.golemon@mongodb.com>2018-09-17 17:38:36 +0000
commit5c71b34bbe40040272f1174508366ff8a5668cbc (patch)
treea0e8a79d4676ab3ba1e01bfed5238e42bd9179ee /jstests/noPassthrough/bind_ip_all.js
parent9011c8cff2985a1f60d558f62fe0d712b48b9b99 (diff)
downloadmongo-5c71b34bbe40040272f1174508366ff8a5668cbc.tar.gz
SERVER-36572 Canonicalize bindIpAll to bindIp=='*'
Diffstat (limited to 'jstests/noPassthrough/bind_ip_all.js')
-rw-r--r--jstests/noPassthrough/bind_ip_all.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/jstests/noPassthrough/bind_ip_all.js b/jstests/noPassthrough/bind_ip_all.js
new file mode 100644
index 00000000000..e840cb2e404
--- /dev/null
+++ b/jstests/noPassthrough/bind_ip_all.js
@@ -0,0 +1,23 @@
+// Startup with --bind_ip_all should override net.bindIp and vice versa.
+
+(function() {
+ 'use strict';
+
+ const port = allocatePort();
+ const BINDIP = 'jstests/noPassthrough/libs/net.bindIp_localhost.yaml';
+ const BINDIPALL = 'jstests/noPassthrough/libs/net.bindIpAll.yaml';
+
+ function runTest(config, opt, expectStar, expectLocalhost) {
+ clearRawMongoProgramOutput();
+ const mongod =
+ runMongoProgram('./mongod', '--port', port, '--config', config, opt, '--outputConfig');
+ assert.eq(mongod, 0);
+ const output = rawMongoProgramOutput();
+ assert.eq(output.search(/bindIp: "\*"/) >= 0, expectStar, output);
+ assert.eq(output.search(/bindIp: localhost/) >= 0, expectLocalhost, output);
+ assert.eq(output.search(/bindIpAll:/) >= 0, false, output);
+ }
+
+ runTest(BINDIP, '--bind_ip_all', true, false);
+ runTest(BINDIPALL, '--bind_ip=localhost', false, true);
+}());