1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-07 19:13:20 +00:00

1. Removed commented out code

2. Updated self test to work in service mode
This commit is contained in:
Bryan Roe
2020-08-12 00:06:31 -07:00
parent 9a8641b959
commit c56ab5574f
2 changed files with 40 additions and 19 deletions

View File

@@ -44,8 +44,23 @@ var promise = require('promise');
function start()
{
console.log('\nStarting Self Test...');
var isservice = false;
var service = null;
try
{
service = require('service-manager').manager.getService(process.platform == 'win32' ? 'Mesh Agent' : 'meshagent');
isservice = service.isMe();
}
catch(e)
{
}
if (isservice)
{
console.setDestination(console.Destinations.LOGFILE);
}
console.log('Starting Self Test...');
coreInfo()
.then(function () { return (testLMS()); })
.then(function () { return (testConsoleHelp()); })
@@ -54,8 +69,30 @@ function start()
.then(function () { return (testTerminal()); })
.then(function () { return (testKVM()); })
.then(function () { return (testFileDownload()); })
.then(function () { console.log('End of Self Test'); })
.catch(function (v) { console.log(v); });
.then(function ()
{
console.log('End of Self Test');
if (isservice)
{
service.stop();
}
else
{
process._exit();
}
})
.catch(function (v)
{
console.log(v);
if (isservice)
{
service.stop();
}
else
{
process._exit();
}
});
}
function getFDSnapshot()