diff options
-rw-r--r-- | conf.d/project/etc/aft-mapis.json | 2 | ||||
-rw-r--r-- | conf.d/project/etc/aft-test.json | 2 | ||||
-rw-r--r-- | src/test-binding.c | 12 |
3 files changed, 13 insertions, 3 deletions
diff --git a/conf.d/project/etc/aft-mapis.json b/conf.d/project/etc/aft-mapis.json index 4ecfbbb..edcfc87 100644 --- a/conf.d/project/etc/aft-mapis.json +++ b/conf.d/project/etc/aft-mapis.json @@ -10,7 +10,7 @@ "low-can" ] }, - "onload": { + "testVerb": { "uid": "launch_all_tests", "info": "Launch all the tests", "action": "lua://AFT#_launch_test", diff --git a/conf.d/project/etc/aft-test.json b/conf.d/project/etc/aft-test.json index fa26c5f..eabe877 100644 --- a/conf.d/project/etc/aft-test.json +++ b/conf.d/project/etc/aft-test.json @@ -10,7 +10,7 @@ "hello" ] }, - "onload": { + "testVerb": { "uid": "launch_all_tests", "info": "Launch all the tests", "action": "lua://AFT#_launch_test", diff --git a/src/test-binding.c b/src/test-binding.c index d0fcb3c..aa9fde5 100644 --- a/src/test-binding.c +++ b/src/test-binding.c @@ -29,7 +29,7 @@ afb_dynapi *AFB_default; // Config Section definition static CtlSectionT ctrlSections[] = { {.key = "resources", .loadCB = PluginConfig}, - {.key = "onload", .loadCB = OnloadConfig}, + {.key = "testVerb", .loadCB = ControlConfig}, {.key = "events", .loadCB = EventConfig}, {.key = "mapis", .loadCB = mapisConfig}, {.key = NULL} @@ -45,9 +45,19 @@ static void ctrlapi_ping(AFB_ReqT request) { return; } +static void ctrlapi_exit(AFB_ReqT request) { + + AFB_ReqNotice(request, "Exiting..."); + AFB_ReqSuccess(request, NULL, NULL); + exit(0); + + return; +} + static AFB_ApiVerbs CtrlApiVerbs[] = { /* VERB'S NAME FUNCTION TO CALL SHORT DESCRIPTION */ {.verb = "ping", .callback = ctrlapi_ping, .info = "ping test for API"}, + {.verb = "exit", .callback = ctrlapi_exit, .info = "Exit test"}, {.verb = NULL} /* marker for end of the array */ }; |