Skip to content

Commit

Permalink
replace smtpd with aiosmtpd in the test_header file
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Nov 6, 2023
1 parent 3183cab commit d80996e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ report-timings =
pandas==1.*
matplotlib
tests =
aiosmtpd
async_generator
bandit>=1.7.0
coverage>=5.0.0,<7.3.1
Expand Down
7 changes: 5 additions & 2 deletions tests/functional/lib/bash/test_header
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,13 @@ mock_smtpd_init() { # Logic borrowed from Rose
local SMTPD_LOG="${TEST_DIR}/smtpd.log"
local SMTPD_HOST="localhost:${SMTPD_PORT}"
# Set up fake SMTP server to catch outgoing mail & redirect to log:
python3 -u -m 'smtpd' -c 'DebuggingServer' -d -n "${SMTPD_HOST}" \
python3 -u -m 'aiosmtpd' \
--class aiosmtpd.handlers.Debugging stderr \
--debug --nosetuid \
--listen "${SMTPD_HOST}" \
1>"${SMTPD_LOG}" 2>&1 & # Runs in background
local SMTPD_PID="$!"
while ! grep -q 'DebuggingServer started' "${SMTPD_LOG}" 2>'/dev/null'
while ! grep -q 'is listening' "${SMTPD_LOG}" 2>'/dev/null'
do
if ps "${SMTPD_PID}" 1>/dev/null 2>&1; then
sleep 1 # Still waiting for fake server to start
Expand Down

0 comments on commit d80996e

Please sign in to comment.