summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/bind_localhost.js
blob: 959c4b705416dfd9b724e0ad3a431a280ac98d10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 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);
}());