diff --git a/meshcore/agentcore.c b/meshcore/agentcore.c index 070e908..575ce07 100644 --- a/meshcore/agentcore.c +++ b/meshcore/agentcore.c @@ -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); diff --git a/modules/agent-selftest.js b/modules/agent-selftest.js index 6c20403..f2aee00 100644 --- a/modules/agent-selftest.js +++ b/modules/agent-selftest.js @@ -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)