diff options
Diffstat (limited to 'jstests/auth/commands_builtin_roles.js')
-rw-r--r-- | jstests/auth/commands_builtin_roles.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/jstests/auth/commands_builtin_roles.js b/jstests/auth/commands_builtin_roles.js index 32674cd8a41..0c87ea82763 100644 --- a/jstests/auth/commands_builtin_roles.js +++ b/jstests/auth/commands_builtin_roles.js @@ -58,15 +58,16 @@ function testProperAuthorization(conn, t, testcase, r) { assert(r.db.auth("user|" + r.key, "password")); authCommandsLib.authenticatedSetup(t, runOnDb); var command = t.command; - if (typeof(command) === "function") { + if (typeof (command) === "function") { command = t.command(state, testcase.commandArgs); } var res = runOnDb.runCommand(command); if (testcase.roles[r.key]) { if (res.ok == 0 && res.code == authErrCode) { - out = "expected authorization success" + " but received " + tojson(res) + " on db " + - testcase.runOnDb + " with role " + r.key; + out = "expected authorization success" + + " but received " + tojson(res) + " on db " + testcase.runOnDb + " with role " + + r.key; } else if (res.ok == 0 && !testcase.expectFail && res.code != commandNotSupportedCode) { // don't error if the test failed with code commandNotSupported since // some storage engines (e.g wiredTiger) don't support some commands (e.g. touch) @@ -75,8 +76,9 @@ function testProperAuthorization(conn, t, testcase, r) { } } else { if (res.ok == 1 || (res.ok == 0 && res.code != authErrCode)) { - out = "expected authorization failure" + " but received result " + tojson(res) + - " on db " + testcase.runOnDb + " with role " + r.key; + out = "expected authorization failure" + + " but received result " + tojson(res) + " on db " + testcase.runOnDb + + " with role " + r.key; } } |