Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Nov 6, 2023
1 parent fc9b937 commit da88b62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/functional/lib/bash/test_header
Original file line number Diff line number Diff line change
Expand Up @@ -805,14 +805,13 @@ mock_smtpd_init() { # Logic borrowed from Rose
# Try several ports in case any are in use:
for SMTPD_PORT in 8025 8125 8225 8325 8425 8525 8625 8725 8825 8925; do
local SMTPD_LOG="${TEST_DIR}/smtpd.log"
echo $SMTPD_LOG >&2
local SMTPD_HOST="localhost:${SMTPD_PORT}"
# Set up fake SMTP server to catch outgoing mail & redirect to log:
python3 -u -m 'aiosmtpd' -c aiosmtpd.handlers.Debugging stderr -d -n -l \
"${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 All @@ -822,6 +821,7 @@ mock_smtpd_init() { # Logic borrowed from Rose
break
fi
done
echo "ici" >&2
if [[ -n "${SMTPD_PID:-}" ]]; then
# Variables used by tests
# shellcheck disable=SC2034
Expand Down

0 comments on commit da88b62

Please sign in to comment.