diff options
author | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2019-05-20 10:35:57 -0400 |
---|---|---|
committer | Xiangyu Yao <xiangyu.yao@mongodb.com> | 2019-05-21 11:07:09 -0400 |
commit | d9d57c2edef4cf974ccf6a527d9cce28baa03079 (patch) | |
tree | 11f80cc88914e1fc1c73adf061e347062559e6b1 /jstests/auth | |
parent | ea0e6b047c98fd56118431d036ee686be0720226 (diff) | |
download | mongo-d9d57c2edef4cf974ccf6a527d9cce28baa03079.tar.gz |
SERVER-41161 Re-enable renaming between databases for applyOps
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/lib/commands_lib.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/jstests/auth/lib/commands_lib.js b/jstests/auth/lib/commands_lib.js index 86b560718c7..6c707a700d6 100644 --- a/jstests/auth/lib/commands_lib.js +++ b/jstests/auth/lib/commands_lib.js @@ -526,6 +526,47 @@ var authCommandsLib = { ] }, { + testname: "applyOps_c_renameCollection_twoDbs", + command: { + applyOps: [{ + "op": "c", + "ns": firstDbName + ".$cmd", + "o": { + "renameCollection": firstDbName + ".x", + "to": secondDbName + ".y", + "stayTemp": false, + "dropTarget": false + } + }] + }, + skipSharded: true, + setup: function(db) { + db.getSisterDB(firstDbName).x.save({}); + db.getSisterDB(adminDbName).runCommand({movePrimary: firstDbName, to: shard0name}); + db.getSisterDB(adminDbName).runCommand({movePrimary: secondDbName, to: shard0name}); + }, + teardown: function(db) { + db.getSisterDB(firstDbName).x.drop(); + db.getSisterDB(secondDbName).y.drop(); + }, + testcases: [ + { + runOnDb: adminDbName, + roles: {readWriteAnyDatabase: 1, root: 1, __system: 1}, + privileges: [ + { + resource: {db: firstDbName, collection: "x"}, + actions: ["find", "dropCollection"] + }, + { + resource: {db: secondDbName, collection: "y"}, + actions: ["insert", "createIndex"] + } + ] + }, + ] + }, + { testname: "applyOps_insert", command: { applyOps: [{ |