diff options
Diffstat (limited to 'src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp')
| -rw-r--r-- | src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp index 7d728bf451a..0e5c1a9dadf 100644 --- a/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp +++ b/src/mongo/embedded/mongo_embedded/mongo_embedded_test.cpp @@ -550,111 +550,6 @@ TEST_F(MongodbCAPITest, InsertAndUpdate) { ASSERT(outputBSON2.getIntField("nModified") == 1); } -TEST_F(MongodbCAPITest, RunListCommands) { - auto client = createClient(); - - std::vector<std::string> allowlist = {"_hashBSONElement", - "_killOperations", - "aggregate", - "buildInfo", - "collMod", - "collStats", - "configureFailPoint", - "count", - "create", - "createIndexes", - "currentOp", - "dataSize", - "dbStats", - "delete", - "distinct", - "drop", - "dropDatabase", - "dropIndexes", - "echo", - "endSessions", - "explain", - "find", - "findAndModify", - "getLastError", - "getMore", - "getParameter", - "httpClientRequest", - "insert", - "isMaster", - "killCursors", - "killOp", - "killSessions", - "killAllSessions", - "killAllSessionsByPattern", - "listCollections", - "listCommands", - "listDatabases", - "listIndexes", - "lockInfo", - "logMessage", - "ping", - "planCacheClear", - "planCacheClearFilters", - "planCacheListFilters", - "planCacheSetFilter", - "reIndex", - "refreshLogicalSessionCacheNow", - "refreshSessions", - "renameCollection", - "repairDatabase", - "serverStatus", - "setParameter", - "sleep", - "startSession", - "update", - "validate", - "validateDBMetadata", - "waitForFailPoint", - "whatsmysni"}; - - std::sort(allowlist.begin(), allowlist.end()); - - mongo::BSONObj listCommandsObj = mongo::fromjson("{ listCommands: 1 }"); - auto listCommandsOpMsg = mongo::OpMsgRequest::fromDBAndBody("db_name", listCommandsObj); - auto output = performRpc(client, listCommandsOpMsg); - auto commandsBSON = output["commands"]; - std::vector<std::string> commands; - for (const auto& element : commandsBSON.Obj()) { - commands.push_back(element.fieldNameStringData().toString()); - } - std::sort(commands.begin(), commands.end()); - - std::vector<std::string> missing; - std::vector<std::string> unsupported; - std::set_difference(allowlist.begin(), - allowlist.end(), - commands.begin(), - commands.end(), - std::back_inserter(missing)); - std::set_difference(commands.begin(), - commands.end(), - allowlist.begin(), - allowlist.end(), - std::back_inserter(unsupported)); - - if (!missing.empty()) { - std::cout << "\nMissing commands from the embedded binary:\n"; - } - for (auto&& cmd : missing) { - std::cout << cmd << "\n"; - } - if (!unsupported.empty()) { - std::cout << "\nUnsupported commands in the embedded binary:\n"; - } - for (auto&& cmd : unsupported) { - std::cout << cmd << "\n"; - } - - ASSERT(missing.empty()) << mongo::StringSplitter::join(missing, ", "); - ASSERT(unsupported.empty()) << mongo::StringSplitter::join(unsupported, ", "); -} - // This test is temporary to make sure that only one database can be created // This restriction may be relaxed at a later time TEST_F(MongodbCAPITest, CreateMultipleDBs) { |
