]> git.ipfire.org Git - thirdparty/cups.git/blame - test/run-stp-tests.sh
Fix regression in lpadmin fix (Issue #5305)
[thirdparty/cups.git] / test / run-stp-tests.sh
CommitLineData
ef416fc2 1#!/bin/sh
2#
8fe0183a
MS
3# Perform the complete set of IPP compliance tests specified in the
4# CUPS Software Test Plan.
ef416fc2 5#
afe94dff
MS
6# Copyright © 2007-2018 by Apple Inc.
7# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
ef416fc2 8#
8fe0183a
MS
9# These coded instructions, statements, and computer programs are the
10# property of Apple Inc. and are protected by Federal copyright
11# law. Distribution and use rights are outlined in the file "LICENSE.txt"
12# which should have been included with this file. If this file is
13# file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14#
15
a74454a7 16argcount=$#
17
a29fd7dd
MS
18#
19# Don't allow "make check" or "make test" to be run by root...
20#
21
22if test "x`id -u`" = x0; then
23 echo Please run this as a normal user. Not supported when run as root.
24 exit 1
25fi
26
27#
28# Force the permissions of the files we create...
29#
30
31umask 022
32
ef416fc2 33#
34# Make the IPP test program...
35#
36
37make
38
0268488e
MS
39#
40# Solaris has a non-POSIX grep in /bin...
41#
42
43if test -x /usr/xpg4/bin/grep; then
44 GREP=/usr/xpg4/bin/grep
45else
46 GREP=grep
47fi
48
bd7854cb 49#
50# Figure out the proper echo options...
51#
52
0268488e 53if (echo "testing\c"; echo 1,2,3) | $GREP c >/dev/null; then
bd7854cb 54 ac_n=-n
55 ac_c=
56else
57 ac_n=
58 ac_c='\c'
59fi
60
ef416fc2 61#
62# Greet the tester...
63#
64
65echo "Welcome to the CUPS Automated Test Script."
66echo ""
67echo "Before we begin, it is important that you understand that the larger"
68echo "tests require significant amounts of RAM and disk space. If you"
69echo "attempt to run one of the big tests on a system that lacks sufficient"
70echo "disk and virtual memory, the UNIX kernel might decide to kill one or"
71echo "more system processes that you've grown attached to, like the X"
72echo "server. The question you may want to ask yourself before running a"
73echo "large test is: Do you feel lucky?"
74echo ""
75echo "OK, now that we have the Dirty Harry quote out of the way, please"
76echo "choose the type of test you wish to perform:"
77echo ""
78echo "0 - No testing, keep the scheduler running for me (all systems)"
79echo "1 - Basic conformance test, no load testing (all systems)"
80echo "2 - Basic conformance test, some load testing (minimum 256MB VM, 50MB disk)"
81echo "3 - Basic conformance test, extreme load testing (minimum 1GB VM, 500MB disk)"
82echo "4 - Basic conformance test, torture load testing (minimum 2GB VM, 1GB disk)"
83echo ""
bd7854cb 84echo $ac_n "Enter the number of the test you wish to perform: [1] $ac_c"
ef416fc2 85
a74454a7 86if test $# -gt 0; then
87 testtype=$1
88 shift
89else
90 read testtype
91fi
bd7854cb 92echo ""
ef416fc2 93
94case "$testtype" in
95 0)
96 echo "Running in test mode (0)"
a83658fa 97 nprinters=0
ef416fc2 98 pjobs=0
b9faaae1 99 pprinters=0
766a8229 100 loglevel="debug2"
ef416fc2 101 ;;
102 2)
103 echo "Running the medium tests (2)"
a83658fa 104 nprinters=20
ef416fc2 105 pjobs=20
b9faaae1 106 pprinters=10
766a8229 107 loglevel="debug"
ef416fc2 108 ;;
109 3)
110 echo "Running the extreme tests (3)"
a83658fa 111 nprinters=1000
ef416fc2 112 pjobs=100
b9faaae1 113 pprinters=50
766a8229 114 loglevel="debug"
ef416fc2 115 ;;
116 4)
117 echo "Running the torture tests (4)"
a83658fa 118 nprinters=20000
ef416fc2 119 pjobs=200
b9faaae1 120 pprinters=100
766a8229 121 loglevel="debug"
ef416fc2 122 ;;
123 *)
124 echo "Running the timid tests (1)"
a83658fa 125 nprinters=0
839a51c8 126 pjobs=10
b9faaae1 127 pprinters=0
766a8229 128 loglevel="debug2"
6a638e32 129 testtype="1"
ef416fc2 130 ;;
131esac
132
133#
134# See if we want to do SSL testing...
135#
136
137echo ""
138echo "Now you can choose whether to create a SSL/TLS encryption key and"
6ccb19f3 139echo "certificate for testing:"
ef416fc2 140echo ""
141echo "0 - Do not do SSL/TLS encryption tests"
411affcf 142echo "1 - Test but do not require encryption"
143echo "2 - Test and require encryption"
ef416fc2 144echo ""
bd7854cb 145echo $ac_n "Enter the number of the SSL/TLS tests to perform: [0] $ac_c"
ef416fc2 146
a74454a7 147if test $# -gt 0; then
148 ssltype=$1
149 shift
150else
151 read ssltype
152fi
bd7854cb 153echo ""
ef416fc2 154
155case "$ssltype" in
411affcf 156 1)
157 echo "Will test but not require encryption (1)"
158 ;;
159 2)
160 echo "Will test and require encryption (2)"
ef416fc2 161 ;;
ef416fc2 162 *)
411affcf 163 echo "Not using SSL/TLS (0)"
ef416fc2 164 ssltype=0
165 ;;
166esac
167
168#
169# Information for the server/tests...
170#
171
e1d6a774 172user="$USER"
173if test -z "$user"; then
174 if test -x /usr/ucb/whoami; then
175 user=`/usr/ucb/whoami`
176 else
177 user=`whoami`
178 fi
179
180 if test -z "$user"; then
181 user="unknown"
182 fi
183fi
184
95dd8876 185port="${CUPS_TESTPORT:=8631}"
ef416fc2 186cwd=`pwd`
187root=`dirname $cwd`
8fe0183a
MS
188CUPS_TESTROOT="$root"; export CUPS_TESTROOT
189
95dd8876
MS
190BASE="${CUPS_TESTBASE:=}"
191if test -z "$BASE"; then
192 if test -d /private/tmp; then
193 BASE=/private/tmp/cups-$user
194 else
195 BASE=/tmp/cups-$user
196 fi
8fe0183a 197fi
2a8db0cd 198export BASE
ef416fc2 199
200#
201# Make sure that the LPDEST and PRINTER environment variables are
202# not included in the environment that is passed to the tests. These
203# will usually cause tests to fail erroneously...
204#
205
634763e8
MS
206unset LPDEST
207unset PRINTER
ef416fc2 208
209#
210# See if we want to use valgrind...
211#
212
213echo ""
214echo "This test script can use the Valgrind software from:"
215echo ""
216echo " http://developer.kde.org/~sewardj/"
217echo ""
bd7854cb 218echo $ac_n "Enter Y to use Valgrind or N to not use Valgrind: [N] $ac_c"
ef416fc2 219
a74454a7 220if test $# -gt 0; then
221 usevalgrind=$1
222 shift
223else
224 read usevalgrind
225fi
bd7854cb 226echo ""
ef416fc2 227
228case "$usevalgrind" in
229 Y* | y*)
484798d8 230 VALGRIND="valgrind --tool=memcheck --log-file=$BASE/log/valgrind.%p --error-limit=no --leak-check=yes --trace-children=yes"
a2326b5b
MS
231 if test `uname` = Darwin; then
232 VALGRIND="$VALGRIND --dsymutil=yes"
233 fi
234 export VALGRIND
8fe0183a 235 echo "Using Valgrind; log files can be found in $BASE/log..."
ef416fc2 236 ;;
237
238 *)
a2326b5b
MS
239 VALGRIND=""
240 export VALGRIND
ef416fc2 241 ;;
242esac
243
85dda01c
MS
244#
245# See if we want to do debug logging of the libraries...
246#
247
248echo ""
249echo "If CUPS was built with the --enable-debug-printfs configure option, you"
250echo "can enable debug logging of the libraries."
251echo ""
252echo $ac_n "Enter Y or a number from 0 to 9 to enable debug logging or N to not: [N] $ac_c"
253
254if test $# -gt 0; then
255 usedebugprintfs=$1
256 shift
257else
258 read usedebugprintfs
259fi
260echo ""
261
262case "$usedebugprintfs" in
263 Y* | y*)
8fe0183a
MS
264 echo "Enabling debug printfs (level 5); log files can be found in $BASE/log..."
265 CUPS_DEBUG_LOG="$BASE/log/debug_printfs.%d"; export CUPS_DEBUG_LOG
85dda01c 266 CUPS_DEBUG_LEVEL=5; export CUPS_DEBUG_LEVEL
a2326b5b 267 CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend).*$'; export CUPS_DEBUG_FILTER
85dda01c
MS
268 ;;
269
270 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)
8fe0183a
MS
271 echo "Enabling debug printfs (level $usedebugprintfs); log files can be found in $BASE/log..."
272 CUPS_DEBUG_LOG="$BASE/log/debug_printfs.%d"; export CUPS_DEBUG_LOG
c41769ff 273 CUPS_DEBUG_LEVEL="$usedebugprintfs"; export CUPS_DEBUG_LEVEL
830cfed9 274 CUPS_DEBUG_FILTER='^(http|_http|ipp|_ipp|cups.*Request|cupsGetResponse|cupsSend|mime).*$'; export CUPS_DEBUG_FILTER
85dda01c
MS
275 ;;
276
277 *)
278 ;;
279esac
280
ef416fc2 281#
282# Start by creating temporary directories for the tests...
283#
284
a74454a7 285echo "Creating directories for test..."
286
8fe0183a
MS
287rm -rf $BASE
288mkdir $BASE
289mkdir $BASE/bin
290mkdir $BASE/bin/backend
291mkdir $BASE/bin/driver
292mkdir $BASE/bin/filter
293mkdir $BASE/certs
294mkdir $BASE/share
295mkdir $BASE/share/banners
296mkdir $BASE/share/drv
297mkdir $BASE/share/locale
4509bb49
MS
298for file in ../locale/cups_*.po; do
299 loc=`basename $file .po | cut -c 6-`
8fe0183a
MS
300 mkdir $BASE/share/locale/$loc
301 ln -s $root/locale/cups_$loc.po $BASE/share/locale/$loc
4509bb49 302done
afe94dff
MS
303mkdir $BASE/share/locale/en
304ln -s $root/locale/cups.pot $BASE/share/locale/en/cups_en.po
8fe0183a
MS
305mkdir $BASE/share/mime
306mkdir $BASE/share/model
307mkdir $BASE/share/ppdc
308mkdir $BASE/interfaces
309mkdir $BASE/log
310mkdir $BASE/ppd
311mkdir $BASE/spool
312mkdir $BASE/spool/temp
313mkdir $BASE/ssl
314
315ln -s $root/backend/dnssd $BASE/bin/backend
316ln -s $root/backend/http $BASE/bin/backend
317ln -s $root/backend/ipp $BASE/bin/backend
afe94dff 318ln -s ipp $BASE/bin/backend/ipps
8fe0183a
MS
319ln -s $root/backend/lpd $BASE/bin/backend
320ln -s $root/backend/mdns $BASE/bin/backend
321ln -s $root/backend/pseudo $BASE/bin/backend
322ln -s $root/backend/snmp $BASE/bin/backend
323ln -s $root/backend/socket $BASE/bin/backend
324ln -s $root/backend/usb $BASE/bin/backend
325ln -s $root/cgi-bin $BASE/bin
326ln -s $root/monitor $BASE/bin
327ln -s $root/notifier $BASE/bin
328ln -s $root/scheduler $BASE/bin/daemon
329ln -s $root/filter/commandtops $BASE/bin/filter
330ln -s $root/filter/gziptoany $BASE/bin/filter
331ln -s $root/filter/pstops $BASE/bin/filter
332ln -s $root/filter/rastertoepson $BASE/bin/filter
333ln -s $root/filter/rastertohp $BASE/bin/filter
334ln -s $root/filter/rastertolabel $BASE/bin/filter
335ln -s $root/filter/rastertopwg $BASE/bin/filter
1d58a957
MS
336cat >$BASE/share/banners/standard <<EOF
337 ==== Cover Page ====
8fe0183a 338
1d58a957
MS
339
340 Job: {?printer-name}-{?job-id}
341 Owner: {?job-originating-user-name}
342 Name: {?job-name}
343 Pages: {?job-impressions}
344
345
346 ==== Cover Page ====
347EOF
348cat >$BASE/share/banners/classified <<EOF
349 ==== Classified - Do Not Disclose ====
350
351
352 Job: {?printer-name}-{?job-id}
353 Owner: {?job-originating-user-name}
354 Name: {?job-name}
355 Pages: {?job-impressions}
356
357
358 ==== Classified - Do Not Disclose ====
359EOF
8fe0183a
MS
360ln -s $root/data $BASE/share
361ln -s $root/ppdc/sample.drv $BASE/share/drv
362ln -s $root/conf/mime.types $BASE/share/mime
363ln -s $root/conf/mime.convs $BASE/share/mime
364ln -s $root/data/*.h $BASE/share/ppdc
365ln -s $root/data/*.defs $BASE/share/ppdc
366ln -s $root/templates $BASE/share
ef416fc2 367
bc44d920 368#
f3c17241 369# Local filters and configuration files...
bc44d920 370#
371
79a784c4
MS
372instfilter() {
373 # instfilter src dst format
374 #
375 # See if the filter exists in a standard location; if so, make a
376 # symlink, otherwise create a dummy script for the specified format.
377 #
378 src="$1"
379 dst="$2"
380 format="$3"
381
95dd8876 382 for dir in /usr/local/libexec/cups/filter /usr/libexec/cups/filter /usr/lib/cups/filter; do
79a784c4 383 if test -x "$dir/$src"; then
8fe0183a 384 ln -s "$dir/$src" "$BASE/bin/filter/$dst"
79a784c4
MS
385 return
386 fi
387 done
388
389 # Source filter not present, create a dummy filter
390 case $format in
391 passthru)
8fe0183a 392 ln -s gziptoany "$BASE/bin/filter/$dst"
79a784c4
MS
393 ;;
394 pdf)
8fe0183a 395 cat >"$BASE/bin/filter/$dst" <<EOF
79a784c4 396#!/bin/sh
e7061482
MS
397trap "" TERM
398trap "" PIPE
f0cd6a7c 399gziptoany "$1" "$2" "$3" "$4" "$5" \$6 >/dev/null
79a784c4
MS
400case "\$5" in
401 *media=a4* | *media=iso_a4* | *PageSize=A4*)
da5f55b5 402 gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-a4.pdf"
79a784c4
MS
403 ;;
404 *)
da5f55b5 405 gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-letter.pdf"
79a784c4
MS
406 ;;
407esac
408EOF
8fe0183a 409 chmod +x "$BASE/bin/filter/$dst"
79a784c4
MS
410 ;;
411 ps)
8fe0183a 412 cat >"$BASE/bin/filter/$dst" <<EOF
79a784c4 413#!/bin/sh
e7061482
MS
414trap "" TERM
415trap "" PIPE
f0cd6a7c 416gziptoany "$1" "$2" "$3" "$4" "$5" \$6 >/dev/null
79a784c4
MS
417case "\$5" in
418 *media=a4* | *media=iso_a4* | *PageSize=A4*)
da5f55b5 419 gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-a4.ps"
79a784c4
MS
420 ;;
421 *)
da5f55b5 422 gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-letter.ps"
79a784c4
MS
423 ;;
424esac
425EOF
8fe0183a 426 chmod +x "$BASE/bin/filter/$dst"
79a784c4
MS
427 ;;
428 raster)
8fe0183a 429 cat >"$BASE/bin/filter/$dst" <<EOF
79a784c4 430#!/bin/sh
e7061482
MS
431trap "" TERM
432trap "" PIPE
f0cd6a7c 433gziptoany "$1" "$2" "$3" "$4" "$5" \$6 >/dev/null
79a784c4
MS
434case "\$5" in
435 *media=a4* | *media=iso_a4* | *PageSize=A4*)
da5f55b5 436 gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-a4-300-black-1.pwg.gz"
79a784c4
MS
437 ;;
438 *)
da5f55b5 439 gziptoany "$1" "$2" "$3" "$4" "$5" "$root/test/onepage-letter-300-black-1.pwg.gz"
79a784c4
MS
440 ;;
441esac
442EOF
8fe0183a 443 chmod +x "$BASE/bin/filter/$dst"
79a784c4
MS
444 ;;
445 esac
446}
72d05bc9 447
8fe0183a 448ln -s $root/test/test.convs $BASE/share/mime
830cfed9 449ln -s $root/test/test.types $BASE/share/mime
79a784c4 450
bc44d920 451if test `uname` = Darwin; then
79a784c4
MS
452 instfilter cgimagetopdf imagetopdf pdf
453 instfilter cgpdftopdf pdftopdf passthru
454 instfilter cgpdftops pdftops ps
455 instfilter cgpdftoraster pdftoraster raster
830cfed9 456 instfilter cgpdftoraster pdftourf raster
79a784c4
MS
457 instfilter cgtexttopdf texttopdf pdf
458 instfilter pstocupsraster pstoraster raster
839a51c8 459else
79a784c4
MS
460 instfilter imagetopdf imagetopdf pdf
461 instfilter pdftopdf pdftopdf passthru
462 instfilter pdftops pdftops ps
463 instfilter pdftoraster pdftoraster raster
ae7225e5 464 instfilter pdftoraster pdftourf raster
79a784c4
MS
465 instfilter pstoraster pstoraster raster
466 instfilter texttopdf texttopdf pdf
467
468 if test -d /usr/share/cups/charsets; then
8fe0183a 469 ln -s /usr/share/cups/charsets $BASE/share
5a9febac 470 fi
bc44d920 471fi
472
ef416fc2 473#
474# Then create the necessary config files...
475#
476
a74454a7 477echo "Creating cupsd.conf for test..."
478
ef416fc2 479if test $ssltype = 2; then
480 encryption="Encryption Required"
481else
482 encryption=""
483fi
484
8fe0183a 485cat >$BASE/cupsd.conf <<EOF
a29fd7dd 486StrictConformance Yes
ef416fc2 487Browsing Off
a29fd7dd 488Listen localhost:$port
8fe0183a 489Listen $BASE/sock
52f6f666 490MaxSubscriptions 3
ef416fc2 491MaxLogSize 0
e07d4801 492AccessLogLevel actions
766a8229 493LogLevel $loglevel
b9faaae1 494LogTimeFormat usecs
ef416fc2 495PreserveJobHistory Yes
237b42e9 496PreserveJobFiles 5m
ef416fc2 497<Policy default>
498<Limit All>
a29fd7dd 499Order Allow,Deny
ef416fc2 500$encryption
501</Limit>
502</Policy>
503EOF
504
72d05bc9 505if test $testtype = 0; then
8fe0183a 506 echo WebInterface yes >>$BASE/cupsd.conf
72d05bc9
MS
507fi
508
8fe0183a 509cat >$BASE/cups-files.conf <<EOF
c41769ff
MS
510FileDevice yes
511Printcap
512User $user
8fe0183a
MS
513ServerRoot $BASE
514StateDir $BASE
515ServerBin $BASE/bin
516CacheDir $BASE/share
517DataDir $BASE/share
518FontPath $BASE/share/fonts
c41769ff 519DocumentRoot $root/doc
8fe0183a
MS
520RequestRoot $BASE/spool
521TempDir $BASE/spool/temp
522AccessLog $BASE/log/access_log
523ErrorLog $BASE/log/error_log
524PageLog $BASE/log/page_log
97cb5665
MS
525
526PassEnv DYLD_LIBRARY_PATH
527PassEnv LD_LIBRARY_PATH
528PassEnv LD_PRELOAD
529PassEnv LOCALEDIR
530PassEnv SHLIB_PATH
c41769ff
MS
531EOF
532
c1420c87 533if test $ssltype != 0 -a `uname` = Darwin; then
8fe0183a 534 echo "ServerKeychain $HOME/Library/Keychains/login.keychain" >> $BASE/cups-files.conf
c1420c87
MS
535fi
536
ef416fc2 537#
a83658fa 538# Setup lots of test queues with PPD files...
ef416fc2 539#
540
a74454a7 541echo "Creating printers.conf for test..."
542
ef416fc2 543i=1
a83658fa 544while test $i -le $nprinters; do
8fe0183a 545 cat >>$BASE/printers.conf <<EOF
ef416fc2 546<Printer test-$i>
547Accepting Yes
548DeviceURI file:/dev/null
549Info Test PS printer $i
550JobSheets none none
551Location CUPS test suite
552State Idle
553StateMessage Printer $1 is idle.
554</Printer>
555EOF
556
8fe0183a 557 cp testps.ppd $BASE/ppd/test-$i.ppd
ef416fc2 558
559 i=`expr $i + 1`
560done
561
8fe0183a
MS
562if test -f $BASE/printers.conf; then
563 cp $BASE/printers.conf $BASE/printers.conf.orig
426c6a59 564else
8fe0183a 565 touch $BASE/printers.conf.orig
426c6a59 566fi
ef416fc2 567
ef416fc2 568#
569# Setup the paths...
570#
571
a74454a7 572echo "Setting up environment variables for test..."
573
ef416fc2 574if test "x$LD_LIBRARY_PATH" = x; then
82cc1f9a 575 LD_LIBRARY_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc"
ef416fc2 576else
82cc1f9a 577 LD_LIBRARY_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc:$LD_LIBRARY_PATH"
ef416fc2 578fi
579
580export LD_LIBRARY_PATH
581
83e08001 582LD_PRELOAD="$root/cups/libcups.so.2:$root/filter/libcupsimage.so.2:$root/cgi-bin/libcupscgi.so.1:$root/scheduler/libcupsmime.so.1:$root/ppdc/libcupsppdc.so.1"
f11a948a
MS
583if test `uname` = SunOS -a -r /usr/lib/libCrun.so.1; then
584 LD_PRELOAD="/usr/lib/libCrun.so.1:$LD_PRELOAD"
585fi
ef416fc2 586export LD_PRELOAD
587
7536de1a
MS
588if test -f $root/cups/libcups.2.dylib; then
589 if test "x$DYLD_INSERT_LIBRARIES" = x; then
590 DYLD_INSERT_LIBRARIES="$root/cups/libcups.2.dylib:$root/filter/libcupsimage.2.dylib:$root/cgi-bin/libcupscgi.1.dylib:$root/scheduler/libcupsmime.1.dylib:$root/ppdc/libcupsppdc.1.dylib"
591 else
592 DYLD_INSERT_LIBRARIES="$root/cups/libcups.2.dylib:$root/filter/libcupsimage.2.dylib:$root/cgi-bin/libcupscgi.1.dylib:$root/scheduler/libcupsmime.1.dylib:$root/ppdc/libcupsppdc.1.dylib:$DYLD_INSERT_LIBRARIES"
593 fi
594
595 export DYLD_INSERT_LIBRARIES
596fi
597
ef416fc2 598if test "x$DYLD_LIBRARY_PATH" = x; then
82cc1f9a 599 DYLD_LIBRARY_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc"
ef416fc2 600else
82cc1f9a 601 DYLD_LIBRARY_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc:$DYLD_LIBRARY_PATH"
ef416fc2 602fi
603
604export DYLD_LIBRARY_PATH
605
606if test "x$SHLIB_PATH" = x; then
82cc1f9a 607 SHLIB_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc"
ef416fc2 608else
82cc1f9a 609 SHLIB_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc:$SHLIB_PATH"
ef416fc2 610fi
611
612export SHLIB_PATH
613
ef55b745 614CUPS_DISABLE_APPLE_DEFAULT=yes; export CUPS_DISABLE_APPLE_DEFAULT
95dd8876 615CUPS_SERVER=localhost:$port; export CUPS_SERVER
8fe0183a
MS
616CUPS_SERVERROOT=$BASE; export CUPS_SERVERROOT
617CUPS_STATEDIR=$BASE; export CUPS_STATEDIR
618CUPS_DATADIR=$BASE/share; export CUPS_DATADIR
619LOCALEDIR=$BASE/share/locale; export LOCALEDIR
ef416fc2 620
621#
622# Set a new home directory to avoid getting user options mixed in...
623#
624
8fe0183a 625HOME=$BASE
ef416fc2 626export HOME
627
f42414bf 628#
629# Force POSIX locale for tests...
630#
631
632LANG=C
633export LANG
634
0268488e
MS
635LC_MESSAGES=C
636export LC_MESSAGES
637
ef416fc2 638#
639# Start the server; run as foreground daemon in the background...
640#
641
642echo "Starting scheduler:"
8fe0183a 643echo " $VALGRIND ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &"
ef416fc2 644echo ""
645
a2326b5b 646if test `uname` = Darwin -a "x$VALGRIND" = x; then
7536de1a
MS
647 if test "x$DYLD_INSERT_LIBRARIES" = x; then
648 insert="/usr/lib/libgmalloc.dylib"
649 else
650 insert="/usr/lib/libgmalloc.dylib:$DYLD_INSERT_LIBRARIES"
651 fi
652
653 DYLD_INSERT_LIBRARIES="$insert" MallocStackLogging=1 ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &
b9faaae1 654else
8fe0183a 655 $VALGRIND ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &
b9faaae1
MS
656fi
657
ef416fc2 658cupsd=$!
659
ef416fc2 660if test "x$testtype" = x0; then
b19ccc9e 661 # Not running tests...
6f260d7d 662 echo "Scheduler is PID $cupsd and is listening on port $port."
ef416fc2 663 echo ""
b19ccc9e
MS
664
665 # Create a helper script to run programs with...
8fe0183a 666 runcups="$BASE/runcups"
b19ccc9e
MS
667
668 echo "#!/bin/sh" >$runcups
669 echo "# Helper script for running CUPS test instance." >>$runcups
670 echo "" >>$runcups
671 echo "# Set required environment variables..." >>$runcups
672 echo "CUPS_DATADIR=\"$CUPS_DATADIR\"; export CUPS_DATADIR" >>$runcups
673 echo "CUPS_SERVER=\"$CUPS_SERVER\"; export CUPS_SERVER" >>$runcups
674 echo "CUPS_SERVERROOT=\"$CUPS_SERVERROOT\"; export CUPS_SERVERROOT" >>$runcups
675 echo "CUPS_STATEDIR=\"$CUPS_STATEDIR\"; export CUPS_STATEDIR" >>$runcups
676 echo "DYLD_LIBRARY_PATH=\"$DYLD_LIBRARY_PATH\"; export DYLD_LIBRARY_PATH" >>$runcups
677 echo "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"; export LD_LIBRARY_PATH" >>$runcups
678 echo "LD_PRELOAD=\"$LD_PRELOAD\"; export LD_PRELOAD" >>$runcups
679 echo "LOCALEDIR=\"$LOCALEDIR\"; export LOCALEDIR" >>$runcups
680 echo "SHLIB_PATH=\"$SHLIB_PATH\"; export SHLIB_PATH" >>$runcups
c41769ff
MS
681 if test "x$CUPS_DEBUG_LEVEL" != x; then
682 echo "CUPS_DEBUG_FILTER='$CUPS_DEBUG_FILTER'; export CUPS_DEBUG_FILTER" >>$runcups
683 echo "CUPS_DEBUG_LEVEL=$CUPS_DEBUG_LEVEL; export CUPS_DEBUG_LEVEL" >>$runcups
684 echo "CUPS_DEBUG_LOG='$CUPS_DEBUG_LOG'; export CUPS_DEBUG_LOG" >>$runcups
685 fi
b19ccc9e
MS
686 echo "" >>$runcups
687 echo "# Run command..." >>$runcups
688 echo "exec \"\$@\"" >>$runcups
689
690 chmod +x $runcups
691
692 echo "The $runcups helper script can be used to test programs"
693 echo "with the server."
ef416fc2 694 exit 0
695fi
696
a74454a7 697if test $argcount -eq 0; then
698 echo "Scheduler is PID $cupsd; run debugger now if you need to."
699 echo ""
700 echo $ac_n "Press ENTER to continue... $ac_c"
701 read junk
702else
703 echo "Scheduler is PID $cupsd."
704 sleep 2
705fi
ef416fc2 706
707IPP_PORT=$port; export IPP_PORT
708
709while true; do
710 running=`../systemv/lpstat -r 2>/dev/null`
711 if test "x$running" = "xscheduler is running"; then
712 break
713 fi
714
715 echo "Waiting for scheduler to become ready..."
716 sleep 10
717done
718
719#
720# Create the test report source file...
721#
722
dd1abb6b 723date=`date "+%Y-%m-%d"`
6015e919 724
35fc2243 725strfile=$BASE/cups-str-$date-$user.html
ef416fc2 726
727rm -f $strfile
728cat str-header.html >$strfile
729
730#
731# Run the IPP tests...
732#
733
a74454a7 734echo ""
ef416fc2 735echo "Running IPP compliance tests..."
736
35fc2243
MS
737echo " <h1><a name='IPP'>1 - IPP Compliance Tests</a></h1>" >>$strfile
738echo " <p>This section provides the results to the IPP compliance tests" >>$strfile
739echo " outlined in the CUPS Software Test Plan. These tests were run on" >>$strfile
740echo " $date by $user on `hostname`." >>$strfile
741echo " <pre>" >>$strfile
ef416fc2 742
743fail=0
a29fd7dd 744for file in 4*.test ipp-2.1.test; do
a2326b5b 745 echo $ac_n "Performing $file: $ac_c"
ef416fc2 746 echo "" >>$strfile
747
a29fd7dd
MS
748 if test $file = ipp-2.1.test; then
749 uri="ipp://localhost:$port/printers/Test1"
750 options="-V 2.1 -d NOPRINT=1 -f testfile.ps"
751 else
752 uri="ipp://localhost:$port/printers"
753 options=""
754 fi
755 $VALGRIND ./ipptool -tI $options $uri $file >> $strfile
ef416fc2 756 status=$?
757
758 if test $status != 0; then
a2326b5b 759 echo FAIL
ef416fc2 760 fail=`expr $fail + 1`
a2326b5b
MS
761 else
762 echo PASS
ef416fc2 763 fi
764done
765
35fc2243 766echo " </pre>" >>$strfile
ef416fc2 767
768#
769# Run the command tests...
770#
771
a74454a7 772echo ""
ef416fc2 773echo "Running command tests..."
774
35fc2243
MS
775echo " <h1><a name='COMMAND'>2 - Command Tests</a></h1>" >>$strfile
776echo " <p>This section provides the results to the command tests" >>$strfile
777echo " outlined in the CUPS Software Test Plan. These tests were run on" >>$strfile
778echo " $date by $user on `hostname`." >>$strfile
779echo " <pre>" >>$strfile
ef416fc2 780
781for file in 5*.sh; do
a2326b5b 782 echo $ac_n "Performing $file: $ac_c"
ef416fc2 783 echo "" >>$strfile
784 echo "\"$file\":" >>$strfile
785
a2326b5b 786 sh $file $pjobs $pprinters >> $strfile
ef416fc2 787 status=$?
788
789 if test $status != 0; then
a2326b5b 790 echo FAIL
ef416fc2 791 fail=`expr $fail + 1`
a2326b5b
MS
792 else
793 echo PASS
ef416fc2 794 fi
795done
796
8e8d3a71
MS
797#
798# Log all allocations made by the scheduler...
799#
35fc2243 800
8e8d3a71
MS
801if test `uname` = Darwin -a "x$VALGRIND" = x; then
802 malloc_history $cupsd -callTree -showContent >$BASE/log/malloc_log 2>&1
803fi
804
698fa0aa
MS
805#
806# Restart the server...
807#
808
809echo $ac_n "Performing restart test: $ac_c"
810echo "" >>$strfile
811echo "\"5.10-restart\":" >>$strfile
812
813kill -HUP $cupsd
814
815while true; do
8e8d3a71
MS
816 sleep 10
817
698fa0aa
MS
818 running=`../systemv/lpstat -r 2>/dev/null`
819 if test "x$running" = "xscheduler is running"; then
820 break
821 fi
698fa0aa
MS
822done
823
e0f0a3d5 824description="`../systemv/lpstat -l -p Test1 | grep Description | sed -e '1,$s/^[^:]*: //g'`"
698fa0aa
MS
825if test "x$description" != "xTest Printer 1"; then
826 echo "Failed, printer-info for Test1 is '$description', expected 'Test Printer 1'." >>$strfile
827 echo "FAIL (got '$description', expected 'Test Printer 1')"
828 fail=`expr $fail + 1`
829else
830 echo "Passed." >>$strfile
831 echo PASS
832fi
833
35fc2243 834echo " </pre>" >>$strfile
ef416fc2 835
ef416fc2 836#
837# Stop the server...
838#
839
840kill $cupsd
87f8ade3
MS
841wait $cupsd
842cupsdstatus=$?
ef416fc2 843
839a51c8
MS
844#
845# Verify counts...
846#
847
848echo "Test Summary"
849echo ""
35fc2243 850echo " <h1><a name='SUMMARY'>3 - Test Summary</a></h1>" >>$strfile
87f8ade3
MS
851
852if test $cupsdstatus != 0; then
853 echo "FAIL: cupsd failed with exit status $cupsdstatus."
35fc2243 854 echo " <p>FAIL: cupsd failed with exit status $cupsdstatus.</p>" >>$strfile
87f8ade3
MS
855 fail=`expr $fail + 1`
856else
857 echo "PASS: cupsd exited with no errors."
35fc2243 858 echo " <p>PASS: cupsd exited with no errors.</p>" >>$strfile
87f8ade3 859fi
839a51c8 860
ba55dc12 861# Job control files
8fe0183a 862count=`ls -1 $BASE/spool | wc -l`
ba55dc12
MS
863count=`expr $count - 1`
864if test $count != 0; then
865 echo "FAIL: $count job control files were not purged."
35fc2243 866 echo " <p>FAIL: $count job control files were not purged.</p>" >>$strfile
ba55dc12
MS
867 fail=`expr $fail + 1`
868else
869 echo "PASS: All job control files purged."
35fc2243 870 echo " <p>PASS: All job control files purged.</p>" >>$strfile
ba55dc12
MS
871fi
872
7a14d768 873# Pages printed on Test1 (within 1 page for timing-dependent cancel issues)
8fe0183a 874count=`$GREP '^Test1 ' $BASE/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
969307f0
MS
875expected=`expr $pjobs \* 2 + 34`
876expected2=`expr $expected + 2`
877if test $count -lt $expected -a $count -gt $expected2; then
839a51c8 878 echo "FAIL: Printer 'Test1' produced $count page(s), expected $expected."
35fc2243 879 echo " <p>FAIL: Printer 'Test1' produced $count page(s), expected $expected.</p>" >>$strfile
839a51c8
MS
880 fail=`expr $fail + 1`
881else
882 echo "PASS: Printer 'Test1' correctly produced $count page(s)."
35fc2243 883 echo " <p>PASS: Printer 'Test1' correctly produced $count page(s).</p>" >>$strfile
839a51c8
MS
884fi
885
886# Paged printed on Test2
8fe0183a 887count=`$GREP '^Test2 ' $BASE/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
839a51c8
MS
888expected=`expr $pjobs \* 2 + 3`
889if test $count != $expected; then
890 echo "FAIL: Printer 'Test2' produced $count page(s), expected $expected."
35fc2243 891 echo " <p>FAIL: Printer 'Test2' produced $count page(s), expected $expected.</p>" >>$strfile
839a51c8
MS
892 fail=`expr $fail + 1`
893else
894 echo "PASS: Printer 'Test2' correctly produced $count page(s)."
35fc2243 895 echo " <p>PASS: Printer 'Test2' correctly produced $count page(s).</p>" >>$strfile
839a51c8
MS
896fi
897
a29fd7dd 898# Paged printed on Test3
afe94dff 899count=`$GREP '^Test3 ' $BASE/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
6daeebb5
MS
900expected=2
901if test $count -lt $expected; then
a29fd7dd 902 echo "FAIL: Printer 'Test3' produced $count page(s), expected $expected."
35fc2243 903 echo " <p>FAIL: Printer 'Test3' produced $count page(s), expected $expected.</p>" >>$strfile
a29fd7dd
MS
904 fail=`expr $fail + 1`
905else
906 echo "PASS: Printer 'Test3' correctly produced $count page(s)."
35fc2243 907 echo " <p>PASS: Printer 'Test3' correctly produced $count page(s).</p>" >>$strfile
a29fd7dd
MS
908fi
909
e07d4801 910# Requests logged
8fe0183a 911count=`wc -l $BASE/log/access_log | awk '{print $1}'`
a83658fa 912expected=`expr 35 + 18 + 30 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
e07d4801
MS
913if test $count != $expected; then
914 echo "FAIL: $count requests logged, expected $expected."
35fc2243 915 echo " <p>FAIL: $count requests logged, expected $expected.</p>" >>$strfile
e07d4801
MS
916 fail=`expr $fail + 1`
917else
918 echo "PASS: $count requests logged."
35fc2243 919 echo " <p>PASS: $count requests logged.</p>" >>$strfile
e07d4801
MS
920fi
921
922# Did CUPS-Get-Default get logged?
8fe0183a 923if $GREP -q CUPS-Get-Default $BASE/log/access_log; then
e07d4801 924 echo "FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'"
35fc2243
MS
925 echo " <p>FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'</p>" >>$strfile
926 echo " <pre>" >>$strfile
8fe0183a 927 $GREP CUPS-Get-Default $BASE/log/access_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
35fc2243 928 echo " </pre>" >>$strfile
e07d4801
MS
929 fail=`expr $fail + 1`
930else
931 echo "PASS: CUPS-Get-Default not logged."
35fc2243 932 echo " <p>PASS: CUPS-Get-Default not logged.</p>" >>$strfile
e07d4801 933fi
839a51c8
MS
934
935# Emergency log messages
8fe0183a 936count=`$GREP '^X ' $BASE/log/error_log | wc -l | awk '{print $1}'`
839a51c8
MS
937if test $count != 0; then
938 echo "FAIL: $count emergency messages, expected 0."
8fe0183a 939 $GREP '^X ' $BASE/log/error_log
35fc2243
MS
940 echo " <p>FAIL: $count emergency messages, expected 0.</p>" >>$strfile
941 echo " <pre>" >>$strfile
8fe0183a 942 $GREP '^X ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
35fc2243 943 echo " </pre>" >>$strfile
839a51c8
MS
944 fail=`expr $fail + 1`
945else
946 echo "PASS: $count emergency messages."
35fc2243 947 echo " <p>PASS: $count emergency messages.</p>" >>$strfile
839a51c8
MS
948fi
949
950# Alert log messages
8fe0183a 951count=`$GREP '^A ' $BASE/log/error_log | wc -l | awk '{print $1}'`
839a51c8
MS
952if test $count != 0; then
953 echo "FAIL: $count alert messages, expected 0."
8fe0183a 954 $GREP '^A ' $BASE/log/error_log
35fc2243
MS
955 echo " <p>FAIL: $count alert messages, expected 0.</p>" >>$strfile
956 echo " <pre>" >>$strfile
8fe0183a 957 $GREP '^A ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
35fc2243 958 echo " </pre>" >>$strfile
839a51c8
MS
959 fail=`expr $fail + 1`
960else
961 echo "PASS: $count alert messages."
35fc2243 962 echo " <p>PASS: $count alert messages.</p>" >>$strfile
839a51c8
MS
963fi
964
965# Critical log messages
8fe0183a 966count=`$GREP '^C ' $BASE/log/error_log | wc -l | awk '{print $1}'`
839a51c8
MS
967if test $count != 0; then
968 echo "FAIL: $count critical messages, expected 0."
8fe0183a 969 $GREP '^C ' $BASE/log/error_log
35fc2243
MS
970 echo " <p>FAIL: $count critical messages, expected 0.</p>" >>$strfile
971 echo " <pre>" >>$strfile
8fe0183a 972 $GREP '^C ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
35fc2243 973 echo " </pre>" >>$strfile
839a51c8
MS
974 fail=`expr $fail + 1`
975else
976 echo "PASS: $count critical messages."
35fc2243 977 echo " <p>PASS: $count critical messages.</p>" >>$strfile
839a51c8
MS
978fi
979
980# Error log messages
97980490 981count=`$GREP '^E ' $BASE/log/error_log | $GREP -v 'Unknown default SystemGroup' | wc -l | awk '{print $1}'`
a29fd7dd
MS
982if test $count != 33; then
983 echo "FAIL: $count error messages, expected 33."
8fe0183a 984 $GREP '^E ' $BASE/log/error_log
35fc2243
MS
985 echo " <p>FAIL: $count error messages, expected 33.</p>" >>$strfile
986 echo " <pre>" >>$strfile
8fe0183a 987 $GREP '^E ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
35fc2243 988 echo " </pre>" >>$strfile
839a51c8
MS
989 fail=`expr $fail + 1`
990else
991 echo "PASS: $count error messages."
35fc2243 992 echo " <p>PASS: $count error messages.</p>" >>$strfile
839a51c8
MS
993fi
994
995# Warning log messages
8fe0183a 996count=`$GREP '^W ' $BASE/log/error_log | $GREP -v CreateProfile | wc -l | awk '{print $1}'`
3fc450cd 997if test $count != 8; then
ea99768e 998 echo "FAIL: $count warning messages, expected 8."
8fe0183a 999 $GREP '^W ' $BASE/log/error_log
35fc2243
MS
1000 echo " <p>FAIL: $count warning messages, expected 8.</p>" >>$strfile
1001 echo " <pre>" >>$strfile
8fe0183a 1002 $GREP '^W ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
35fc2243 1003 echo " </pre>" >>$strfile
839a51c8
MS
1004 fail=`expr $fail + 1`
1005else
1006 echo "PASS: $count warning messages."
35fc2243 1007 echo " <p>PASS: $count warning messages.</p>" >>$strfile
839a51c8
MS
1008fi
1009
1010# Notice log messages
8fe0183a 1011count=`$GREP '^N ' $BASE/log/error_log | wc -l | awk '{print $1}'`
839a51c8
MS
1012if test $count != 0; then
1013 echo "FAIL: $count notice messages, expected 0."
8fe0183a 1014 $GREP '^N ' $BASE/log/error_log
35fc2243
MS
1015 echo " <p>FAIL: $count notice messages, expected 0.</p>" >>$strfile
1016 echo " <pre>" >>$strfile
8fe0183a 1017 $GREP '^N ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
35fc2243 1018 echo " </pre>" >>$strfile
839a51c8
MS
1019 fail=`expr $fail + 1`
1020else
1021 echo "PASS: $count notice messages."
35fc2243 1022 echo " <p>PASS: $count notice messages.</p>" >>$strfile
839a51c8
MS
1023fi
1024
1025# Info log messages
8fe0183a 1026count=`$GREP '^I ' $BASE/log/error_log | wc -l | awk '{print $1}'`
839a51c8
MS
1027if test $count = 0; then
1028 echo "FAIL: $count info messages, expected more than 0."
35fc2243 1029 echo " <p>FAIL: $count info messages, expected more than 0.</p>" >>$strfile
839a51c8
MS
1030 fail=`expr $fail + 1`
1031else
1032 echo "PASS: $count info messages."
35fc2243 1033 echo " <p>PASS: $count info messages.</p>" >>$strfile
839a51c8
MS
1034fi
1035
1036# Debug log messages
8fe0183a 1037count=`$GREP '^D ' $BASE/log/error_log | wc -l | awk '{print $1}'`
839a51c8
MS
1038if test $count = 0; then
1039 echo "FAIL: $count debug messages, expected more than 0."
35fc2243 1040 echo " <p>FAIL: $count debug messages, expected more than 0.</p>" >>$strfile
839a51c8
MS
1041 fail=`expr $fail + 1`
1042else
1043 echo "PASS: $count debug messages."
35fc2243 1044 echo " <p>PASS: $count debug messages.</p>" >>$strfile
839a51c8
MS
1045fi
1046
1047# Debug2 log messages
8fe0183a 1048count=`$GREP '^d ' $BASE/log/error_log | wc -l | awk '{print $1}'`
7a14d768
MS
1049if test $count = 0; then
1050 echo "FAIL: $count debug2 messages, expected more than 0."
35fc2243 1051 echo " <p>FAIL: $count debug2 messages, expected more than 0.</p>" >>$strfile
839a51c8
MS
1052 fail=`expr $fail + 1`
1053else
1054 echo "PASS: $count debug2 messages."
35fc2243 1055 echo " <p>PASS: $count debug2 messages.</p>" >>$strfile
839a51c8
MS
1056fi
1057
87f8ade3 1058#
839a51c8 1059# Log files...
87f8ade3
MS
1060#
1061
35fc2243
MS
1062echo " <h1><a name='LOGS'>4 - Log Files</a></h1>" >>$strfile
1063
1064for file in $BASE/log/*_log; do
1065 baselog=`basename $file`
1066
1067 echo " <h2><a name=\"$baselog\">$baselog</a></h2>" >>$strfile
1068 case $baselog in
1069 error_log)
1070 echo " <blockquote>Note: debug2 messages have been filtered out of the HTML report.</blockquote>" >>$strfile
1071 echo " <pre>" >>$strfile
1072 $GREP -v '^d' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
1073 echo " </pre>" >>$strfile
1074 ;;
1075
1076 *)
1077 echo " <pre>" >>$strfile
1078 sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' $file >>$strfile
1079 echo " </pre>" >>$strfile
1080 ;;
1081 esac
1082done
ef416fc2 1083
ef416fc2 1084#
1085# Format the reports and tell the user where to find them...
1086#
1087
ef416fc2 1088cat str-trailer.html >>$strfile
1089
ef416fc2 1090echo ""
d2f1a784
MS
1091for file in $BASE/log/*_log; do
1092 baselog=`basename $file`
1093 cp $file $baselog-$date-$user
1094 echo "Copied log file \"$baselog-$date-$user\" to test directory."
1095done
1096cp $strfile .
1097echo "Copied report file \"cups-str-$date-$user.html\" to test directory."
ef416fc2 1098
d2f1a784 1099# Clean out old failure log files after 1 week...
ae7225e5
MS
1100find . -name \*_log-\*-$user -a -mtime +7 -print -exec rm -f '{}' \; | awk '{print "Removed old log file \"" substr($1,3) "\" from test directory."}'
1101find . -name cups-str-\*-$user.html -a -mtime +7 -print -exec rm -f '{}' \; | awk '{print "Removed old report file \"" $1 "\" from test directory."}'
ef416fc2 1102
d2f1a784 1103echo ""
dd1abb6b 1104
d2f1a784
MS
1105if test $fail != 0; then
1106 echo "$fail tests failed."
db0bd74a 1107 exit 1
35fc2243
MS
1108else
1109 echo "All tests were successful."
db0bd74a 1110fi