# Perform the complete set of IPP compliance tests specified in the
# CUPS Software Test Plan.
#
-# Copyright © 2007-2018 by Apple Inc.
+# Copyright © 2007-2019 by Apple Inc.
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
gziptoany "$1" "$2" "$3" "$4" "$5" \$6 >/dev/null
case "\$5" in
*media=a4* | *media=iso_a4* | *PageSize=A4*)
- gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-a4.pdf"
+ gziptoany "$1" "$2" "$3" "$4" "$5" "$root/examples/onepage-a4.pdf"
;;
*)
- gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-letter.pdf"
+ gziptoany "$1" "$2" "$3" "$4" "$5" "$root/examples/onepage-letter.pdf"
;;
esac
EOF
gziptoany "$1" "$2" "$3" "$4" "$5" \$6 >/dev/null
case "\$5" in
*media=a4* | *media=iso_a4* | *PageSize=A4*)
- gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-a4.ps"
+ gziptoany "$1" "$2" "$3" "$4" "$5" "$root/examples/onepage-a4.ps"
;;
*)
- gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-letter.ps"
+ gziptoany "$1" "$2" "$3" "$4" "$5" "$root/examples/onepage-letter.ps"
;;
esac
EOF
gziptoany "$1" "$2" "$3" "$4" "$5" \$6 >/dev/null
case "\$5" in
*media=a4* | *media=iso_a4* | *PageSize=A4*)
- gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-a4-300-black-1.pwg.gz"
+ gziptoany "$1" "$2" "$3" "$4" "$5" "$root/examples/onepage-a4-300-black-1.pwg.gz"
;;
*)
- gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-letter-300-black-1.pwg.gz"
+ gziptoany "$1" "$2" "$3" "$4" "$5" "$root/examples/onepage-letter-300-black-1.pwg.gz"
;;
esac
EOF
encryption=""
fi
+if test $testtype = 0; then
+ jobhistory="30m"
+ jobfiles="5m"
+else
+ jobhistory="30"
+ jobfiles="Off"
+fi
+
cat >$BASE/cupsd.conf <<EOF
StrictConformance Yes
Browsing Off
AccessLogLevel actions
LogLevel $loglevel
LogTimeFormat usecs
-PreserveJobHistory Yes
-PreserveJobFiles 5m
+PreserveJobHistory $jobhistory
+PreserveJobFiles $jobfiles
<Policy default>
<Limit All>
Order Allow,Deny
PassEnv LD_LIBRARY_PATH
PassEnv LD_PRELOAD
PassEnv LOCALEDIR
-PassEnv SHLIB_PATH
+PassEnv ASAN_OPTIONS
+
+Sandboxing Off
EOF
if test $ssltype != 0 -a `uname` = Darwin; then
# which is basically useless - in general, programs do not need to free
# every object before exit since the OS will recover the process's
# memory.
- ASAN_OPTIONS="suppressions=$root/test/asan-suppressions.txt"
+ ASAN_OPTIONS="detect_leaks=false"
+ export ASAN_OPTIONS
fi
-if test "x$LD_LIBRARY_PATH" = x; then
- LD_LIBRARY_PATH="$root/cups"
-else
- LD_LIBRARY_PATH="$root/cups:$LD_LIBRARY_PATH"
-fi
+if test -f "$root/cups/libcups.so.2"; then
+ if test "x$LD_LIBRARY_PATH" = x; then
+ LD_LIBRARY_PATH="$root/cups"
+ else
+ LD_LIBRARY_PATH="$root/cups:$LD_LIBRARY_PATH"
+ fi
-LD_PRELOAD="$root/cups/libcups.so.2:$root/cups/libcupsimage.so.2"
-if test `uname` = SunOS -a -r /usr/lib/libCrun.so.1; then
- LD_PRELOAD="/usr/lib/libCrun.so.1:$LD_PRELOAD"
+ LD_PRELOAD="$root/cups/libcups.so.2:$root/cups/libcupsimage.so.2"
+ if test `uname` = SunOS -a -r /usr/lib/libCrun.so.1; then
+ LD_PRELOAD="/usr/lib/libCrun.so.1:$LD_PRELOAD"
+ fi
fi
-if test -f $root/cups/libcups.2.dylib; then
- if test "x$DYLD_INSERT_LIBRARIES" = x; then
- DYLD_INSERT_LIBRARIES="$root/cups/libcups.2.dylib:$root/cups/libcupsimage.2.dylib"
- else
- DYLD_INSERT_LIBRARIES="$root/cups/libcups.2.dylib:$root/cups/libcupsimage.2.dylib:$DYLD_INSERT_LIBRARIES"
- fi
-fi
+if test -f "$root/cups/libcups.2.dylib"; then
+ if test "x$DYLD_INSERT_LIBRARIES" = x; then
+ DYLD_INSERT_LIBRARIES="$root/cups/libcups.2.dylib:$root/cups/libcupsimage.2.dylib"
+ else
+ DYLD_INSERT_LIBRARIES="$root/cups/libcups.2.dylib:$root/cups/libcupsimage.2.dylib:$DYLD_INSERT_LIBRARIES"
+ fi
-if test "x$DYLD_LIBRARY_PATH" = x; then
- DYLD_LIBRARY_PATH="$root/cups"
-else
- DYLD_LIBRARY_PATH="$root/cups:$DYLD_LIBRARY_PATH"
+ if test "x$DYLD_LIBRARY_PATH" = x; then
+ DYLD_LIBRARY_PATH="$root/cups"
+ else
+ DYLD_LIBRARY_PATH="$root/cups:$DYLD_LIBRARY_PATH"
+ fi
fi
# These get exported because they don't have side-effects...
echo " <pre>" >>$strfile
fail=0
-for file in 4*.test ipp-2.1.test; do
- echo $ac_n "Performing $file: $ac_c"
+for file in 4*.test ../examples/ipp-2.1.test; do
+ echo $ac_n "Performing `basename $file`: $ac_c"
echo "" >>$strfile
echo $ac_n "`date '+[%d/%b/%Y:%H:%M:%S %z]'` $ac_c" >>$strfile
- if test $file = ipp-2.1.test; then
+ if test $file = ../examples/ipp-2.1.test; then
uri="ipp://localhost:$port/printers/Test1"
options="-V 2.1 -d NOPRINT=1 -f testfile.ps"
else
uri="ipp://localhost:$port/printers"
options=""
fi
- $runcups $VALGRIND ./ipptool -tI $options $uri $file >> $strfile
+ $runcups $VALGRIND ../tools/ipptool -tI $options $uri $file >> $strfile
status=$?
if test $status != 0; then
fi
done
-#
-# Log all allocations made by the scheduler...
-#
-
-if test `uname` = Darwin -a "x$VALGRIND" = x; then
- malloc_history $cupsd -callTree -showContent >$BASE/log/malloc_log 2>&1
-fi
-
#
# Restart the server...
#
echo PASS
fi
-echo " </pre>" >>$strfile
+
+#
+# Perform job history test...
+#
+
+echo $ac_n "Starting history test: $ac_c"
+echo "" >>$strfile
+echo "`date '+[%d/%b/%Y:%H:%M:%S %z]'` \"5.11-history\":" >>$strfile
+
+echo " lp -d Test1 testfile.jpg" >>$strfile
+
+$runcups ../systemv/lp -d Test1 ../examples/testfile.jpg 2>&1 >>$strfile
+if test $? != 0; then
+ echo "FAIL (unable to queue test job)"
+ echo " FAILED" >>$strfile
+ fail=`expr $fail + 1`
+else
+ echo "PASS"
+ echo " PASSED" >>$strfile
+
+ ./waitjobs.sh >>$strfile
+
+ echo $ac_n "Verifying that history still exists: $ac_c"
+
+ echo " ls -l $BASE/spool" >>$strfile
+ count=`ls -1 $BASE/spool | wc -l`
+ if test $count = 1; then
+ echo "FAIL"
+ echo " FAILED (job control files not present)" >>$strfile
+ ls -l $BASE/spool >>$strfile
+ fail=`expr $fail + 1`
+ else
+ echo "PASS"
+ echo " PASSED" >>$strfile
+
+ echo $ac_n "Waiting for job history to expire: $ac_c"
+ echo "" >>$strfile
+ echo " sleep 35" >>$strfile
+ sleep 35
+
+ echo " lpstat" >>$strfile
+ $runcups ../systemv/lpstat 2>&1 >>$strfile
+
+ echo " ls -l $BASE/spool" >>$strfile
+ count=`ls -1 $BASE/spool | wc -l`
+ if test $count != 1; then
+ echo "FAIL"
+ echo " FAILED (job control files still present)" >>$strfile
+ ls -l $BASE/spool >>$strfile
+ fail=`expr $fail + 1`
+ else
+ echo "PASS"
+ echo " PASSED" >>$strfile
+ fi
+ fi
+fi
+
#
# Stop the server...
#
+echo " </pre>" >>$strfile
+
kill $cupsd
wait $cupsd
cupsdstatus=$?
# Requests logged
count=`wc -l $BASE/log/access_log | awk '{print $1}'`
-expected=`expr 35 + 18 + 30 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
+expected=`expr 35 + 18 + 30 + $pjobs \* 8 + $pprinters \* $pjobs \* 4 + 2`
if test $count != $expected; then
echo "FAIL: $count requests logged, expected $expected."
echo " <p>FAIL: $count requests logged, expected $expected.</p>" >>$strfile
# Debug2 log messages
count=`$GREP '^d ' $BASE/log/error_log | wc -l | awk '{print $1}'`
-if test $count = 0; then
+if test $count = 0 -a $loglevel = debug2; then
echo "FAIL: $count debug2 messages, expected more than 0."
echo " <p>FAIL: $count debug2 messages, expected more than 0.</p>" >>$strfile
fail=`expr $fail + 1`
+elif test $count != 0 -a $loglevel = debug; then
+ echo "FAIL: $count debug2 messages, expected 0."
+ echo " <p>FAIL: $count debug2 messages, expected 0.</p>" >>$strfile
+ fail=`expr $fail + 1`
else
echo "PASS: $count debug2 messages."
echo " <p>PASS: $count debug2 messages.</p>" >>$strfile