summaryrefslogtreecommitdiffstats
path: root/conf.d/controller/lua.d/mapi_tests.lua
diff options
context:
space:
mode:
Diffstat (limited to 'conf.d/controller/lua.d/mapi_tests.lua')
-rw-r--r--conf.d/controller/lua.d/mapi_tests.lua32
1 files changed, 7 insertions, 25 deletions
diff --git a/conf.d/controller/lua.d/mapi_tests.lua b/conf.d/controller/lua.d/mapi_tests.lua
index 1111a2d..abd65cb 100644
--- a/conf.d/controller/lua.d/mapi_tests.lua
+++ b/conf.d/controller/lua.d/mapi_tests.lua
@@ -21,31 +21,13 @@
_AFT.testVerbStatusSuccess("TestListverb", "low-can", "list", {})
_AFT.testVerbStatusSuccess("TestGetVerb", "low-can", "get", { event = "engine.speed"})
-_AFT.testCustom("Test_detection_is_off", function()
- local logMsg = "signal: Engine is off, diagnostic_messages.engine.speed won't received responses until it's on"
- _AFT.addLogToMonitor("low-can", "warning", logMsg)
+_AFT.describe("Test_turning_on", function()
+ local evt1 = "low-can/messages_engine_speed"
+ local evt2 = "low-can/messages_vehicle_speed"
+ _AFT.addEventToMonitor(evt1)
+ _AFT.addEventToMonitor(evt2)
- _AFT.assertVerbStatusSuccess("low-can","subscribe", { event = "diagnostic_messages.engine.speed" })
- _AFT.assertLogReceived(logMsg)
- _AFT.assertVerbStatusSuccess("low-can","unsubscribe", { event = "diagnostic_messages.engine.speed" })
-end)
-
-_AFT.testCustom("Test_turning_on", function()
- _AFT.assertVerbStatusSuccess("low-can","subscribe", { event = "diagnostic_messages.engine.speed" })
-
- local evt = "low-can/diagnostic_messages"
- local logMsg = "signal: Engine is off, diagnostic_messages.engine.speed won't received responses until it's on"
- _AFT.addLogToMonitor("low-can", "warning", logMsg)
- _AFT.addEventToMonitor(evt)
-
- local ret = os.execute("./var/replay_launcher.sh ./var/test1.canreplay")
- _AFT.assertIsTrue(ret)
-
- _AFT.assertEvtReceived(evt, function(eventName, data)
- _AFT.assertIsTrue(data.name == "diagnostic_messages.engine.speed")
- end)
-
- _AFT.assertLogNotReceived(logMsg)
+ _AFT.assertVerb("low-can", "get", {})
- _AFT.assertVerbStatusSuccess("low-can","unsubscribe", { event = "diagnostic_messages.engine.speed" })
+ _AFT.assertEvtGrpReceived({evt1, evt2})
end)