summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2020-04-20 14:34:56 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-20 19:10:42 +0000
commit817a7f1951189b2a8c7c06fb5fb5361241c1cd57 (patch)
treeff2ddf6e93b91e7493259934c925dbb9f03e3f6d /jstests
parent06f26fac35c7a3b82effbb9815ad9f7aedaf4dfb (diff)
downloadmongo-817a7f1951189b2a8c7c06fb5fb5361241c1cd57.tar.gz
SERVER-47429 Validate authenticationMechanisms server parameter
Diffstat (limited to 'jstests')
-rw-r--r--jstests/auth/validate_sasl_mechanism.js23
1 files changed, 23 insertions, 0 deletions
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);
+})();