]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - test/run-stp-tests.sh
Merge changes from CUPS 1.6svn-r9939.
[thirdparty/cups.git] / test / run-stp-tests.sh
index 013e4283bb4e83da9438d87bd7c4572ca355e8b1..fa943fc95b644d86a3c0be0923d2914e053e3665 100755 (executable)
@@ -5,7 +5,7 @@
 #   Perform the complete set of IPP compliance tests specified in the
 #   CUPS Software Test Plan.
 #
-#   Copyright 2007-2010 by Apple Inc.
+#   Copyright 2007-2011 by Apple Inc.
 #   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -23,11 +23,21 @@ argcount=$#
 
 make
 
+#
+# Solaris has a non-POSIX grep in /bin...
+#
+
+if test -x /usr/xpg4/bin/grep; then
+       GREP=/usr/xpg4/bin/grep
+else
+       GREP=grep
+fi
+
 #
 # Figure out the proper echo options...
 #
 
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+if (echo "testing\c"; echo 1,2,3) | $GREP c >/dev/null; then
         ac_n=-n
         ac_c=
 else
@@ -240,8 +250,7 @@ ln -s $root/backend/http /tmp/cups-$user/bin/backend
 ln -s $root/backend/ipp /tmp/cups-$user/bin/backend
 ln -s $root/backend/lpd /tmp/cups-$user/bin/backend
 ln -s $root/backend/mdns /tmp/cups-$user/bin/backend
-ln -s $root/backend/parallel /tmp/cups-$user/bin/backend
-ln -s $root/backend/serial /tmp/cups-$user/bin/backend
+ln -s $root/backend/pseudo /tmp/cups-$user/bin/backend
 ln -s $root/backend/snmp /tmp/cups-$user/bin/backend
 ln -s $root/backend/socket /tmp/cups-$user/bin/backend
 ln -s $root/backend/usb /tmp/cups-$user/bin/backend
@@ -249,14 +258,13 @@ ln -s $root/cgi-bin /tmp/cups-$user/bin
 ln -s $root/monitor /tmp/cups-$user/bin
 ln -s $root/notifier /tmp/cups-$user/bin
 ln -s $root/scheduler /tmp/cups-$user/bin/daemon
-ln -s $root/filter/bannertops /tmp/cups-$user/bin/filter
 ln -s $root/filter/commandtops /tmp/cups-$user/bin/filter
 ln -s $root/filter/gziptoany /tmp/cups-$user/bin/filter
-ln -s $root/filter/hpgltops /tmp/cups-$user/bin/filter
 ln -s $root/filter/pstops /tmp/cups-$user/bin/filter
 ln -s $root/filter/rastertoepson /tmp/cups-$user/bin/filter
 ln -s $root/filter/rastertohp /tmp/cups-$user/bin/filter
-ln -s $root/filter/texttops /tmp/cups-$user/bin/filter
+ln -s $root/filter/rastertolabel /tmp/cups-$user/bin/filter
+ln -s $root/filter/rastertopwg /tmp/cups-$user/bin/filter
 
 ln -s $root/data/classified /tmp/cups-$user/share/banners
 ln -s $root/data/confidential /tmp/cups-$user/share/banners
@@ -264,10 +272,7 @@ ln -s $root/data/secret /tmp/cups-$user/share/banners
 ln -s $root/data/standard /tmp/cups-$user/share/banners
 ln -s $root/data/topsecret /tmp/cups-$user/share/banners
 ln -s $root/data/unclassified /tmp/cups-$user/share/banners
-ln -s $root/data /tmp/cups-$user/share/charmaps
-ln -s $root/data /tmp/cups-$user/share/charsets
 ln -s $root/data /tmp/cups-$user/share
-ln -s $root/fonts /tmp/cups-$user/share
 ln -s $root/ppdc/sample.drv /tmp/cups-$user/share/drv
 ln -s $root/conf/mime.types /tmp/cups-$user/share/mime
 ln -s $root/conf/mime.convs /tmp/cups-$user/share/mime
@@ -290,6 +295,8 @@ if test `uname` = Darwin; then
        ln -s /usr/libexec/cups/filter/pstoappleps /tmp/cups-$user/bin/filter
        ln -s /usr/libexec/cups/filter/pstocupsraster /tmp/cups-$user/bin/filter
        ln -s /usr/libexec/cups/filter/pstopdffilter /tmp/cups-$user/bin/filter
