2017-11-12 00:00:52 -05:00
|
|
|
/**
|
|
|
|
|
* This test is for SERVER-29453: Renaming the admin.system.version collection
|
|
|
|
|
* or removing the FCV document should not be allowed.
|
|
|
|
|
*/
|
|
|
|
|
let standalone = MongoRunner.runMongod();
|
2025-08-21 10:17:44 -07:00
|
|
|
assert.neq(null, standalone, "mongod was unable to start up");
|
|
|
|
|
let adminDB = standalone.getDB("admin");
|
2017-11-12 00:00:52 -05:00
|
|
|
|
|
|
|
|
// Renaming the collection or deleting the document should fail.
|
|
|
|
|
assert.commandFailedWithCode(
|
2025-08-21 10:17:44 -07:00
|
|
|
adminDB.runCommand({renameCollection: "admin.system.version", to: "admin.dummy.collection"}),
|
|
|
|
|
ErrorCodes.IllegalOperation,
|
|
|
|
|
);
|
2017-11-12 00:00:52 -05:00
|
|
|
assert.writeErrorWithCode(adminDB.system.version.remove({}), 40670);
|
2025-08-21 10:17:44 -07:00
|
|
|
MongoRunner.stopMongod(standalone);
|