use wait_for_smtp function instead of sleep

This commit is contained in:
Georg Lauterbach 2020-11-06 14:11:42 +01:00
parent ed7106b04d
commit 2c65b0c260
No known key found for this signature in database
GPG key ID: 386D76E7AD496709

View file

@ -63,7 +63,8 @@ function teardown_file() {
assert_success assert_success
run docker exec mail_smtponly /bin/sh -c "/etc/init.d/postfix reload" run docker exec mail_smtponly /bin/sh -c "/etc/init.d/postfix reload"
assert_success assert_success
sleep 5
wait_for_smtp_port_in_container mail_smtponly
run docker exec mail_smtponly /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/smtp-only.txt" run docker exec mail_smtponly /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/smtp-only.txt"
assert_success assert_success
run docker exec mail_smtponly /bin/sh -c 'grep -cE "to=<user2\@external.tld>.*status\=sent" /var/log/mail/mail.log' run docker exec mail_smtponly /bin/sh -c 'grep -cE "to=<user2\@external.tld>.*status\=sent" /var/log/mail/mail.log'