From 01f350fa0b776bae5f60c21a1ea1e63d403a90d5 Mon Sep 17 00:00:00 2001 From: missytake Date: Fri, 13 Oct 2023 20:15:07 +0200 Subject: [PATCH] make doveauth tests pass again --- doveauth/src/doveauth/doveauth.lua | 4 ++-- doveauth/src/doveauth/test_doveauth.py | 2 +- scripts/init.sh | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doveauth/src/doveauth/doveauth.lua b/doveauth/src/doveauth/doveauth.lua index f2f0df94..11dfccfb 100644 --- a/doveauth/src/doveauth/doveauth.lua +++ b/doveauth/src/doveauth/doveauth.lua @@ -8,7 +8,7 @@ end -- call out to python program to actually manage authentication for dovecot function chatctl_verify(user, password) - local cmd = "python3 /home/vmail/chatctl hexauth "..escape(user).." "..escape(password) + local cmd = "doveauth hexauth "..escape(user).." "..escape(password) print("executing: "..cmd) local handle = io.popen(cmd) local result = handle:read("*a") @@ -18,7 +18,7 @@ end function chatctl_lookup(user) assert(user) - local handle = io.popen("python3 /home/vmail/chatctl hexlookup "..escape(user)) + local handle = io.popen("doveauth hexlookup "..escape(user)) local result = handle:read("*a") handle:close() return split_chatctl(result) diff --git a/doveauth/src/doveauth/test_doveauth.py b/doveauth/src/doveauth/test_doveauth.py index cfd2cb33..4e3e0db7 100644 --- a/doveauth/src/doveauth/test_doveauth.py +++ b/doveauth/src/doveauth/test_doveauth.py @@ -1,7 +1,7 @@ import subprocess import pytest -from doveauth import get_user_data, verify_user +from doveauth.doveauth import get_user_data, verify_user def test_basic(): diff --git a/scripts/init.sh b/scripts/init.sh index 1dcabb53..6e203347 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -1,6 +1,8 @@ #!/bin/sh python3 -m venv chatmail-pyinfra/venv -chatmail-pyinfra/venv/bin/pip install pyinfra +chatmail-pyinfra/venv/bin/pip install pyinfra pytest chatmail-pyinfra/venv/bin/pip install -e chatmail-pyinfra +chatmail-pyinfra/venv/bin/pip install -e doveauth python3 -m venv doveauth/venv +doveauth/venv/bin/pip install pytest doveauth/venv/bin/pip install -e doveauth