mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-22 15:27:02 +00:00
test: Unify (most) SMTP client calls
To send mails, today some tests use msmtp and others our internal smtpc.py. This works, but msmtp slows down the tests significantly, and smtpc.py is also not particularly fast, and also has some limitations. This patch introduces a new SMTP client tool written in Go, and makes almost all the tests use it. Some tests still remain on msmtp, mainly for client-check compatibility. It's likely that this will be moved in later patches to a separate special-purpose test. With this patch, integration tests take ~20% less time than before.
This commit is contained in:
@@ -22,7 +22,7 @@ chasquid -v=2 --logfile=.logs/chasquid.log --config_dir=config \
|
||||
wait_until_ready 1025
|
||||
|
||||
# First, check that delivery fails with the "wrong" password.
|
||||
if run_msmtp someone@testserver < content 2>/dev/null; then
|
||||
if smtpc someone@testserver < content 2>/dev/null; then
|
||||
fail "success using the wrong password"
|
||||
fi
|
||||
|
||||
@@ -32,7 +32,7 @@ chasquid-util-user-add someone@testserver password222
|
||||
echo "analias: someone" > config/domains/testserver/aliases
|
||||
sleep 0.2
|
||||
|
||||
run_msmtp analias@testserver < content
|
||||
smtpc analias@testserver < content
|
||||
wait_for_file .mail/someone@testserver
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ sleep 0.2
|
||||
|
||||
# Send another mail.
|
||||
rm .mail/someone@testserver
|
||||
run_msmtp analias@testserver < content
|
||||
smtpc analias@testserver < content
|
||||
wait_for_file .mail/someone@testserver
|
||||
|
||||
# Check there are new entries.
|
||||
|
||||
Reference in New Issue
Block a user