From eaa4652ee9eef8c206573e90e6ab16831758078c Mon Sep 17 00:00:00 2001 From: Yuhong Zhang Date: Thu, 25 Aug 2022 13:57:20 +0000 Subject: SERVER-68688 Rename `checkBSONConsistency` option to `checkBSONConformance` --- .../validate_checkBSONConformance.js | 38 ++++++++++++++++++++++ .../validate_checkBSONConsistency.js | 38 ---------------------- 2 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 jstests/noPassthroughWithMongod/validate_checkBSONConformance.js delete mode 100644 jstests/noPassthroughWithMongod/validate_checkBSONConsistency.js (limited to 'jstests/noPassthroughWithMongod') diff --git a/jstests/noPassthroughWithMongod/validate_checkBSONConformance.js b/jstests/noPassthroughWithMongod/validate_checkBSONConformance.js new file mode 100644 index 00000000000..c95c9c0bef8 --- /dev/null +++ b/jstests/noPassthroughWithMongod/validate_checkBSONConformance.js @@ -0,0 +1,38 @@ +/* + * Tests the usage of 'checkBSONConformance' option of the validate command. + * + * @tags: [featureFlagExtendValidateCommand] + */ + +(function() { +"use strict"; + +const collName = "validate_checkBSONConformance"; +const coll = db.getCollection(collName); +coll.drop(); +assert.commandWorked(coll.insert({a: 1})); + +assert.commandFailedWithCode( + db.runCommand({validate: collName, checkBSONConformance: true, metadata: true}), + ErrorCodes.InvalidOptions); + +assert.commandFailedWithCode( + db.runCommand({validate: collName, checkBSONConformance: true, repair: true}), + ErrorCodes.InvalidOptions); + +assert.commandWorked( + db.runCommand({validate: collName, checkBSONConformance: true, background: true})); + +assert.commandFailedWithCode( + db.runCommand({validate: collName, checkBSONConformance: false, full: true}), + ErrorCodes.InvalidOptions); + +assert.commandWorked(db.runCommand({validate: collName, checkBSONConformance: true, full: true})); + +assert.commandFailedWithCode( + db.runCommand({validate: collName, checkBSONConformance: false, enforceFastCount: true}), + ErrorCodes.InvalidOptions); + +assert.commandWorked( + db.runCommand({validate: collName, checkBSONConformance: true, enforceFastCount: true})); +})(); diff --git a/jstests/noPassthroughWithMongod/validate_checkBSONConsistency.js b/jstests/noPassthroughWithMongod/validate_checkBSONConsistency.js deleted file mode 100644 index dab1163cc40..00000000000 --- a/jstests/noPassthroughWithMongod/validate_checkBSONConsistency.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Tests the usage of 'checkBSONConsistency' option of the validate command. - * - * @tags: [featureFlagExtendValidateCommand] - */ - -(function() { -"use strict"; - -const collName = "validate_checkBSONConsistency"; -const coll = db.getCollection(collName); -coll.drop(); -assert.commandWorked(coll.insert({a: 1})); - -assert.commandFailedWithCode( - db.runCommand({validate: collName, checkBSONConsistency: true, metadata: true}), - ErrorCodes.InvalidOptions); - -assert.commandFailedWithCode( - db.runCommand({validate: collName, checkBSONConsistency: true, repair: true}), - ErrorCodes.InvalidOptions); - -assert.commandWorked( - db.runCommand({validate: collName, checkBSONConsistency: true, background: true})); - -assert.commandFailedWithCode( - db.runCommand({validate: collName, checkBSONConsistency: false, full: true}), - ErrorCodes.InvalidOptions); - -assert.commandWorked(db.runCommand({validate: collName, checkBSONConsistency: true, full: true})); - -assert.commandFailedWithCode( - db.runCommand({validate: collName, checkBSONConsistency: false, enforceFastCount: true}), - ErrorCodes.InvalidOptions); - -assert.commandWorked( - db.runCommand({validate: collName, checkBSONConsistency: true, enforceFastCount: true})); -})(); -- cgit v1.2.1