SERVER-18276 Add test for auth enabled but no auth mechanisms. (#47695)
GitOrigin-RevId: 300dce415b7172a69c2b88906c8a25fbaea939d2
This commit is contained in:
parent
4a3836398f
commit
50b7cd3881
@ -1,10 +1,10 @@
|
||||
import {testGetCmdLineOptsMongod} from "jstests/libs/command_line/test_parsed_options.js";
|
||||
import {testGetCmdLineOptsMongodFailed} from "jstests/libs/command_line/test_parsed_options.js";
|
||||
|
||||
let baseName = "jstests_auth_auth_options";
|
||||
|
||||
jsTest.log('Testing "auth" command line option');
|
||||
let expectedResult = {"parsed": {"security": {"authorization": "enabled"}}};
|
||||
|
||||
testGetCmdLineOptsMongod({auth: ""}, expectedResult);
|
||||
|
||||
jsTest.log('Testing "noauth" command line option');
|
||||
@ -47,4 +47,8 @@ expectedResult = {
|
||||
};
|
||||
testGetCmdLineOptsMongod({config: "jstests/libs/config_files/disable_noauth.ini"}, expectedResult);
|
||||
|
||||
// Test that we exit when authentication is enabled, but no auth mechanisms are set. See SERVER-7942.
|
||||
jsTest.log("Testing authentication enabled, but no auth mechanisms set");
|
||||
testGetCmdLineOptsMongodFailed({config: "jstests/libs/config_files/auth_conflict.json"});
|
||||
|
||||
print(baseName + " succeeded.");
|
||||
|
||||
@ -3,3 +3,6 @@ filters:
|
||||
- "set_profiling*":
|
||||
approvers:
|
||||
- 10gen/query-integration-observability
|
||||
- "*auth*":
|
||||
approvers:
|
||||
- 10gen/server-security
|
||||
|
||||
6
jstests/libs/config_files/auth_conflict.json
Normal file
6
jstests/libs/config_files/auth_conflict.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"security" : {
|
||||
"authorization" : "enabled",
|
||||
"authenticationMechanisms" : [ ],
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user