Fix polling with pipes

This commit is contained in:
Martin Schulze 2019-08-17 12:23:41 +02:00
parent 43ae814776
commit a933ef27ac
1 changed files with 3 additions and 1 deletions

View File

@ -44,7 +44,9 @@ teardown_file() {
run docker exec mail_lmtp_ip /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-user1.txt"
assert_success
repeat_until_success_or_timeout 60 run docker exec mail_lmtp_ip /bin/sh -c "grep 'postfix/lmtp' /var/log/mail/mail.log | grep 'status=sent' | grep ' Saved)' | wc -l"
# polling needs to avoid wc -l's unconditionally successful return status
repeat_until_success_or_timeout 60 run docker exec mail_lmtp_ip /bin/sh -c "grep 'postfix/lmtp' /var/log/mail/mail.log | grep 'status=sent' | grep ' Saved)'"
run docker exec mail_lmtp_ip /bin/sh -c "grep 'postfix/lmtp' /var/log/mail/mail.log | grep 'status=sent' | grep ' Saved)' | wc -l"
assert_success
assert_output 1
}