summaryrefslogtreecommitdiff
path: root/jstests/core
diff options
context:
space:
mode:
authorPV99 <pridhvi.vegesna@mongodb.com>2020-07-28 19:05:21 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-04 07:22:37 +0000
commit4b967fd6c5e679b33922a4d287755ea987dc882c (patch)
tree7565bdd86fb741d0cc6cfdf49ecc0403e33bdeb8 /jstests/core
parent3421f17236e0a0051d398eea42220e4c943d829d (diff)
downloadmongo-4b967fd6c5e679b33922a4d287755ea987dc882c.tar.gz
SERVER-49378 List Commands includes API Version Info
Diffstat (limited to 'jstests/core')
-rw-r--r--jstests/core/version_api_list_commands_verification.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/core/version_api_list_commands_verification.js b/jstests/core/version_api_list_commands_verification.js
new file mode 100644
index 00000000000..8836398e918
--- /dev/null
+++ b/jstests/core/version_api_list_commands_verification.js
@@ -0,0 +1,19 @@
+/**
+ * Checks that listCommands returns the API Version information of a command.
+ *
+ * @tags: [requires_fcv_46, requires_non_retryable_commands]
+ */
+
+(function() {
+"use strict";
+
+const resListCommands = db.runCommand({listCommands: 1});
+assert.commandWorked(resListCommands);
+const {find, serverStatus, testDeprecation} = resListCommands["commands"];
+assert(JSON.stringify(find.apiVersions) == "[\"1\"]");
+assert(JSON.stringify(find.deprecatedApiVersions) == "[]");
+assert(JSON.stringify(serverStatus.apiVersions) == "[]");
+assert(JSON.stringify(serverStatus.deprecatedApiVersions) == "[]");
+assert(JSON.stringify(testDeprecation.apiVersions) == "[\"1\"]");
+assert(JSON.stringify(testDeprecation.deprecatedApiVersions) == "[\"1\"]");
+})(); \ No newline at end of file