mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 15:53:55 +00:00
Updated self test startup
This commit is contained in:
@@ -46,10 +46,11 @@ function start()
|
||||
{
|
||||
console.log('\nStarting Self Test...');
|
||||
|
||||
testConsoleHelp()
|
||||
.then(function () { return (testAMT()); })
|
||||
coreInfo()
|
||||
.then(function () { return (testConsoleHelp()); })
|
||||
.then(function () { return (testCPUInfo()); })
|
||||
.then(function () { return (testSMBIOS()); })
|
||||
.then(function () { return (testAMT()); })
|
||||
.then(function () { return (testTunnel()); })
|
||||
.then(function () { return (testTerminal()); })
|
||||
.then(function () { return (testKVM()); })
|
||||
@@ -58,6 +59,32 @@ function start()
|
||||
.catch(function (v) { console.log(v); });
|
||||
}
|
||||
|
||||
function coreInfo()
|
||||
{
|
||||
var ret = new promise(function (res, rej) { this._res = res; this._rej = rej; });
|
||||
console.log(' => Waiting for Agent Info');
|
||||
|
||||
ret.tester = this;
|
||||
ret.handler = function handler(J)
|
||||
{
|
||||
if(J.action == 'coreinfo')
|
||||
{
|
||||
this.removeListener('command', handler);
|
||||
console.log(' -> Agent Info received..............[OK]');
|
||||
console.log('');
|
||||
console.log(' ' + J.osdesc);
|
||||
console.log(' ' + J.value);
|
||||
console.log('');
|
||||
handler.promise._res();
|
||||
}
|
||||
};
|
||||
ret.handler.promise = ret;
|
||||
ret.tester.on('command', ret.handler);
|
||||
require('MeshAgent').emit('Connected', 3);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
function testFileDownload()
|
||||
{
|
||||
console.log(' => File Transfer Test');
|
||||
@@ -244,7 +271,8 @@ function testAMT()
|
||||
{
|
||||
try
|
||||
{
|
||||
JSON.parse(J.toString());
|
||||
var str = '(function foo(){var x=' + J.toString().split('\n').join('').split('\r').join('') + '; return(x);})();';
|
||||
eval(str);
|
||||
console.log(' => Testing AMT Detection...............[OK]');
|
||||
}
|
||||
catch(e)
|
||||
|
||||
Reference in New Issue
Block a user