]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - test/run-stp-tests.sh
Merge changes from CUPS 1.5svn-r9198.
[thirdparty/cups.git] / test / run-stp-tests.sh
index c5d671813b6ebd3e7bd8d2072764b5590dd4af5a..013e4283bb4e83da9438d87bd7c4572ca355e8b1 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/sh
 #
-# "$Id: run-stp-tests.sh 7954 2008-09-17 05:23:09Z mike $"
+# "$Id: run-stp-tests.sh 9034 2010-03-09 07:03:06Z mike $"
 #
 #   Perform the complete set of IPP compliance tests specified in the
 #   CUPS Software Test Plan.
 #
-#   Copyright 2007-2008 by Apple Inc.
+#   Copyright 2007-2010 by Apple Inc.
 #   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -74,30 +74,35 @@ case "$testtype" in
                nprinters1=0
                nprinters2=0
                pjobs=0
+               pprinters=0
                ;;
        2)
                echo "Running the medium tests (2)"
                nprinters1=10
                nprinters2=20
                pjobs=20
+               pprinters=10
                ;;
        3)
                echo "Running the extreme tests (3)"
                nprinters1=500
                nprinters2=1000
                pjobs=100
+               pprinters=50
                ;;
        4)
                echo "Running the torture tests (4)"
                nprinters1=10000
                nprinters2=20000
                pjobs=200
+               pprinters=100
                ;;
        *)
                echo "Running the timid tests (1)"
                nprinters1=0
                nprinters2=0
                pjobs=10
+               pprinters=0
                ;;
 esac
 
@@ -188,7 +193,7 @@ echo ""
 
 case "$usevalgrind" in
        Y* | y*)
-               valgrind="valgrind --tool=memcheck --log-file=/tmp/cups-$user/log/valgrind --error-limit=no --leak-check=yes --trace-children=yes"
+               valgrind="valgrind --tool=memcheck --log-file=/tmp/cups-$user/log/valgrind.%p --error-limit=no --leak-check=yes --trace-children=yes --read-var-info=yes"
                echo "Using Valgrind; log files can be found in /tmp/cups-$user/log..."
                ;;
 
