summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/client_metadata_log.js
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:20:35 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-27 11:02:23 -0400
commit134a4083953270e8a11430395357fb70a29047ad (patch)
treedd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /jstests/noPassthrough/client_metadata_log.js
parent1e46b5049003f427047e723ea5fab15b5a9253ca (diff)
downloadmongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'jstests/noPassthrough/client_metadata_log.js')
-rw-r--r--jstests/noPassthrough/client_metadata_log.js90
1 files changed, 45 insertions, 45 deletions
diff --git a/jstests/noPassthrough/client_metadata_log.js b/jstests/noPassthrough/client_metadata_log.js
index f1b90492ce6..419a19a9ebb 100644
--- a/jstests/noPassthrough/client_metadata_log.js
+++ b/jstests/noPassthrough/client_metadata_log.js
@@ -3,64 +3,64 @@
* @tags: [requires_sharding]
*/
(function() {
- 'use strict';
+'use strict';
- let checkLog = function(conn) {
- let coll = conn.getCollection("test.foo");
- assert.writeOK(coll.insert({_id: 1}));
+let checkLog = function(conn) {
+ let coll = conn.getCollection("test.foo");
+ assert.writeOK(coll.insert({_id: 1}));
- print(`Checking ${conn.fullOptions.logFile} for client metadata message`);
- let log = cat(conn.fullOptions.logFile);
+ print(`Checking ${conn.fullOptions.logFile} for client metadata message`);
+ let log = cat(conn.fullOptions.logFile);
- assert(
- /received client metadata from .*: { application: { name: ".*" }, driver: { name: ".*", version: ".*" }, os: { type: ".*", name: ".*", architecture: ".*", version: ".*" } }/
- .test(log),
- "'received client metadata' log line missing in log file!\n" + "Log file contents: " +
- conn.fullOptions.logFile +
- "\n************************************************************\n" + log +
- "\n************************************************************");
- };
+ assert(
+ /received client metadata from .*: { application: { name: ".*" }, driver: { name: ".*", version: ".*" }, os: { type: ".*", name: ".*", architecture: ".*", version: ".*" } }/
+ .test(log),
+ "'received client metadata' log line missing in log file!\n" +
+ "Log file contents: " + conn.fullOptions.logFile +
+ "\n************************************************************\n" + log +
+ "\n************************************************************");
+};
- // Test MongoD
- let testMongoD = function() {
- let conn = MongoRunner.runMongod({useLogFiles: true});
- assert.neq(null, conn, 'mongod was unable to start up');
+// Test MongoD
+let testMongoD = function() {
+ let conn = MongoRunner.runMongod({useLogFiles: true});
+ assert.neq(null, conn, 'mongod was unable to start up');
- checkLog(conn);
+ checkLog(conn);
- MongoRunner.stopMongod(conn);
- };
+ MongoRunner.stopMongod(conn);
+};
- // Test MongoS
- let testMongoS = function() {
- let options = {
- mongosOptions: {useLogFiles: true},
- };
+// Test MongoS
+let testMongoS = function() {
+ let options = {
+ mongosOptions: {useLogFiles: true},
+ };
- let st = new ShardingTest({shards: 1, mongos: 1, other: options});
+ let st = new ShardingTest({shards: 1, mongos: 1, other: options});
- checkLog(st.s0);
+ checkLog(st.s0);
- // Validate db.currentOp() contains mongos information
- let curOp = st.s0.adminCommand({currentOp: 1});
- print(tojson(curOp));
+ // Validate db.currentOp() contains mongos information
+ let curOp = st.s0.adminCommand({currentOp: 1});
+ print(tojson(curOp));
- var inprogSample = null;
- for (let inprog of curOp.inprog) {
- if (inprog.hasOwnProperty("clientMetadata") &&
- inprog.clientMetadata.hasOwnProperty("mongos")) {
- inprogSample = inprog;
- break;
- }
+ var inprogSample = null;
+ for (let inprog of curOp.inprog) {
+ if (inprog.hasOwnProperty("clientMetadata") &&
+ inprog.clientMetadata.hasOwnProperty("mongos")) {
+ inprogSample = inprog;
+ break;
}
+ }
- assert.neq(inprogSample.clientMetadata.mongos.host, "unknown");
- assert.neq(inprogSample.clientMetadata.mongos.client, "unknown");
- assert.neq(inprogSample.clientMetadata.mongos.version, "unknown");
+ assert.neq(inprogSample.clientMetadata.mongos.host, "unknown");
+ assert.neq(inprogSample.clientMetadata.mongos.client, "unknown");
+ assert.neq(inprogSample.clientMetadata.mongos.version, "unknown");
- st.stop();
- };
+ st.stop();
+};
- testMongoD();
- testMongoS();
+testMongoD();
+testMongoS();
})();