mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
test: Rename test directories to use an explicit order
For convenience, rename the directories so the order is explicit in the name. Make the simple test run first, to save time if it's not working.
This commit is contained in:
57
test/t-02-exim/run.sh
Executable file
57
test/t-02-exim/run.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This test checks that we can send and receive mail to/from exim4.
|
||||
#
|
||||
# Setup:
|
||||
# - chasquid listening on :1025.
|
||||
# - exim listening on :2025.
|
||||
# - hosts "srv-chasquid" and "srv-exim" pointing back to localhost.
|
||||
# - exim configured to accept all email and forward it to
|
||||
# someone@srv-chasquid.
|
||||
#
|
||||
# Test:
|
||||
# msmtp --> chasquid --> exim --> chasquid --> local delivery
|
||||
#
|
||||
# msmtp will auth as user@srv-chasquid to chasquid, and send an email with
|
||||
# recipient someone@srv-exim.
|
||||
#
|
||||
# chasquid will deliver the mail to exim.
|
||||
#
|
||||
# exim will deliver the mail back to chasquid (after changing the
|
||||
# destination to someone@chasquid).
|
||||
#
|
||||
# chasquid will receive the email from exim, and deliver it locally.
|
||||
|
||||
set -e
|
||||
. $(dirname ${0})/../util/lib.sh
|
||||
|
||||
init
|
||||
|
||||
# Create a temporary directory for exim4 to use, and generate the exim4
|
||||
# config based on the template.
|
||||
mkdir -p .exim4
|
||||
EXIMDIR="$PWD/.exim4" envsubst < config/exim4.in > .exim4/config
|
||||
|
||||
generate_certs_for srv-chasquid
|
||||
|
||||
# Launch chasquid at port 1025 (in config).
|
||||
# Use outgoing port 2025 which is where exim will be at.
|
||||
# Bypass MX lookup, so it can find srv-exim (via our host alias).
|
||||
chasquid -v=2 --log_dir=.logs --config_dir=config \
|
||||
--testing__outgoing_smtp_port=2025 \
|
||||
--testing__bypass_mx_lookup &
|
||||
|
||||
wait_until_ready 1025
|
||||
|
||||
# Launch exim at port 2025
|
||||
.exim4/exim4 -bd -d -C "$PWD/.exim4/config" > .exim4/log 2>&1 &
|
||||
wait_until_ready 2025
|
||||
|
||||
# msmtp will use chasquid to send an email to someone@srv-exim.
|
||||
run_msmtp someone@srv-exim < content
|
||||
|
||||
wait_for_file .mail/someone@srv-chasquid
|
||||
|
||||
mail_diff content .mail/someone@srv-chasquid
|
||||
|
||||
success
|
||||
Reference in New Issue
Block a user