1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-22 03:03:18 +00:00

Updated self-test

This commit is contained in:
Bryan Roe
2021-02-09 22:08:17 -08:00
parent e581505ba9
commit 3d63758b12

View File

@@ -180,6 +180,8 @@ function start()
var svc = null;
debugmode = process.argv.getParameter('debugMode', false);
if (servicename != null)
{
try
{
var svc = require('service-manager').manager.getService(servicename);
@@ -196,6 +198,7 @@ function start()
process._exit();
}
if (process.platform == 'win32')
{
// Find the NodeID from the registry
@@ -216,6 +219,7 @@ function start()
{
ipcPath = svc.appWorkingDirectory() + 'DAIPC';
}
}
if (debugmode)
{
@@ -745,6 +749,13 @@ function testFileDownload()
function testCPUInfo()
{
var ret = new promise(function (res, rej) { this._res = res; this._rej = rej; });
if (process.platform == 'freebsd')
{
console.log(' => Testing CPU Info....................[N/A]');
ret._res();
return (ret);
}
ret.consoleTest = this.consoleCommand('cpuinfo');
ret.consoleTest.parent = ret;
ret.consoleTest.then(function (J)
@@ -875,7 +886,16 @@ function testTerminal(terminalMode)
if (terminalMode == null) { terminalMode = 1; }
var ret = new promise(function (res, rej) { this._res = res; this._rej = rej; });
ret.parent = this;
ret.tunnel = this.createTunnel(0x1FF, 0xFF);
var consent = 0xFF;
if (localmode)
{
if(process.platform == 'linux' || process.platform =='freebsd')
{
if (!require('monitor-info').kvm_x11_support) { consent = 0x00; }
}
}
ret.tunnel = this.createTunnel(0x1FF, consent);
ret.mode = terminalMode.toString();
ret.tunnel.parent = ret;
ret.tunnel.then(function (c)
@@ -916,7 +936,14 @@ function testTerminal(terminalMode)
});
console.log(' -> Tunnel...........................[CONNECTED]');
if (consent != 0)
{
console.log(' -> Triggering User Consent');
}
else
{
console.log(' -> Skipping User Consent');
}
c.write('c');
c.write(c.ret.mode);
}).catch(function (e)