1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

added support for pid file

This commit is contained in:
Massimo Candela
2019-12-11 15:49:27 +01:00
parent f48cffcf4d
commit 264a7ca7e8
6 changed files with 37 additions and 4 deletions

View File

@@ -77,7 +77,8 @@ describe("Composition", function() {
"monitoredPrefixesFiles",
"logging",
"checkForUpdatesAtBoot",
"uptimeMonitor"
"uptimeMonitor",
"pidFile"
]);
expect(config.connectors[0]).to.have
.property('class')
@@ -326,6 +327,21 @@ describe("Composition", function() {
done();
});
});
it("write pid file", function (done) {
const file = config.pidFile;
expect("bgpalerter.pid").to.equal(file);
if (file) {
readLastLines
.read(file, 1)
.then((line) => {
expect(parseInt(line)).to.equal(process.pid);
done();
});
}
});
});
});