mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
better output, and allowing to use the lua script as is
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
|
||||
-- To run this test: run "lua test.lua" while in the same directory as chatctl.py
|
||||
|
||||
dovecot = {
|
||||
if dovecot == nil then
|
||||
dovecot = {
|
||||
auth = {
|
||||
PASSDB_RESULT_OK="OK",
|
||||
PASSDB_RESULT_PASSWORD_MISMATCH="MISMATCH"
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
-- Escape shell argument by hex encoding it and wrapping in quotes.
|
||||
function escape(data)
|
||||
@@ -57,14 +59,15 @@ end
|
||||
function test_ok(user, password)
|
||||
local res = auth_password_verify({user=user}, password)
|
||||
assert(res=="OK")
|
||||
print("OK test_ok "..user.." "..password)
|
||||
end
|
||||
|
||||
function test_mismatch(user, password)
|
||||
local res = auth_password_verify({user=user}, password)
|
||||
assert(res == "MISMATCH")
|
||||
print("OK test_mismatch "..user.." "..password)
|
||||
end
|
||||
|
||||
|
||||
test_ok("link2xt@instant2.testrun.org", "Ahyei6ie")
|
||||
test_mismatch("link2xt@instant2.testrun.org", "Aqwlek")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user