From 87c52a5399b7458dc98867f39c70be692d5d02c8 Mon Sep 17 00:00:00 2001 From: Athmane Madjoudj Date: Mar 24 2012 21:35:51 +0000 Subject: Add timeout to dovecot tests --- diff --git a/tests/p_dovecot/dovecot_imap_login.sh b/tests/p_dovecot/dovecot_imap_login.sh index bba4a75..94b4891 100755 --- a/tests/p_dovecot/dovecot_imap_login.sh +++ b/tests/p_dovecot/dovecot_imap_login.sh @@ -13,14 +13,14 @@ chown -R imaptest:imaptest /home/imaptest/mail/.imap/INBOX ret_val=1 t_Log "Dovecot IMAP login test" -echo -e "01 LOGIN imaptest imaptest\n" | nc localhost 143 | grep -q "Logged in." +echo -e "01 LOGIN imaptest imaptest\n" | nc -w 5 localhost 143 | grep -q "Logged in." ret_val=$? if [ $ret_val == 1 ] then t_Log "Sometimes the first login fails (reason yet unknown to me)" t_Log "Trying a second time, as this seems to work, if not somethings really not working" - echo -e "01 LOGIN imaptest imaptest\n" | nc localhost 143 | grep -q "Logged in." + echo -e "01 LOGIN imaptest imaptest\n" | nc -w 5 localhost 143 | grep -q "Logged in." ret_val=$? fi diff --git a/tests/p_dovecot/dovecot_pop3_login.sh b/tests/p_dovecot/dovecot_pop3_login.sh index 49da1c1..4ac3320 100755 --- a/tests/p_dovecot/dovecot_pop3_login.sh +++ b/tests/p_dovecot/dovecot_pop3_login.sh @@ -11,7 +11,7 @@ mkdir -m 700 -p /home/pop3test/mail/.imap/INBOX chown -R pop3test:pop3test /home/pop3test/mail/.imap/INBOX t_Log "Dovecot POP3 login test" -echo -e "user pop3test\npass pop3test\n" | nc localhost 110 | grep -q "+OK Logged in." +echo -e "user pop3test\npass pop3test\n" | nc -w 5 localhost 110 | grep -q "+OK Logged in." t_CheckExitStatus $?