1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-16 16:23:25 +00:00

Updated self test to support console rights

This commit is contained in:
Bryan Roe
2021-11-04 09:53:29 -07:00
parent 388d07e683
commit 637125d154

View File

@@ -609,7 +609,7 @@ function coreInfo()
// No AMT Support // No AMT Support
r._res(); r._res();
} }
}, 5000, ret); }, 10000, ret);
if (localmode) if (localmode)
{ {
@@ -918,13 +918,13 @@ function testCPUInfo()
} }
catch (e) catch (e)
{ {
this.parent._rej(' => Testing CPU Info....................[ERROR]'); ret._rej(' => Testing CPU Info....................[ERROR]');
return; return;
} }
this.parent._res(); ret._res();
}).catch(function (e) }).catch(function (e)
{ {
this.parent._rej(' => Testing CPU Info....................[FAILED]'); ret._rej(' => Testing CPU Info....................[FAILED]');
}); });
return (ret); return (ret);
} }
@@ -1168,6 +1168,7 @@ function setup()
this.toServer.self = this; this.toServer.self = this;
this.toAgent = function(j) this.toAgent = function(j)
{ {
if (debugmode) { console.log('toAgent() => ', JSON.stringify(j)); }
require('MeshAgent').emit('Command', j); require('MeshAgent').emit('Command', j);
} }
this.createTunnel = function createTunnel(rights, consent) this.createTunnel = function createTunnel(rights, consent)
@@ -1209,7 +1210,7 @@ function setup()
r._rej('QueryTimeout'); r._rej('QueryTimeout');
}, 8000, ret); }, 8000, ret);
this.on('command', ret.handler); this.on('command', ret.handler);
this.toAgent({ action: 'msg', type: 'console', value: cmd, sessionid: -1 }); this.toAgent({ action: 'msg', type: 'console', rights: 0xFFFFFFFF, value: cmd, sessionid: -1 });
return (ret); return (ret);
}; };
@@ -1234,7 +1235,7 @@ function setup()
r._rej('ConsoleCommandTimeout'); r._rej('ConsoleCommandTimeout');
}, 5000, ret); }, 5000, ret);
this.on('command', ret.handler); this.on('command', ret.handler);
this.toAgent({ action: 'msg', type: 'console', value: cmd, sessionid: -1 }); this.toAgent({ action: 'msg', type: 'console',rights: 0xFFFFFFFF, value: cmd, sessionid: -1 });
return (ret); return (ret);
}; };