diff options
Diffstat (limited to 'jstests/noPassthrough/cluster_explain_commands_require_cluster_node.js')
-rw-r--r-- | jstests/noPassthrough/cluster_explain_commands_require_cluster_node.js | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/jstests/noPassthrough/cluster_explain_commands_require_cluster_node.js b/jstests/noPassthrough/cluster_explain_commands_require_cluster_node.js deleted file mode 100644 index 5e009345d80..00000000000 --- a/jstests/noPassthrough/cluster_explain_commands_require_cluster_node.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Verify the explaining "cluster" versions of commands is rejected on a non shardsvr mongod. - * - * @tags: [ - * requires_replication, - * ] - */ -(function() { -"use strict"; - -const kDbName = "cluster_explain_commands"; -const kCollName = "bar"; -const rst = new ReplSetTest({nodes: 1}); -rst.startSet(); -rst.initiate(); - -const clusterCommandsCases = [ - {cmd: {explain: {clusterAggregate: kCollName, pipeline: [{$match: {}}], cursor: {}}}}, - {cmd: {explain: {clusterCount: "x"}}}, - {cmd: {explain: {clusterDelete: kCollName, deletes: [{q: {}, limit: 1}]}}}, - {cmd: {explain: {clusterFind: kCollName}}}, - {cmd: {explain: {clusterInsert: kCollName, documents: [{x: 1}]}}}, - {cmd: {explain: {clusterUpdate: kCollName, updates: [{q: {doesNotExist: 1}, u: {x: 1}}]}}}, - {cmd: {explain: {clusterDelete: `${kCollName}`, deletes: [{q: {}, limit: 1}]}}} -]; - -function runTestCaseExpectFail(conn, testCase, code) { - assert.commandFailedWithCode( - conn.getDB(kDbName).runCommand(testCase.cmd), code, tojson(testCase.cmd)); -} - -for (let testCase of clusterCommandsCases) { - runTestCaseExpectFail(rst.getPrimary(), testCase, ErrorCodes.ShardingStateNotInitialized); -} - -rst.stopSet(); -}()); |