diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-12 14:44:02 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2020-01-09 14:40:41 +0100 |
commit | 9cc8fe590162ec91000f1d81dbfd888616afc6ab (patch) | |
tree | 0284f90c2da72dc8d2f2af2aeef5a8a7765e6716 /test/afb-test | |
parent | 7d9324e95abdb505a8f422251b751b3af2cbcff4 (diff) |
test: Update tests with new transport
Bug-AGL: SPEC-2386
Change-Id: I3a0e4ea451f9e01fc13b7498b9eb20e81548ce5d
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'test/afb-test')
-rw-r--r-- | test/afb-test/tests/low-can_BasicAPITest.lua | 18 | ||||
-rw-r--r-- | test/afb-test/tests/low-can_FilterTest01.lua | 12 | ||||
-rw-r--r-- | test/afb-test/tests/low-can_J1939Test.lua | 20 |
3 files changed, 25 insertions, 25 deletions
diff --git a/test/afb-test/tests/low-can_BasicAPITest.lua b/test/afb-test/tests/low-can_BasicAPITest.lua index 2076d878..75a6cf24 100644 --- a/test/afb-test/tests/low-can_BasicAPITest.lua +++ b/test/afb-test/tests/low-can_BasicAPITest.lua @@ -46,19 +46,19 @@ end) _AFT.testVerbStatusError("low-can_write_wo_auth", "low-can", "write", { signal_name = "engine.speed", signal_value = 1234}) _AFT.testVerbStatusSuccess("low-can_auth", "low-can", "auth", {}) _AFT.testVerbStatusSuccess("low-can_write", "low-can", "write", { signal_name = "hvac.temperature.left", signal_value = 21}) -_AFT.testVerbStatusSuccess("low-can_write_raw", "low-can", "write", { bus_name= "hs", frame= { can_id= 1568, can_dlc=8, can_data= {255,255,255,255,255,255,255,255}}}) +_AFT.testVerbStatusSuccess("low-can_write_raw", "low-can", "write", { bus_name= "hs", frame= { can_id= 1568, can_dlc=8, can_data= {255, 255, 255, 255, 255, 255, 255, 255}}}) _AFT.testVerbStatusError("low-can_write_unwritable_signal", "low-can", "write", { signal_name = "vehicle.average.speed", signal_value = 1234}) _AFT.testVerbStatusError("low-can_write_wrong_name_key", "low-can", "write", { name = "hvac.temperature.left", signal_value = 21}) _AFT.testVerbStatusError("low-can_write_wrong_value_key", "low-can", "write", { signal_name = "hvac.temperature.left", value = 21}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_bus_key", "low-can", "write", { bus= "hs", frame= { can_id= 1568, can_dlc=8, can_data= {255,255,255,255,255,255,255,255}}}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_frame_key", "low-can", "write", { bus_name= "hs", fram= { can_id= 1568, can_dlc=8, can_data= {255,255,255,255,255,255,255,255}}}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_can_id_key", "low-can", "write", { bus_name= "hs", frame= { id= 1568, can_dlc=8, can_data= {255,255,255,255,255,255,255,255}}}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_can_id_args", "low-can", "write", { bus_name= "hs", frame= { can_id= "1568", can_dlc=8, can_data= {255,255,255,255,255,255,255,255}}}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_can_dlc_key", "low-can", "write", { bus_name= "hs", frame= { can_id= 1568, dlc=8, can_data= {255,255,255,255,255,255,255,255}}}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_can_dlc_args", "low-can", "write", { bus_name= "hs", frame= { can_id= 1568, dlc="8", can_data= {255,255,255,255,255,255,255,255}}}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_can_data_key", "low-can", "write", { bus= "hs", frame= { can_id= 1568, can_dlc=8, data= {255,255,255,255,255,255,255,255}}}) -_AFT.testVerbStatusError("low-can_write_raw_invalid_can_data_key", "low-can", "write", { bus= "hs", frame= { can_id= 1568, can_dlc=8, can_data= {"255",255,255,255,255,255,255,255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_bus_key", "low-can", "write", { bus= "hs", frame= { can_id= 1568, can_dlc=8, can_data= {255, 255, 255, 255, 255, 255, 255, 255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_frame_key", "low-can", "write", { bus_name= "hs", fram= { can_id= 1568, can_dlc=8, can_data= {255, 255, 255, 255, 255, 255, 255, 255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_can_id_key", "low-can", "write", { bus_name= "hs", frame= { id= 1568, can_dlc=8, can_data= {255, 255, 255, 255, 255, 255, 255, 255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_can_id_args", "low-can", "write", { bus_name= "hs", frame= { can_id= "1568", can_dlc=8, can_data= {255, 255, 255, 255, 255, 255, 255, 255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_can_dlc_key", "low-can", "write", { bus_name= "hs", frame= { can_id= 1568, dlc=8, can_data= {255, 255, 255, 255, 255, 255, 255, 255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_can_dlc_args", "low-can", "write", { bus_name= "hs", frame= { can_id= 1568, dlc="8", can_data= {255, 255, 255, 255, 255, 255, 255, 255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_can_data_key", "low-can", "write", { bus= "hs", frame= { can_id= 1568, can_dlc=8, data= {255, 255, 255, 255, 255, 255, 255, 255}}}) +_AFT.testVerbStatusError("low-can_write_raw_invalid_can_data_key", "low-can", "write", { bus= "hs", frame= { can_id= 1568, can_dlc=8, can_data= {"255", 255, 255, 255, 255, 255, 255, 255}}}) _AFT.testVerbStatusSuccess("low-can_list", "low-can", "list", {}) _AFT.testVerbStatusSuccess("low-can_get", "low-can", "get", { event = "engine.speed"}) diff --git a/test/afb-test/tests/low-can_FilterTest01.lua b/test/afb-test/tests/low-can_FilterTest01.lua index 028358f6..40d3f561 100644 --- a/test/afb-test/tests/low-can_FilterTest01.lua +++ b/test/afb-test/tests/low-can_FilterTest01.lua @@ -46,8 +46,8 @@ _AFT.setAfterAll( function() end) _AFT.describe("Filter_Test_01/Step_1", function() - _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname,data) - _AFT.assertEquals(data.name,evt) + _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname, data) + _AFT.assertEquals(data.name, evt) end) _AFT.assertVerbStatusSuccess(api ,"subscribe", { event = evt, filter = { min = 30, max = 100}}) @@ -62,7 +62,7 @@ function() end) _AFT.describe("Filter_Test_01/Step_2", function() - _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname,data) + _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname, data) _AFT.assertEquals(eventname, api.."/"..evt) _AFT.assertIsTrue(data.value > 30 and data.value < 100) end) @@ -81,10 +81,10 @@ end) _AFT.describe("Filter_Test_01/Step_3", function() _AFT.enableEventHistory() -- You will need this to check for time intervals between two events - _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname,data,dataH) - _AFT.assertEquals(dataH[1].name,evt) + _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname, data, dataH) + _AFT.assertEquals(dataH[1].name, evt) _AFT.assertIsTrue(dataH[1].value > 30 and dataH[1].value < 100 ) - _AFT.assertEquals(dataH[2].name,evt) + _AFT.assertEquals(dataH[2].name, evt) _AFT.assertIsTrue(dataH[2].value > 30 and dataH[2].value < 100 ) _AFT.assertIsTrue(dataH[2].timestamp - dataH[1].timestamp >= 1000000) end) diff --git a/test/afb-test/tests/low-can_J1939Test.lua b/test/afb-test/tests/low-can_J1939Test.lua index fc7649f3..3e855366 100644 --- a/test/afb-test/tests/low-can_J1939Test.lua +++ b/test/afb-test/tests/low-can_J1939Test.lua @@ -47,7 +47,7 @@ end) ########################################################### ####################### J1939 TESTS ####################### ########################################################### -]] +]] print("\n##########################################") print("######### BEGIN J1939 TESTS #########") @@ -84,7 +84,7 @@ end) +++++++++++ Tests write +++++++++++ -]] +]] --print("\n++++++++++++++++++++++++++") --print("++++ TESTS WRITE ++++") @@ -94,23 +94,23 @@ _AFT.describe("Test write", function() _AFT.testVerbStatusError("low-can_write_wo_auth", "low-can", "write", { signal_name = "Eng.Momentary.Overspeed.Enable", signal_value = 1}) _AFT.testVerbStatusSuccess("low-can_auth", "low-can", "auth", {}) _AFT.testVerbStatusSuccess("low-can_write_signal", "low-can", "write", { signal_name = "Eng.Momentary.Overspeed.Enable", signal_value = 1}) -_AFT.testVerbStatusSuccess("low-can_write_frame", "low-can", "write", { bus_name= "j1939", frame= { pgn= 62420, length=8, data= {1,2,3,4,5,6,7,8}}}) -_AFT.testVerbStatusSuccess("low-can_write_frame_other_pgn", "low-can", "write", { bus_name= "j1939", frame= { pgn= 126208, length=8, data= {9,10,11,12,13,14,15,16}}}) -_AFT.testVerbStatusError("low-can_write_frame_invalid_pgn", "low-can", "write", { bus_name= "j1939", frame= { pgn= 1234, length=8, data= {9,10,11,12,13,14,15,16}}}) -_AFT.testVerbStatusSuccess("low-can_write_multi_frame", "low-can", "write", { bus_name= "j1939", frame= { pgn= 126208, length=9, data= {9,10,11,12,13,14,15,16,17}}}) +_AFT.testVerbStatusSuccess("low-can_write_frame", "low-can", "write", { bus_name= "j1939", frame= { pgn= 62420, length=8, data= {1, 2, 3, 4, 5, 6, 7, 8}}}) +_AFT.testVerbStatusSuccess("low-can_write_frame_other_pgn", "low-can", "write", { bus_name= "j1939", frame= { pgn= 126208, length=8, data= {9, 10, 11, 12, 13, 14, 15, 16}}}) +_AFT.testVerbStatusError("low-can_write_frame_invalid_pgn", "low-can", "write", { bus_name= "j1939", frame= { pgn= 1234, length=8, data= {9, 10, 11, 12, 13, 14, 15, 16}}}) +_AFT.testVerbStatusSuccess("low-can_write_multi_frame", "low-can", "write", { bus_name= "j1939", frame= { pgn= 126208, length=9, data= {9, 10, 11, 12, 13, 14, 15, 16, 17}}}) end) --[[ ++++++++++ Tests read ++++++++++ -]] +]] local api = "low-can" local evt = "messages.Eng.Momentary.Overspeed.Enable" local evt2 = "messages.Actl.Eng.Prcnt.Trque.High.Resolution" _AFT.describe("Test subscribe read frame", function() - _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname,data) + _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname, data) _AFT.assertEquals(eventname, api.."/"..evt) end) @@ -128,7 +128,7 @@ end) ------------------------------------------------------------------------------ _AFT.describe("Test subscribe not read all frame", function() - _AFT.addEventToMonitor(api .. "/" ..evt2, function(eventname,data) + _AFT.addEventToMonitor(api .. "/" ..evt2, function(eventname, data) _AFT.assertEquals(eventname, api.."/"..evt2) end) @@ -147,7 +147,7 @@ end) --------------- _AFT.describe("Test subscribe read frame low time", function() - _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname,data) + _AFT.addEventToMonitor(api .. "/" ..evt, function(eventname, data) _AFT.assertEquals(eventname, api.."/"..evt) end) |