OSSP CVS Repository

ossp - Check-in [1828]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1828
Date: 2002-Feb-07 14:39:38 (local)
2002-Feb-07 13:39:38 (UTC)
User:thl
Branch:
Comment: added test suite for --headervalue and --restrictheader
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/test.sh      1.11 -> 1.12     37 inserted, 2 deleted

ossp-pkg/lmtp2nntp/test.sh 1.11 -> 1.12

--- test.sh      2002/02/06 13:51:38     1.11
+++ test.sh      2002/02/07 13:39:38     1.12
@@ -16,10 +16,10 @@
 Message-Id: <200108141251.f7ECpmn74812@dev.de.cw.net>
 From: Thomas Lotterer <Thomas.Lotterer@example.com>
 Received: from cw.example.com (cw.example.com [10.1.1.32])
-    by gateway.example.com (8.9.2/8.9.2/$Revision: 1.11 $) with SMTP id NAA08840
+    by gateway.example.com (8.9.2/8.9.2/$Revision: 1.12 $) with SMTP id NAA08840
     for <thomas.lotterer@gateway.example.com>; Mon, 2 Apr 2001 13:20:25 +0200 (MET DST)
 Received: from history (history.example.org [195.143.102.41])
-    by cw.example.com (8.11.0/8.11.0/$Revision: 1.11 $) with ESMTP id f32BKPb12235
+    by cw.example.com (8.11.0/8.11.0/$Revision: 1.12 $) with ESMTP id f32BKPb12235
     for <thomas.lotterer@example.com>; Mon, 2 Apr 2001 13:20:25 +0200
 Received: from example.org (littlemua.example.org [195.143.103.160])
         by history (8.8.8/8.8.8) with ESMTP id LAA12678;
@@ -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

CVSTrac 2.0.1