summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-10-08 16:25:54 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-10 10:53:48 +0200
commit5cbc23886bfa33fdd77a9b95fc1dbedfeab06310 (patch)
tree34fa97f0dd94bfb4b0127f77bdc169b76a9ad737 /test
parenta525f24c3ee276323088708dee70ee9bf9ceddd0 (diff)
Test the LockWait feature
This commit adds a test that ensures that the timeout waiting an event expires correctly and that we correctly wait for the indicated time. Change-Id: I70c5aaf8d66588b4073cb772163d20344fdaf77c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'test')
-rw-r--r--test/afb-test/tests/mapi_tests.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/afb-test/tests/mapi_tests.lua b/test/afb-test/tests/mapi_tests.lua
index ced9ea0..e8cf142 100644
--- a/test/afb-test/tests/mapi_tests.lua
+++ b/test/afb-test/tests/mapi_tests.lua
@@ -31,3 +31,15 @@ _AFT.describe("Test_turning_on", function()
_AFT.assertEvtGrpReceived({[evt1] = 1, [evt2] = 1})
end)
+
+
+_AFT.describe("testLockWait",function()
+ local evt1 = "low-can/messages_engine_speed"
+ local timeout = 2000000
+ _AFT.addEventToMonitor(evt1)
+ local start = os.time() * 1000000
+ _AFT.assertEvtNotReceived(evt1, timeout)
+ local stop = os.time() * 1000000
+
+ _AFT.assertIsTrue( (stop - start) >= timeout, "Timeout not reached, LockWait feature is not working." )
+ end, nil, nil)