aboutsummaryrefslogtreecommitdiffstats
path: root/conf.d/controller/lua.d
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-08-20 19:05:57 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-08-22 11:24:29 +0200
commitee15040e18a660bb5fcac87450620b35596db9ad (patch)
tree1cadafa2c6f0700a0aa17e22b82814ab068c0e0f /conf.d/controller/lua.d
parent91d3627b5f737e1b113c52e7364cdf18f174e70f (diff)
Make the binding root directory available
This lets the test lua scripts use this variable to be able to retrieve fixtures files which lie in the 'var' directory Change-Id: Iad321706bd05dfb8e5f0423a15d710fdc540c154 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/controller/lua.d')
-rw-r--r--conf.d/controller/lua.d/aft.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/conf.d/controller/lua.d/aft.lua b/conf.d/controller/lua.d/aft.lua
index 917d175..428dd2f 100644
--- a/conf.d/controller/lua.d/aft.lua
+++ b/conf.d/controller/lua.d/aft.lua
@@ -25,6 +25,7 @@ lu.LuaUnit.fname = "xUnitResults.xml"
_AFT = {
exit = {0, code},
context = _ctx,
+ bindingRootDir = nil,
tests_list = {},
event_history = false,
monitored_events = {},
@@ -580,7 +581,7 @@ end
function _launch_test(context, args)
_AFT.context = context
- local bindingRootDir = AFB:getrootdir(_AFT.context)
+ _AFT.bindingRootDir = AFB:getrootdir(_AFT.context)
local loadedfile = nil
-- Prepare the tests execution configuring the monitoring and loading
@@ -598,12 +599,12 @@ function _launch_test(context, args)
if args.files and type(args.files) == 'table' then
for _,f in pairs(args.files) do
- local cmdHandle = io.popen('find '..bindingRootDir..' -name '..f)
+ local cmdHandle = io.popen('find '.. _AFT.bindingRootDir..' -name '..f)
loadedfile = dofile(cmdHandle:read())
cmdHandle:close()
end
elseif type(args.files) == 'string' then
- local cmdHandle = io.popen('find '..bindingRootDir..' -name '..args.files)
+ local cmdHandle = io.popen('find '.._AFT.bindingRootDir..' -name '..args.files)
loadedfile = dofile(cmdHandle:read())
cmdHandle:close()
end