diff options
Diffstat (limited to 'jstests/noPassthrough/hostname_bind_ips.js')
-rw-r--r-- | jstests/noPassthrough/hostname_bind_ips.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/jstests/noPassthrough/hostname_bind_ips.js b/jstests/noPassthrough/hostname_bind_ips.js index d7d87e99ec5..1de16bde73e 100644 --- a/jstests/noPassthrough/hostname_bind_ips.js +++ b/jstests/noPassthrough/hostname_bind_ips.js @@ -2,20 +2,20 @@ // binding to localhost and enabling IPv6. (function() { - 'use strict'; +'use strict'; - const proc = MongoRunner.runMongod({bind_ip: "localhost", "ipv6": ""}); - assert.neq(proc, null); +const proc = MongoRunner.runMongod({bind_ip: "localhost", "ipv6": ""}); +assert.neq(proc, null); - assert.soon(function() { - try { - const uri = 'mongodb://127.0.0.1:' + proc.port + '/test'; - const conn = new Mongo(uri); - assert.commandWorked(conn.adminCommand({ping: 1})); - return true; - } catch (e) { - return false; - } - }, "Cannot connect to 127.0.0.1 when bound to localhost", 30 * 1000); - MongoRunner.stopMongod(proc); +assert.soon(function() { + try { + const uri = 'mongodb://127.0.0.1:' + proc.port + '/test'; + const conn = new Mongo(uri); + assert.commandWorked(conn.adminCommand({ping: 1})); + return true; + } catch (e) { + return false; + } +}, "Cannot connect to 127.0.0.1 when bound to localhost", 30 * 1000); +MongoRunner.stopMongod(proc); })(); |