diff options
author | James Cohan <james.cohan@10gen.com> | 2015-07-27 11:28:46 -0400 |
---|---|---|
committer | James Cohan <james.cohan@10gen.com> | 2015-07-31 17:14:47 -0400 |
commit | 155ce241acc1c498978f12998bf00ea3183319f3 (patch) | |
tree | 669ad4c62b85c0e6b6d9897b9905f3ce3861fb2d /jstests/auth | |
parent | dcf14b7f5a4611590c6ccb34c4f67b84ab233f31 (diff) | |
download | mongo-155ce241acc1c498978f12998bf00ea3183319f3.tar.gz |
SERVER-19398 Reset db and collection names in authorization tests
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/commands_user_defined_roles.js | 14 | ||||
-rw-r--r-- | jstests/auth/lib/commands_lib.js | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/jstests/auth/commands_user_defined_roles.js b/jstests/auth/commands_user_defined_roles.js index 760dabaa6ea..3bcb8726072 100644 --- a/jstests/auth/commands_user_defined_roles.js +++ b/jstests/auth/commands_user_defined_roles.js @@ -89,14 +89,16 @@ function runOneTest(conn, t) { for (var i = 0; i < t.testcases.length; i++) { var testcase = t.testcases[i]; - var privileges = testcase.privileges; - if (!("privileges" in testcase)) { continue; } + // Make a copy of the priviliges array since it will be modified. + var privileges = testcase.privileges.map(function(p) { + return Object.extend({}, p, true); + }); if (testcase.expectAuthzFailure) { - msg = testInsufficientPrivileges(conn, t, testcase, testcase.privileges); + msg = testInsufficientPrivileges(conn, t, testcase, privileges); if (msg) { failures.push(t.testname + ": " + msg); } @@ -124,9 +126,8 @@ function runOneTest(conn, t) { if (msg) { failures.push(t.testname + ": " + msg); } - // test resource pattern where collection is "" - testcase.privileges.forEach(function(j) { + privileges.forEach(function(j) { if (j.resource.collection && !j.resource.collection.startsWith('system.')) { j.resource.collection = ""; } @@ -135,9 +136,8 @@ function runOneTest(conn, t) { if (msg) { failures.push(t.testname + ": " + msg); } - // test resource pattern where database is "" - testcase.privileges.forEach(function(j) { + privileges.forEach(function(j) { if (j.resource.db) { j.resource.db = ""; } diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js index 18ccb128e58..192cdfc1d34 100644 --- a/jstests/auth/lib/commands_lib.js +++ b/jstests/auth/lib/commands_lib.js @@ -806,7 +806,7 @@ var authCommandsLib = { ] } ] - }, + },/* Removed until SERVER-19640 is resolved. { testname: "dataSize_1", command: {dataSize: firstDbName + ".x"}, @@ -832,7 +832,7 @@ var authCommandsLib = { ] } ] - }, + },*/ { testname: "dbHash", command: {dbHash: 1}, |