aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-11-21 14:24:40 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2018-11-22 11:10:26 +0100
commitb049485873e1692cc9e7857e91e017f86dd91218 (patch)
tree3a1c3626f58ffcb7d1760d24a4fcde774f9f8ef1 /test
parent99682db67048b828705c9afe14d53b8305a07392 (diff)
Adds more tests about writing on CAN busguppy_6.99.2guppy_6.99.1guppy/6.99.2guppy/6.99.16.99.26.99.1
This commit adds comprehensive tests about writing messages on CAN bus. Increase timeout to use in native test to be able to complete the test suite. Bug-AGL: SPEC-1965 Change-Id: Ica555dbac1038bb50e5f76c516c1198a78475a9e Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt2
-rw-r--r--test/afb-test/tests/low-can_BasicAPITest.lua13
2 files changed, 13 insertions, 2 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index eea43f76..86730f22 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -23,5 +23,5 @@ PROJECT_SUBDIRS_ADD(${PROJECT_SRC_DIR_PATTERN})
ADD_TEST(NAME AGL_SERVICE_CAN_LOW_LEVEL_TESTS
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
- COMMAND afm-test ${CMAKE_BINARY_DIR}/package ${CMAKE_BINARY_DIR}/package-test
+ COMMAND afm-test ${CMAKE_BINARY_DIR}/package ${CMAKE_BINARY_DIR}/package-test -t 10
)
diff --git a/test/afb-test/tests/low-can_BasicAPITest.lua b/test/afb-test/tests/low-can_BasicAPITest.lua
index 59e10d0e..c59b1a70 100644
--- a/test/afb-test/tests/low-can_BasicAPITest.lua
+++ b/test/afb-test/tests/low-can_BasicAPITest.lua
@@ -41,10 +41,21 @@ 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.testVerbStatusError("low-can_write_unwritable_signal", "low-can", "write", { signal_name = "engine.speed", signal_value = 1234})
_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.testVerbStatusError("low-can_write_unwritable_signal", "low-can", "write", { signal_name = "engine.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.testVerbStatusSuccess("low-can_list", "low-can", "list", {})
_AFT.testVerbStatusSuccess("low-can_get", "low-can", "get", { event = "engine.speed"})