summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShreyas Kalyan <shreyas.kalyan@mongodb.com>2022-11-14 17:22:46 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-15 16:23:11 +0000
commit493b63c41b1f5c143d24470e21ae6c0714f3f650 (patch)
treeff32df61fa461f7fb794d822fa61e4151eb8e134
parent8fa43ad1a9e9cae6133e3d0a924a07054e8fd70c (diff)
downloadmongo-493b63c41b1f5c143d24470e21ae6c0714f3f650.tar.gz
SERVER-70416 add legacy shell --quiet test
-rw-r--r--jstests/noPassthrough/quiet_shell.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/jstests/noPassthrough/quiet_shell.js b/jstests/noPassthrough/quiet_shell.js
new file mode 100644
index 00000000000..f8502b35bda
--- /dev/null
+++ b/jstests/noPassthrough/quiet_shell.js
@@ -0,0 +1,26 @@
+(function() {
+'use strict';
+
+const mongo = MongoRunner.runMongod();
+const regexMatch = /sh([0-9]{5}|[0-9]{4})\|/;
+
+// Test that a normal mongo shell gives us some noise in the raw output.
+{
+ const out = runMongoProgram('mongo', '--port', mongo.port, '--eval', ';');
+ const mongoOutput = rawMongoProgramOutput();
+
+ assert.gte(mongoOutput.match(regexMatch).length, 1);
+}
+
+clearRawMongoProgramOutput();
+
+// Test that a quiet shell does not output anything.
+{
+ const out = runMongoProgram('mongo', '--port', mongo.port, '--quiet', '--eval', ';');
+ const mongoOutput = rawMongoProgramOutput();
+
+ assert.eq(mongoOutput.match(regexMatch), null);
+}
+
+MongoRunner.stopMongod(mongo);
+})(); \ No newline at end of file