Index: ossp-pkg/lmtp2nntp/test.sh RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/test.sh,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/test.sh,v' 2>/dev/null --- test.sh 2002/02/06 13:51:38 1.11 +++ test.sh 2002/02/07 13:39:38 1.12 @@ -280,6 +280,41 @@ fi echo "yes" +echon "checking whether -h option adds header/value pair ... " +prolog +newmsg +./lmtp2nntp <${STDIN} -b - -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} -h "X-Gateway: added it!" ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} +RC=""; +if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready' | wc -l` ]; then RC="${RC}init "; fi +if [ 1 -eq `egrep <${L2FILE} 'adding.*header: "X-Gateway:"' | wc -l` ]; then RC="${RC}head "; fi +if [ 1 -eq `egrep <${L2FILE} 'adding.*header: "added it!"' | wc -l` ]; then RC="${RC}val. "; fi +if [ 1 -eq `egrep <${L2FILE} 'verbatim.*"X-Gateway: added it!"' | wc -l` ]; then RC="${RC}pair "; fi +if [ "${RC}" != "init head val. pair " ]; then + echo "NO (got ${RC})" + echo "STDIN cat ${STDIN}" + echo "STDOUT cat ${STDOUT}" + echo "STDERR cat ${STDERR}" + echo "LOG cat ${L2FILE}" + exit 1; +fi +echo "yes" + +echon "checking whether -r option rejects headers ... " +prolog +newmsg +./lmtp2nntp <${STDIN} -b - -c ${LOCAL} -o 250/2.0.0 -g arg -d ${HOST} -r'^X-Linefoldingtest:.*begun.$' ${LOG} -m "${MFILT}" -n ${NODE} -s 1500 --timeoutnntpconnect=1 ${GROUP} >${STDOUT} 2>${STDERR} +RC=""; +if [ 1 -eq `egrep <${STDOUT} '^220[- ]LMTP Service ready' | wc -l` ]; then RC="${RC}init "; fi +if [ 1 -eq `egrep <${L2FILE} 'restricted header found' | wc -l` ]; then RC="${RC}rest "; fi +if [ "${RC}" != "init rest " ]; then + echo "NO (got ${RC})" + echo "STDIN cat ${STDIN}" + echo "STDOUT cat ${STDOUT}" + echo "STDERR cat ${STDERR}" + echo "LOG cat ${L2FILE}" + exit 1; +fi +echo "yes" echo "CHECK COMPLETE AND PASSED" #epilog exit 0