From c541040fb5fa1b5333edb3755914428aa0af36ff Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Sun, 16 Sep 2018 15:30:26 +0200 Subject: Rename test service api to be more discriminant. Using aftest and aft-aftest api name to self test was difficult because of searching file using the binder process name which could be the same although api name were diffirent. Change-Id: Id14e30024f0b98c29feed5b707ab9dc8b74d3552 Signed-off-by: Romain Forlot --- test/afb-test/etc/aft-aftest-self.json | 69 ---------------------------------- test/afb-test/etc/aft-selftest.json | 69 ++++++++++++++++++++++++++++++++++ test/afb-test/tests/aftTest.lua | 16 ++++---- 3 files changed, 77 insertions(+), 77 deletions(-) delete mode 100644 test/afb-test/etc/aft-aftest-self.json create mode 100644 test/afb-test/etc/aft-selftest.json (limited to 'test') diff --git a/test/afb-test/etc/aft-aftest-self.json b/test/afb-test/etc/aft-aftest-self.json deleted file mode 100644 index f8ebbcd..0000000 --- a/test/afb-test/etc/aft-aftest-self.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "id": "http://iot.bzh/download/public/schema/json/ctl-schema.json#", - "$schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json#", - "metadata": { - "uid": "Test", - "version": "1.0", - "api": "aft-aftest", - "info": "Binding made to test other bindings", - "require": [ - "low-can" - ] - }, - "testVerb": { - "uid": "launch_all_tests", - "info": "Launch all the tests", - "action": "lua://AFT#_launch_test", - "args": { - "trace": "low-can", - "files": [ "aftTest.lua", "mapi_tests.lua" ] - } - }, - "mapis": [{ - "uid": "low-can", - "info": "Faked low-can API", - "libs": "mapi_low-can.lua", - "verbs": [ - { - "uid": "subscribe", - "info": "Subscribe to CAN signals events", - "action": "lua://low-can#_subscribe" - }, - { - "uid": "unsubscribe", - "info": "Unsubscribe previously suscribed signals.", - "action": "lua://low-can#_unsubscribe" - }, - { - "uid": "get", - "info": "get a current value of CAN message", - "action": "lua://low-can#_get" - }, - { - "uid": "list", - "info": "get a supported CAN message list", - "action": "lua://low-can#_list" - }, - { - "uid": "auth", - "info": "Authenticate session to be raise Level Of Assurance.", - "action": "lua://low-can#_auth" - }, - { - "uid": "write", - "info": "Write a CAN messages to the CAN bus.", - "action": "lua://low-can#_write" - } - ], - "events": [{ - "uid": "low-can/diagnostic_messages", - "action": "lua://AFT#_evt_catcher_" - },{ - "uid": "low-can/messages_engine_speed", - "action": "lua://AFT#_evt_catcher_" - },{ - "uid": "low-can/messages_vehicle_speed", - "action": "lua://AFT#_evt_catcher_" - }] - }] -} diff --git a/test/afb-test/etc/aft-selftest.json b/test/afb-test/etc/aft-selftest.json new file mode 100644 index 0000000..5a3f1dd --- /dev/null +++ b/test/afb-test/etc/aft-selftest.json @@ -0,0 +1,69 @@ +{ + "id": "http://iot.bzh/download/public/schema/json/ctl-schema.json#", + "$schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json#", + "metadata": { + "uid": "Test", + "version": "1.0", + "api": "aft-selftest", + "info": "Binding made to test other bindings", + "require": [ + "low-can" + ] + }, + "testVerb": { + "uid": "launch_all_tests", + "info": "Launch all the tests", + "action": "lua://AFT#_launch_test", + "args": { + "trace": "low-can", + "files": [ "aftTest.lua", "mapi_tests.lua" ] + } + }, + "mapis": [{ + "uid": "low-can", + "info": "Faked low-can API", + "libs": "mapi_low-can.lua", + "verbs": [ + { + "uid": "subscribe", + "info": "Subscribe to CAN signals events", + "action": "lua://low-can#_subscribe" + }, + { + "uid": "unsubscribe", + "info": "Unsubscribe previously suscribed signals.", + "action": "lua://low-can#_unsubscribe" + }, + { + "uid": "get", + "info": "get a current value of CAN message", + "action": "lua://low-can#_get" + }, + { + "uid": "list", + "info": "get a supported CAN message list", + "action": "lua://low-can#_list" + }, + { + "uid": "auth", + "info": "Authenticate session to be raise Level Of Assurance.", + "action": "lua://low-can#_auth" + }, + { + "uid": "write", + "info": "Write a CAN messages to the CAN bus.", + "action": "lua://low-can#_write" + } + ], + "events": [{ + "uid": "low-can/diagnostic_messages", + "action": "lua://AFT#_evt_catcher_" + },{ + "uid": "low-can/messages_engine_speed", + "action": "lua://AFT#_evt_catcher_" + },{ + "uid": "low-can/messages_vehicle_speed", + "action": "lua://AFT#_evt_catcher_" + }] + }] +} diff --git a/test/afb-test/tests/aftTest.lua b/test/afb-test/tests/aftTest.lua index 0503ae3..5c11d1d 100644 --- a/test/afb-test/tests/aftTest.lua +++ b/test/afb-test/tests/aftTest.lua @@ -97,13 +97,13 @@ _AFT.describe("testAssertNotIsThread", function() _AFT.assertNotIsThread(2) end) _AFT.describe("testAssertNotIsUserdata", function() _AFT.assertNotIsUserdata(2) end) function _callback(responseJ) _AFT.assertNotIsNil(responseJ) end -function _callbackError(responseJ) _AFT.assertStrContains(responseJ.request.info, "verb pingfail unknown within api afTest") end - -_AFT.describe("testAssertVerbStatusSuccess",function() _AFT.assertVerbStatusSuccess('afTest', 'ping', {}) end) -_AFT.describe("testAssertVerbResponseEquals",function() _AFT.assertVerbResponseEquals('afTest', 'ping', {}) end) -_AFT.describe("testAssertVerbCb",function() _AFT.assertVerbCb('afTest', 'ping', {},_callback) end) -_AFT.describe("testAssertVerbStatusError",function() _AFT.assertVerbStatusError('afTest', 'pingfail', {}) end) -_AFT.describe("testAssertVerbResponseEqualsError",function() _AFT.assertVerbResponseEqualsError('afTest', 'nonexistentverb', {},"Ping Binder Daemon fails") end) -_AFT.describe("testAssertVerbCbError",function() _AFT.assertVerbCbError('afTest', 'pingfail', {},_callbackError) end) +function _callbackError(responseJ) _AFT.assertStrContains(responseJ.request.info, "verb pingfail unknown within api aft") end + +_AFT.describe("testAssertVerbStatusSuccess",function() _AFT.assertVerbStatusSuccess('aft', 'ping', {}) end) +_AFT.describe("testAssertVerbResponseEquals",function() _AFT.assertVerbResponseEquals('aft', 'ping', {}) end) +_AFT.describe("testAssertVerbCb",function() _AFT.assertVerbCb('aft', 'ping', {},_callback) end) +_AFT.describe("testAssertVerbStatusError",function() _AFT.assertVerbStatusError('aft', 'pingfail', {}) end) +_AFT.describe("testAssertVerbResponseEqualsError",function() _AFT.assertVerbResponseEqualsError('aft', 'nonexistentverb', {},"Ping Binder Daemon fails") end) +_AFT.describe("testAssertVerbCbError",function() _AFT.assertVerbCbError('aft', 'pingfail', {},_callbackError) end) _AFT.exitAtEnd() -- cgit 1.2.3-korg