Open ahupowerdns opened 5 years ago
Ideally it would also allow passing command line arguments, but that might be hard to implement with the option parser.
I currently pass them through an env var and unpack them in the script:
local args = os.getenv('recursor_lua_args')
if args and #args > 0 then
_G.arg = utils.split(args, ' ')
end
As noted in #3211 we need more test for our Lua stuff. Right now, it is not straightforward to automate such tests. We can launch the Recursor with a Lua test script, but then the recursor stays up and running, and it is hard to communicate the result of tests to a test framework.
It would be great if we could do this:
The test.lua script could either return a code (like '1'), and we'd pass that on to the operating system, or it could call os.exit(1) directly, and we'd return that.
The test.lua script would run with all the facilities of a regular PowerDNS Lua script.
Usecase
Write better tests.