diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2017-06-20 16:47:21 -0400 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2017-06-22 13:17:27 -0400 |
commit | e648b2bda5f48256b7cb330806f0456b02b94abc (patch) | |
tree | ce64f7c2c7a42970c0e2108fae34dd1dc1231cb9 /jstests/noPassthrough/hostname_bind_ips.js | |
parent | dba32749903786dce9ab45b7aaf6ae0fffef0501 (diff) | |
download | mongo-e648b2bda5f48256b7cb330806f0456b02b94abc.tar.gz |
SERVER-29755 Fix hostname bind_ip values
Diffstat (limited to 'jstests/noPassthrough/hostname_bind_ips.js')
-rw-r--r-- | jstests/noPassthrough/hostname_bind_ips.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/noPassthrough/hostname_bind_ips.js b/jstests/noPassthrough/hostname_bind_ips.js new file mode 100644 index 00000000000..295d10db4ce --- /dev/null +++ b/jstests/noPassthrough/hostname_bind_ips.js @@ -0,0 +1,16 @@ +(function() { + 'use strict'; + + var proc = MongoRunner.runMongod({bind_ip: "localhost,::1", "ipv6": "", waitForConnect: false}); + assert.neq(proc, null); + + assert.soon(function() { + try { + var conn = new Mongo(`mongodb://127.0.0.1:${proc.port}/test?socketTimeoutMS=5000`); + assert.commandWorked(conn.adminCommand({ping: 1})); + } catch (e) { + return false; + } + return true; + }, "Cannot connect to 127.0.0.1 when bound to localhost", 20000); +})(); |