diff --git a/tests/p_sendmail/20_sendmail_mta.sh b/tests/p_sendmail/20_sendmail_mta.sh index 2e249603..5f59f0d7 100755 --- a/tests/p_sendmail/20_sendmail_mta.sh +++ b/tests/p_sendmail/20_sendmail_mta.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Author: Christoph Galuschka t_Log "Running $0 - sendmail can accept and deliver local email." @@ -7,16 +7,16 @@ if [ "$CONTAINERTEST" -eq "1" ]; then exit 0 fi ret_val=1 +DELIVERED=1 # send mail to localhost mail=$(echo -e "helo localhost\nmail from: root@localhost\nrcpt to: root@localhost\ndata\nt_functional test\n.\nquit\n" | nc -w 5 127.0.0.1 25 | grep accepted) MTA_ACCEPT=$? -if [ $MTA_ACCEPT == 0 ] +if [ $MTA_ACCEPT = 0 ] then t_Log 'Mail has been queued successfully' fi -sleep 1 if [ "$centos_ver" -eq "8" ]; then t_Log "Dumping journalctl to /var/log/maillog" @@ -25,11 +25,18 @@ fi regex='250\ 2\.0\.0\ ([0-9A-Za-z]*)\ Message\ accepted\ for\ delivery' if [[ $mail =~ $regex ]] then - egrep -q "${BASH_REMATCH[1]}\:.*stat\=Sent" /var/log/maillog - DELIVERED=$? + for i in $(seq 1 60); do + egrep -q "${BASH_REMATCH[1]}\:.*stat\=Sent" /var/log/maillog + DELIVERED=$? + if [ "$DELIVERED" -ne 0 ];then + sleep 1 + else + break; + fi + done fi -if ([ $MTA_ACCEPT == 0 ] && [ $DELIVERED == 0 ]) +if [ $MTA_ACCEPT = 0 ] && [ $DELIVERED = 0 ] then ret_val=0 t_Log 'Mail has been delivered and removed from queue.' diff --git a/tests/p_squid/squid_test.sh b/tests/p_squid/squid_test.sh index ba818268..e4e4b4c8 100755 --- a/tests/p_squid/squid_test.sh +++ b/tests/p_squid/squid_test.sh @@ -3,9 +3,14 @@ t_Log "Running $0 - Squid test." -if [ $SKIP_QA_HARNESS -eq 1 ]; then - URL="http://mirror.centos.org/" - CHECK_FOR="timestamp" +if [ -z "$SKIP_QA_HARNESS" ];then + SKIP_QA_HARNESS=1 +fi + +if [ "$SKIP_QA_HARNESS" -eq 1 ]; then + URL="http://www.centos.org/" + #CHECK_FOR="timestamp" # Before 2024-12-13: https://web.archive.org/web/20241212132650/https://www.centos.org/ - RDA - 250109 + CHECK_FOR="CentOS Project" # After 2024-12-13 : https://web.archive.org/web/20241213163833/https://www.centos.org/ - RDA - 250109 else URL="http://repo.centos.qa/qa/" CHECK_FOR="ks_cfg"