1
0
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:
Bryan Roe
2020-08-06 10:35:20 -07:00
parent 6740cbf55d
commit 9d577e80e7
2 changed files with 32 additions and 3 deletions

View File

@@ -3660,6 +3660,7 @@ void MeshServer_Agent_SelfTest(MeshAgentHostContainer *agent)
else
{
printf("[OK]\n");
agent->serverAuthState = 3;
ILibMemory_AllocateRaw(CoreModule, CoreModuleLen);
ILibSimpleDataStore_Get(agent->masterDb, "CoreModule", CoreModule, CoreModuleLen);

View File

@@ -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)