summaryrefslogtreecommitdiff
path: root/jstests/auth/validate_sasl_mechanism.js
blob: cae29ae83b02ea2d2fb682f1dc412c9580eeb995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Test for invalid sasl auth mechanisms

(function() {
'use strict';

function waitFailedToStart(pid, exitCode) {
    assert.soon(function() {
        const res = checkProgram(pid);
        if (res.alive) {
            return false;
        }

        return res.exitCode == exitCode;
    }, `Failed to wait for ${pid} to die with exit code ${exitCode}`, 30 * 1000);
}

const m = MongoRunner.runMongod({
    setParameter: "authenticationMechanisms=SCRAM-SHA-1,foo",
    waitForConnect: false,
});

waitFailedToStart(m.pid, 2);
})();