From 817a7f1951189b2a8c7c06fb5fb5361241c1cd57 Mon Sep 17 00:00:00 2001 From: Mark Benvenuto Date: Mon, 20 Apr 2020 14:34:56 -0400 Subject: SERVER-47429 Validate authenticationMechanisms server parameter --- jstests/auth/validate_sasl_mechanism.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 jstests/auth/validate_sasl_mechanism.js (limited to 'jstests') diff --git a/jstests/auth/validate_sasl_mechanism.js b/jstests/auth/validate_sasl_mechanism.js new file mode 100644 index 00000000000..cae29ae83b0 --- /dev/null +++ b/jstests/auth/validate_sasl_mechanism.js @@ -0,0 +1,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); +})(); -- cgit v1.2.1