From 2bcc309437fa9d9778a087ce67d188ec69aae40d Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 3 Jun 2022 12:06:58 -0700 Subject: [PATCH] 1. Added documentation for IPC Mode Self Test 2. Added IPC path check for linux --- modules/agent-selftest.js | 4 +++- readme.md | 29 ++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/modules/agent-selftest.js b/modules/agent-selftest.js index 7b3181f..0e2c9cd 100644 --- a/modules/agent-selftest.js +++ b/modules/agent-selftest.js @@ -234,7 +234,9 @@ function start() } else { - ipcPath = svc.appWorkingDirectory() + 'DAIPC'; + ipcPath = svc.appWorkingDirectory(); + if (ipcPath.endsWith('/')) { ipcPath += 'DAIPC'; } + else { ipcPath += '/DAIPC'; } } } diff --git a/readme.md b/readme.md index ff3ac5d..f3a0716 100644 --- a/readme.md +++ b/readme.md @@ -138,7 +138,31 @@ variables. To start the test, simply run the agent with the --selfTest=1 switch: ./MeshAgent --selfTest=1 ``` -## Self Test Coverage, Stand Alone +To run the self test in IPC Mode, requires a little more preparation. For security reasons, by default the agent does not allow running 'eval' +commands thru the IPC channel, however, the Self Test IPC Mode, requires this functionality. The simplest way to allow this command, is to add +the following entry in the msh configuration file of the agent, then restart the agent: +``` +debugConsole=1 +``` + +To verify if this flag has been enabled, from the console tab for the agent, run the following command: +``` +eval debugConsole +``` +If this returns 'true', then you are ready to run the self test in IPC Mode. +To start the self test in IPC Mode, start the self test similarly to how you launch the Stand Alone test, from an elevated console, but add the +following command line switch: +``` +--serviceName="xxx" +``` +substituting xxx, with the service name of the agent you are trying to test. If you do not know the service name, you can navigate to the folder +that contains the agent, and run the the agent from the command line with the following command line switch: +``` +-name +``` +This will return the service name for that agent. + +## Self Test Coverage The following is the list of basic tests that the Stand Alone test mode will test: * Server Initialization. This verifies that the agent sends the correct startup sequence to the server. * AMT/LMS. If detected, will attempt to verify LMS operation. @@ -152,6 +176,9 @@ The following is the list of basic tests that the Stand Alone test mode will tes * File Transfer Upload. Verifies ability to upload files, by uploading a random stream of bytes. * File Transfer Download. Verifies ability to doanload files, by downloading the bytes uploaded in previous test, and verifying CRC. +In addition to the above tests, IPC Mode test adds the following tests: +* Mesh Core Dump Test. Attempts to clear/restart JS core while running KVM test, verifying the agent does not crash. +* Service Restart Test. Verifies that the agent can successfully restart itself. ## Feedback