0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/noPassthrough/bind_localhost.js
2019-07-27 11:02:23 -04:00

16 lines
475 B
JavaScript

// Log bound addresses at startup.
(function() {
'use strict';
const mongo = MongoRunner.runMongod({ipv6: '', bind_ip: 'localhost', useLogFiles: true});
assert.neq(mongo, null, "Database is not running");
const log = cat(mongo.fullOptions.logFile);
print(log);
assert(log.includes('Listening on 127.0.0.1'), "Not listening on AF_INET");
if (!_isWindows()) {
assert(log.match(/Listening on .*\.sock/), "Not listening on AF_UNIX");
}
MongoRunner.stopMongod(mongo);
}());