+       ln -s /usr/libexec/cups/filter/rastertourf /tmp/cups-$user/bin/filter
+       ln -s /usr/libexec/cups/filter/xhtmltopdf /tmp/cups-$user/bin/filter
 
        if test -f /private/etc/cups/apple.types; then
                ln -s /private/etc/cups/apple.* /tmp/cups-$user/share/mime
@@ -297,9 +304,13 @@ if test `uname` = Darwin; then
                ln -s /usr/share/cups/mime/apple.* /tmp/cups-$user/share/mime
        fi
 else
-       ln -s $root/filter/imagetops /tmp/cups-$user/bin/filter
-       ln -s $root/filter/imagetoraster /tmp/cups-$user/bin/filter
-       ln -s $root/filter/pdftops /tmp/cups-$user/bin/filter
+       ln -s /usr/lib/cups/filter/bannertops /tmp/cups-$user/bin/filter
+       ln -s /usr/lib/cups/filter/imagetops /tmp/cups-$user/bin/filter
+       ln -s /usr/lib/cups/filter/imagetoraster /tmp/cups-$user/bin/filter
+       ln -s /usr/lib/cups/filter/pdftops /tmp/cups-$user/bin/filter
+       ln -s /usr/lib/cups/filter/texttops /tmp/cups-$user/bin/filter
+
+       ln -s /usr/share/cups/mime/legacy.convs /tmp/cups-$user/share/mime
 fi
 
 #
@@ -453,6 +464,9 @@ export HOME
 LANG=C
 export LANG
 
+LC_MESSAGES=C
+export LC_MESSAGES
+
 #
 # Start the server; run as foreground daemon in the background...
 #
@@ -529,7 +543,7 @@ done
 #
 
 date=`date "+%Y-%m-%d"`
-strfile=/tmp/cups-$user/cups-str-1.5-$date-$user.html
+strfile=/tmp/cups-$user/cups-str-1.6-$date-$user.html
 
 rm -f $strfile
 cat str-header.html >$strfile
@@ -625,7 +639,7 @@ else
 fi
 
 # Pages printed on Test1 (within 1 page for timing-dependent cancel issues)
-count=`grep '^Test1 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
+count=`$GREP '^Test1 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
 expected=`expr $pjobs \* 2 + 34`
 expected2=`expr $expected + 2`
 if test $count -lt $expected -a $count -gt $expected2; then
@@ -638,7 +652,7 @@ else
 fi
 
 # Paged printed on Test2
-count=`grep '^Test2 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
+count=`$GREP '^Test2 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
 expected=`expr $pjobs \* 2 + 3`
 if test $count != $expected; then
        echo "FAIL: Printer 'Test2' produced $count page(s), expected $expected."
@@ -651,7 +665,7 @@ fi
 
 # Requests logged
 count=`wc -l /tmp/cups-$user/log/access_log | awk '{print $1}'`
-expected=`expr 39 + 18 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
+expected=`expr 37 + 18 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
 if test $count != $expected; then
        echo "FAIL: $count requests logged, expected $expected."
        echo "<P>FAIL: $count requests logged, expected $expected.</P>" >>$strfile
@@ -662,11 +676,11 @@ else
 fi
 
 # Did CUPS-Get-Default get logged?
-if grep -q CUPS-Get-Default /tmp/cups-$user/log/access_log; then
+if $GREP -q CUPS-Get-Default /tmp/cups-$user/log/access_log; then
        echo "FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'"
        echo "<P>FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'</P>" >>$strfile
        echo "<PRE>" >>$strfile
-       grep CUPS-Get-Default /tmp/cups-$user/log/access_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+       $GREP CUPS-Get-Default /tmp/cups-$user/log/access_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile
        fail=`expr $fail + 1`
 else
@@ -675,13 +689,13 @@ else
 fi
 
 # Emergency log messages
-count=`grep '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count emergency messages, expected 0."
-       grep '^X ' /tmp/cups-$user/log/error_log
+       $GREP '^X ' /tmp/cups-$user/log/error_log
        echo "<P>FAIL: $count emergency messages, expected 0.</P>" >>$strfile
        echo "<PRE>" >>$strfile
-       grep '^X ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+       $GREP '^X ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile
        fail=`expr $fail + 1`
 else
@@ -690,13 +704,13 @@ else
 fi
 
 # Alert log messages
-count=`grep '^A ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^A ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count alert messages, expected 0."
-       grep '^A ' /tmp/cups-$user/log/error_log
+       $GREP '^A ' /tmp/cups-$user/log/error_log
        echo "<P>FAIL: $count alert messages, expected 0.</P>" >>$strfile
        echo "<PRE>" >>$strfile
