diff options
author | alabid <alabidan@gmail.com> | 2015-01-12 09:32:50 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2015-01-15 10:33:42 -0500 |
commit | 9c0417f6680b591cb89d0de55a8a42ab179698fd (patch) | |
tree | 533e19ffd0cbfc2fe34e08f3b616fe0978b19125 /jstests/auth | |
parent | 8efb43a8e1f5e9c025758a9322121223fd300892 (diff) | |
download | mongo-9c0417f6680b591cb89d0de55a8a42ab179698fd.tar.gz |
SERVER-16797 Remove support for touch command in WiredTiger storage engine.
Closes #906
Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/commands_builtin_roles.js | 4 | ||||
-rw-r--r-- | jstests/auth/commands_user_defined_roles.js | 12 | ||||
-rw-r--r-- | jstests/auth/lib/commands_lib.js | 1 |
3 files changed, 11 insertions, 6 deletions
diff --git a/jstests/auth/commands_builtin_roles.js b/jstests/auth/commands_builtin_roles.js index b1d4d84f76a..733600e521b 100644 --- a/jstests/auth/commands_builtin_roles.js +++ b/jstests/auth/commands_builtin_roles.js @@ -56,7 +56,9 @@ function testProperAuthorization(conn, t, testcase, r) { " on db " + testcase.runOnDb + " with role " + r.key; } - else if (res.ok == 0 && !testcase.expectFail) { + 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) out = "command failed with " + tojson(res) + " on db " + testcase.runOnDb + " with role " + r.key; diff --git a/jstests/auth/commands_user_defined_roles.js b/jstests/auth/commands_user_defined_roles.js index 2aa340187d7..facf097ea61 100644 --- a/jstests/auth/commands_user_defined_roles.js +++ b/jstests/auth/commands_user_defined_roles.js @@ -33,16 +33,18 @@ function testProperAuthorization(conn, t, testcase) { var res = runOnDb.runCommand(t.command); - if (!testcase.expectFail && res.ok != 1) { + if (!testcase.expectFail && res.ok != 1 && 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) out = "command failed with " + tojson(res) + " on db " + testcase.runOnDb + " with privileges " + tojson(testcase.privileges); } else if (testcase.expectFail && res.code == authErrCode) { - out = "expected authorization success" + - " but received " + tojson(res) + - " on db " + testcase.runOnDb + - " with privileges " + tojson(testcase.privileges); + out = "expected authorization success" + + " but received " + tojson(res) + + " on db " + testcase.runOnDb + + " with privileges " + tojson(testcase.privileges); } firstDb.logout(); diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js index 2ef0ac2616c..c73439d2494 100644 --- a/jstests/auth/lib/commands_lib.js +++ b/jstests/auth/lib/commands_lib.js @@ -82,6 +82,7 @@ var firstDbName = "roles_commands_1"; var secondDbName = "roles_commands_2"; var adminDbName = "admin"; var authErrCode = 13; +var commandNotSupportedCode = 115; var shard0name = "shard0000"; // useful shorthand when defining the tests below |