1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-17 16:53:13 +00:00

updated selftest mode to pass parameters

This commit is contained in:
Bryan Roe
2020-08-06 11:41:30 -07:00
parent 9d577e80e7
commit c9aaeecca5
2 changed files with 18 additions and 0 deletions

View File

@@ -3640,6 +3640,19 @@ void MeshServer_Agent_SelfTest(MeshAgentHostContainer *agent)
//int CoreModuleTesterLen = ILibSimpleDataStore_Get(agent->masterDb, "CoreModuleTester", NULL, 0); //int CoreModuleTesterLen = ILibSimpleDataStore_Get(agent->masterDb, "CoreModuleTester", NULL, 0);
//char *CoreModule, *CoreModuleTester; //char *CoreModule, *CoreModuleTester;
char *argarray;
size_t argarrayLen;
argarrayLen = (size_t)ILibSimpleDataStore_Cached_GetJSONEx(agent->masterDb, NULL, 0);
ILibMemory_AllocateRaw(argarray, argarrayLen);
ILibSimpleDataStore_Cached_GetJSONEx(agent->masterDb, argarray, (int)argarrayLen);
duk_push_heapptr(agent->meshCoreCtx, ILibDuktape_GetProcessObject(agent->meshCoreCtx)); // [process]
duk_push_string(agent->meshCoreCtx, argarray); // [process][string]
duk_json_decode(agent->meshCoreCtx, -1); // [process][json]
duk_put_prop_string(agent->meshCoreCtx, -2, "\xFF_argArray"); // [process]
duk_pop(agent->meshCoreCtx);
printf("Agent Self Test...\n"); printf("Agent Self Test...\n");
if (agent->coreTimeout != 0) if (agent->coreTimeout != 0)
{ {

View File

@@ -75,6 +75,11 @@ function coreInfo()
console.log(' ' + J.osdesc); console.log(' ' + J.osdesc);
console.log(' ' + J.value); console.log(' ' + J.value);
console.log(''); console.log('');
if (process.argv.includes('--showCoreInfo="1"'))
{
console.log('\n' + JSON.stringify(J) + '\n');
}
handler.promise._res(); handler.promise._res();
} }
}; };