@@ -246,6 +251,7 @@ 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
@@ -269,17 +275,15 @@ ln -s $root/data/*.h /tmp/cups-$user/share/ppdc
 ln -s $root/data/*.defs /tmp/cups-$user/share/ppdc
 ln -s $root/templates /tmp/cups-$user/share
 
-if test $ssltype != 0; then
-       mkdir $root/ssl
-       cp server.* $root/ssl
-fi
-
 #
 # Mac OS X filters and configuration files...
 #
 
 if test `uname` = Darwin; then
        ln -s /usr/libexec/cups/filter/cgpdfto* /tmp/cups-$user/bin/filter
+       ln -s /usr/libexec/cups/filter/cgbannertopdf /tmp/cups-$user/bin/filter
+       ln -s /usr/libexec/cups/filter/cgimagetopdf /tmp/cups-$user/bin/filter
+       ln -s /usr/libexec/cups/filter/cgtexttopdf /tmp/cups-$user/bin/filter
        ln -s /usr/libexec/cups/filter/nsimagetopdf /tmp/cups-$user/bin/filter
        ln -s /usr/libexec/cups/filter/nstexttopdf /tmp/cups-$user/bin/filter
        ln -s /usr/libexec/cups/filter/pictwpstops /tmp/cups-$user/bin/filter
@@ -326,11 +330,14 @@ PassEnv LOCALEDIR
 DocumentRoot $root/doc
 RequestRoot /tmp/cups-$user/spool
 TempDir /tmp/cups-$user/spool/temp
+MaxSubscriptions 3
 MaxLogSize 0
 AccessLog /tmp/cups-$user/log/access_log
 ErrorLog /tmp/cups-$user/log/error_log
 PageLog /tmp/cups-$user/log/page_log
+AccessLogLevel actions
 LogLevel debug2
+LogTimeFormat usecs
 PreserveJobHistory Yes
 <Policy default>
 <Limit All>
@@ -383,7 +390,11 @@ EOF
        i=`expr $i + 1`
 done
 
-cp /tmp/cups-$user/printers.conf /tmp/cups-$user/printers.conf.orig
+if test -f /tmp/cups-$user/printers.conf; then
+       cp /tmp/cups-$user/printers.conf /tmp/cups-$user/printers.conf.orig
+else
+       touch /tmp/cups-$user/printers.conf.orig
+fi
 
 #
 # Setup the paths...
@@ -400,6 +411,9 @@ fi
 export LD_LIBRARY_PATH
 
 LD_PRELOAD="$root/cups/libcups.so.2:$root/filter/libcupsimage.so.2:$root/cgi-bin/libcupscgi.so.1:$root/scheduler/libcupsmime.so.1:$root/driver/libcupsdriver.so.1:$root/ppdc/libcupsppdc.so.1"
+if test `uname` = SunOS -a -r /usr/lib/libCrun.so.1; then
+       LD_PRELOAD="/usr/lib/libCrun.so.1:$LD_PRELOAD"
+fi
 export LD_PRELOAD
 
 if test "x$DYLD_LIBRARY_PATH" = x; then
@@ -418,6 +432,7 @@ fi
 
 export SHLIB_PATH
 
+CUPS_DISABLE_APPLE_DEFAULT=yes; export CUPS_DISABLE_APPLE_DEFAULT
 CUPS_SERVER=localhost:8631; export CUPS_SERVER
 CUPS_SERVERROOT=/tmp/cups-$user; export CUPS_SERVERROOT
 CUPS_STATEDIR=/tmp/cups-$user; export CUPS_STATEDIR
@@ -446,7 +461,13 @@ echo "Starting scheduler:"
 echo "    $valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &"
 echo ""
 
-$valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &
+if test `uname` = Darwin -a "x$valgrind" = x; then
+       DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib \
+       $valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &
+else
+       $valgrind ../scheduler/cupsd -c /tmp/cups-$user/cupsd.conf -f >/tmp/cups-$user/log/debug_log 2>&1 &
+fi
+
 cupsd=$!
 
 if test "x$testtype" = x0; then
@@ -508,7 +529,7 @@ done
 #
 
 date=`date "+%Y-%m-%d"`
-strfile=/tmp/cups-$user/cups-str-1.4-$date-$user.html
+strfile=/tmp/cups-$user/cups-str-1.5-$date-$user.html
 
 rm -f $strfile
 cat str-header.html >$strfile
@@ -531,7 +552,7 @@ for file in 4*.test; do
        echo "Performing $file..."
        echo "" >>$strfile
 
-       ./ipptest ipp://localhost:$port/printers $file | tee -a $strfile
+       ./ipptool -t ipp://localhost:$port/printers $file | tee -a $strfile
        status=$?
 
        if test $status != 0; then
@@ -560,7 +581,7 @@ for file in 5*.sh; do
        echo "" >>$strfile
        echo "\"$file\":" >>$strfile
 
-       sh $file $pjobs | tee -a $strfile
+       sh $file $pjobs $pprinters | tee -a $strfile
        status=$?
 
        if test $status != 0; then
@@ -591,6 +612,18 @@ echo "Test Summary"
 echo ""
 echo "<H2>Summary</H2>" >>$strfile
 
+# Job control files
+count=`ls -1 /tmp/cups-$user/spool | wc -l`
+count=`expr $count - 1`
+if test $count != 0; then
+       echo "FAIL: $count job control files were not purged."
+       echo "<P>FAIL: $count job control files were not purged.</P>" >>$strfile
+       fail=`expr $fail + 1`
+else
+       echo "PASS: All job control files purged."
+       echo "<P>PASS: All job control files purged.</P>" >>$strfile
+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}'`
 expected=`expr $pjobs \* 2 + 34`
@@ -616,10 +649,30 @@ else
        echo "<P>PASS: Printer 'Test2' correctly produced $count page(s).</P>" >>$strfile
 fi
 
-# Requested processed
+# Requests logged
 count=`wc -l /tmp/cups-$user/log/access_log | awk '{print $1}'`
-echo "PASS: $count requests processed."
-echo "<P>PASS: $count requests processed.</P>" >>$strfile
+expected=`expr 39 + 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
+       fail=`expr $fail + 1`
+else
+       echo "PASS: $count requests logged."
+       echo "<P>PASS: $count requests logged.</P>" >>$strfile
+fi
+
+# Did CUPS-Get-Default get logged?
+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
+       echo "</PRE>" >>$strfile
+       fail=`expr $fail + 1`
+else
+       echo "PASS: CUPS-Get-Default not logged."
+       echo "<P>PASS: CUPS-Get-Default not logged.</P>" >>$strfile
+fi
 
 # Emergency log messages
 count=`grep '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
@@ -668,10 +721,10 @@ fi
 
 # Error log messages
 count=`grep '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
-if test $count != 15; then
-       echo "FAIL: $count error messages, expected 15."
+if test $count != 18; then
+       echo "FAIL: $count error messages, expected 18."
        grep '^E ' /tmp/cups-$user/log/error_log
-       echo "<P>FAIL: $count error messages, expected 9.</P>" >>$strfile
+       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
        echo "</PRE>" >>$strfile
@@ -745,12 +798,12 @@ else
 fi
 
 # Page log file...
-if grep -q 'testfile.pdf Letter' /tmp/cups-$user/log/page_log; then
+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.</P>" >>$strfile
+       echo "<P>FAIL: page_log formatted incorrectly - no page size information.</P>" >>$strfile
        fail=`expr $fail + 1`
 fi
 
@@ -762,7 +815,7 @@ echo "</PRE>" >>$strfile
 
 echo "<H2>error_log</H2>" >>$strfile
 echo "<PRE>" >>$strfile
-grep -v '^[dD]' /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
@@ -799,5 +852,5 @@ if test $fail != 0; then
 fi
 
 #
-# End of "$Id: run-stp-tests.sh 7954 2008-09-17 05:23:09Z mike $"
+# End of "$Id: run-stp-tests.sh 9034 2010-03-09 07:03:06Z mike $"
 #