summaryrefslogtreecommitdiffstats
path: root/test/afb-test/tests
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-09 21:03:38 +0000
commit1a33ac27fa87b013ca6dc95be53b5b8a40a8f197 (patch)
tree86641a200a83048441c94b1327d6b92ef0c34281 /test/afb-test/tests
parent52f416b5d9e98ac741bf53dad12378d0d3e9c567 (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: Ic9aeb32d09b45af0d75c8c51fa421b8f5a25f39c Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'test/afb-test/tests')
-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)