0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/multiVersion/remove_feature_compatibility_version.js
2019-07-27 11:02:23 -04:00

19 lines
656 B
JavaScript

/**
* This test is for SERVER-29453: Renaming the admin.system.version collection
* or removing the FCV document should not be allowed.
*/
(function() {
'use strict';
let standalone = MongoRunner.runMongod();
assert.neq(null, standalone, 'mongod was unable to start up');
let adminDB = standalone.getDB('admin');
// Renaming the collection or deleting the document should fail.
assert.commandFailedWithCode(
adminDB.runCommand({renameCollection: 'admin.system.version', to: 'admin.dummy.collection'}),
ErrorCodes.IllegalOperation);
assert.writeErrorWithCode(adminDB.system.version.remove({}), 40670);
MongoRunner.stopMongod(standalone);
})();