mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
38 lines
887 B
JavaScript
38 lines
887 B
JavaScript
/**
|
|
* Tests that normal startup writes to the log files as expected.
|
|
*/
|
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
function makeRegExMatchFn(pattern) {
|
|
return function(text) {
|
|
return pattern.test(text);
|
|
};
|
|
}
|
|
|
|
function testStartupLogging(launcher, matchFn, expectedExitCode) {
|
|
assert(matchFn(rawMongoProgramOutput()));
|
|
}
|
|
|
|
function validateWaitingMessage(launcher) {
|
|
clearRawMongoProgramOutput();
|
|
var conn = launcher.start({});
|
|
launcher.stop(conn, undefined, {});
|
|
testStartupLogging(
|
|
launcher,
|
|
makeRegExMatchFn(
|
|
/"id":23016,\s*"ctx":"listener","msg":"Waiting for connections","attr":{"port":/));
|
|
}
|
|
|
|
print("********************\nTesting startup logging in mongod\n********************");
|
|
|
|
validateWaitingMessage({
|
|
start: function(opts) {
|
|
return MongoRunner.runMongod(opts);
|
|
},
|
|
stop: MongoRunner.stopMongod
|
|
});
|
|
}());
|