From 1f298e3a768502e61b8d12bdbf28f940df5f1c3e Mon Sep 17 00:00:00 2001 From: Erik Wramner Date: Mon, 29 Jul 2019 09:48:31 +0200 Subject: [PATCH] Wait and retry if added user fails to login in tests --- test/tests.bats | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/tests.bats b/test/tests.bats index d0a2ed38..bf561cb2 100644 --- a/test/tests.bats +++ b/test/tests.bats @@ -1434,6 +1434,12 @@ load 'test_helper/bats-assert/load' @test "checking setup.sh: email add login validation" { # validates that the user created previously with setup.sh can login + + if ! (docker exec mail doveadm auth test -x service=smtp setup_email_add@example.com 'test_password' >/dev/null); then + # Possibly the cron job has not had time to run yet, waiting a while is better than a false alarm + sleep 30 + fi + result=$(docker exec mail doveadm auth test -x service=smtp setup_email_add@example.com 'test_password' | grep 'auth succeeded') [ "$result" = "passdb: setup_email_add@example.com auth succeeded" ] }