opnsense-src/libexec/nuageinit/tests/adduser.lua
Jose Luis Duran 68c7c28d0e nuageinit: Lua check and lint files
Mostly white space, style, and luacheck compliance.

Signed-off-by: Jose Luis Duran <jlduran@gmail.com>
(cherry picked from commit 504981357aa36365784458cfe8d9e23097bfac7b)
2024-10-08 09:04:01 +02:00

16 lines
336 B
Lua

#!/usr/libexec/flua
local n = require("nuage")
if n.adduser() then
n.err("adduser should not accept empty value")
end
if n.adduser("plop") then
n.err("adduser should not accept empty value")
end
local pw = {}
pw.name = "impossible_username"
local res = n.adduser(pw)
if not res then
n.err("valid adduser should return a path")
end