From c57e2420570a40e3978e7f951734423ac6fa5daa Mon Sep 17 00:00:00 2001 From: Fabian Arrotin Date: May 21 2014 06:14:08 +0000 Subject: Change to the p_sendmail test for el7 --- diff --git a/tests/p_sendmail/30_sendmail_mta_ehlo.sh b/tests/p_sendmail/30_sendmail_mta_ehlo.sh index 63376bb..7d9df26 100755 --- a/tests/p_sendmail/30_sendmail_mta_ehlo.sh +++ b/tests/p_sendmail/30_sendmail_mta_ehlo.sh @@ -1,31 +1,31 @@ -#!/bin/sh +#!/bin/bash # Author: Christoph Galuschka t_Log "Running $0 - sendmail can accept and deliver local email using ESMTP." -MAILSPOOL=/var/spool/mail/root +MAILSPOOL="/var/spool/mail/root" # make shure spool file is empty -cat /dev/null > $MAILSPOOL +cat /dev/null > ${MAILSPOOL} ret_val=1 # send mail to localhost echo -e "ehlo localhost\nmail from: root@localhost\nrcpt to: root@localhost\ndata\nt_functional test\n.\nquit\n" | nc -4 -w 5 localhost 25 | grep -q "250 2.0.0" -if [ $? = 0 ] +if [ "$?" = "0" ] then t_Log 'Mail has been queued successfully' - MTA_ACCEPT=0 + MTA_ACCEPT="0" fi -sleep 1 -grep -q 't_functional test' $MAILSPOOL -if [ $? = 0 ] +sleep 3 +grep -q 't_functional test' ${MAILSPOOL} +if [ "$?" = "0" ] then - t_Log 'previously sent mail is in '$MAILSPOOL - SPOOLFILE=0 + t_Log "previously sent mail is in ${MAILSPOOL}" + SPOOLFILE="0" fi -if [ "$MTA_ACCEPT" = "0" ] && [ "$SPOOLFILE" = "0" ] ; then +if [[ "$MTA_ACCEPT" = "0" && "$SPOOLFILE" = "0" ]] ; then ret_val=0 fi