-       grep '^A ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+       $GREP '^A ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile
        fail=`expr $fail + 1`
 else
@@ -705,13 +719,13 @@ else
 fi
 
 # Critical log messages
-count=`grep '^C ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^C ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count critical messages, expected 0."
-       grep '^C ' /tmp/cups-$user/log/error_log
+       $GREP '^C ' /tmp/cups-$user/log/error_log
        echo "<P>FAIL: $count critical messages, expected 0.</P>" >>$strfile
        echo "<PRE>" >>$strfile
-       grep '^C ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+       $GREP '^C ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile
        fail=`expr $fail + 1`
 else
@@ -720,13 +734,13 @@ else
 fi
 
 # Error log messages
-count=`grep '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 18; then
        echo "FAIL: $count error messages, expected 18."
-       grep '^E ' /tmp/cups-$user/log/error_log
+       $GREP '^E ' /tmp/cups-$user/log/error_log
        echo "<P>FAIL: $count error messages, expected 18.</P>" >>$strfile
        echo "<PRE>" >>$strfile
-       grep '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+       $GREP '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile
        fail=`expr $fail + 1`
 else
@@ -735,13 +749,13 @@ else
 fi
 
 # Warning log messages
-count=`grep '^W ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
-if test $count != 0; then
-       echo "FAIL: $count warning messages, expected 0."
-       grep '^W ' /tmp/cups-$user/log/error_log
-       echo "<P>FAIL: $count warning messages, expected 0.</P>" >>$strfile
+count=`$GREP '^W ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+if test $count != 9; then
+       echo "FAIL: $count warning messages, expected 9."
+       $GREP '^W ' /tmp/cups-$user/log/error_log
+       echo "<P>FAIL: $count warning messages, expected 9.</P>" >>$strfile
        echo "<PRE>" >>$strfile
-       grep '^W ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+       $GREP '^W ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile
        fail=`expr $fail + 1`
 else
@@ -750,13 +764,13 @@ else
 fi
 
 # Notice log messages
-count=`grep '^N ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^N ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count notice messages, expected 0."
-       grep '^N ' /tmp/cups-$user/log/error_log
+       $GREP '^N ' /tmp/cups-$user/log/error_log
        echo "<P>FAIL: $count notice messages, expected 0.</P>" >>$strfile
        echo "<PRE>" >>$strfile
-       grep '^N ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+       $GREP '^N ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile
        fail=`expr $fail + 1`
 else
@@ -765,7 +779,7 @@ else
 fi
 
 # Info log messages
-count=`grep '^I ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^I ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count = 0; then
        echo "FAIL: $count info messages, expected more than 0."
        echo "<P>FAIL: $count info messages, expected more than 0.</P>" >>$strfile
@@ -776,7 +790,7 @@ else
 fi
 
 # Debug log messages
-count=`grep '^D ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^D ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count = 0; then
        echo "FAIL: $count debug messages, expected more than 0."
        echo "<P>FAIL: $count debug messages, expected more than 0.</P>" >>$strfile
@@ -787,7 +801,7 @@ else
 fi
 
 # Debug2 log messages
-count=`grep '^d ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^d ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
 if test $count = 0; then
        echo "FAIL: $count debug2 messages, expected more than 0."
        echo "<P>FAIL: $count debug2 messages, expected more than 0.</P>" >>$strfile
@@ -797,16 +811,6 @@ else
        echo "<P>PASS: $count debug2 messages.</P>" >>$strfile
 fi
 
-# Page log file...
-if grep -iq 'testfile.pdf na_letter_8.5x11in' /tmp/cups-$user/log/page_log; then
-       echo "PASS: page_log formatted correctly."
-       echo "<P>PASS: page_log formatted correctly.</P>" >>$strfile
-else
-       echo "FAIL: page_log formatted incorrectly."
-       echo "<P>FAIL: page_log formatted incorrectly - no page size information.</P>" >>$strfile
-       fail=`expr $fail + 1`
-fi
-
 # Log files...
 echo "<H2>access_log</H2>" >>$strfile
 echo "<PRE>" >>$strfile
@@ -815,7 +819,7 @@ echo "</PRE>" >>$strfile
 
 echo "<H2>error_log</H2>" >>$strfile
 echo "<PRE>" >>$strfile
-grep -v '^d' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+$GREP -v '^d' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
 echo "</PRE>" >>$strfile
 
 echo "<H2>page_log</H2>" >>$strfile