]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge test suite changes from CUPS master.
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 11 Oct 2018 18:54:36 +0000 (14:54 -0400)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 11 Oct 2018 18:54:36 +0000 (14:54 -0400)
test/5.1-lpadmin.sh
test/5.2-lpc.sh
test/5.3-lpq.sh
test/5.4-lpstat.sh
test/5.5-lp.sh
test/5.6-lpr.sh
test/5.7-lprm.sh
test/5.8-cancel.sh
test/5.9-lpinfo.sh
test/run-stp-tests.sh
test/waitjobs.sh

index 0d79ac9da979d9c27558e8e116c555f26c7c0a92..7efc398924e16d8f844625b59f9215c743b09246 100644 (file)
@@ -2,20 +2,17 @@
 #
 # Test the lpadmin command.
 #
-# Copyright 2007-2013 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007-2018 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "Add Printer Test"
 echo ""
 echo "    lpadmin -p Test3 -v file:/dev/null -E -m drv:///sample.drv/deskjet.ppd"
-$VALGRIND ../systemv/lpadmin -p Test3 -v file:/dev/null -E -m drv:///sample.drv/deskjet.ppd 2>&1
+$runcups $VALGRIND ../systemv/lpadmin -p Test3 -v file:/dev/null -E -m drv:///sample.drv/deskjet.ppd 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -32,7 +29,7 @@ echo ""
 echo "Modify Printer Test"
 echo ""
 echo "    lpadmin -p Test3 -v file:/tmp/Test3 -o PageSize=A4"
-$VALGRIND ../systemv/lpadmin -p Test3 -v file:/tmp/Test3 -o PageSize=A4 2>&1
+$runcups $VALGRIND ../systemv/lpadmin -p Test3 -v file:/tmp/Test3 -o PageSize=A4 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -44,7 +41,7 @@ echo ""
 echo "Delete Printer Test"
 echo ""
 echo "    lpadmin -x Test3"
-$VALGRIND ../systemv/lpadmin -x Test3 2>&1
+$runcups $VALGRIND ../systemv/lpadmin -x Test3 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -56,7 +53,7 @@ echo ""
 echo "Add Shared Printer Test"
 echo ""
 echo "    lpadmin -p Test3 -E -v ipp://localhost:$IPP_PORT/printers/Test2 -m everywhere"
-$VALGRIND ../systemv/lpadmin -p Test3 -E -v ipp://localhost:$IPP_PORT/printers/Test2 -m everywhere 2>&1
+$runcups $VALGRIND ../systemv/lpadmin -p Test3 -E -v ipp://localhost:$IPP_PORT/printers/Test2 -m everywhere 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 857e885a4eabb0d8b369fe5d47133c64843778b1..155a15764e99eb81f1487bc3e1a70c2163b23721 100644 (file)
@@ -2,20 +2,17 @@
 #
 # Test the lpc command.
 #
-# Copyright 2007 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "LPC Test"
 echo ""
 echo "    lpc status"
-$VALGRIND ../berkeley/lpc status 2>&1
+$runcups $VALGRIND ../berkeley/lpc status 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 4c0e8496811a420e19c17cb6b56e1a8bfe8e2d54..02ddbd96f3e67f11020baf97021a9c1c7b8e591c 100644 (file)
@@ -2,20 +2,17 @@
 #
 # Test the lpq command.
 #
-# Copyright 2007 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "LPQ Test"
 echo ""
 echo "    lpq -P Test1"
-$VALGRIND ../berkeley/lpq -P Test1 2>&1
+$runcups $VALGRIND ../berkeley/lpq -P Test1 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 6dbd44a009aee055fe8075b63f4ac0609598ea73..ba5246dfc68fe505694e1d1dd7c4b7f8b3d9215e 100644 (file)
@@ -2,20 +2,17 @@
 #
 # Test the lpstat command.
 #
-# Copyright 2007-2017 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007-2017 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "LPSTAT Basic Test"
 echo ""
 echo "    lpstat -t"
-$VALGRIND ../systemv/lpstat -t 2>&1
+$runcups $VALGRIND ../systemv/lpstat -t 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -27,7 +24,7 @@ echo ""
 echo "LPSTAT Enumeration Test"
 echo ""
 echo "    lpstat -e"
-printers="`$VALGRIND ../systemv/lpstat -e 2>&1`"
+printers="`$runcups $VALGRIND ../systemv/lpstat -e 2>&1`"
 if test $? != 0 -o "x$printers" = x; then
        echo "    FAILED"
        exit 1
@@ -42,7 +39,7 @@ echo ""
 echo "LPSTAT Get Host Test"
 echo ""
 echo "    lpstat -H"
-server="`$VALGRIND ../systemv/lpstat -H 2>&1`"
+server="`$runcups $VALGRIND ../systemv/lpstat -H 2>&1`"
 if test $? != 0 -o "x$server" != x$CUPS_SERVER; then
        echo "    FAILED ($server)"
        exit 1
index 71fc41800014a7357edd144d5924d2557d83d5b1..ba7c5f91bf868efd603852d753c9fe775f14239a 100644 (file)
@@ -2,20 +2,17 @@
 #
 # Test the lp command.
 #
-# Copyright 2007-2014 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007-2014 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "LP Default Test"
 echo ""
 echo "    lp testfile.pdf"
-$VALGRIND ../systemv/lp testfile.pdf 2>&1
+$runcups $VALGRIND ../systemv/lp testfile.pdf 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -27,7 +24,7 @@ echo ""
 echo "LP Destination Test"
 echo ""
 echo "    lp -d Test3 -o fit-to-page testfile.jpg"
-$VALGRIND ../systemv/lp -d Test3 -o fit-to-page testfile.jpg 2>&1
+$runcups $VALGRIND ../systemv/lp -d Test3 -o fit-to-page testfile.jpg 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -39,7 +36,7 @@ echo ""
 echo "LP Options Test"
 echo ""
 echo "    lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf"
-$VALGRIND ../systemv/lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf 2>&1
+$runcups $VALGRIND ../systemv/lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -57,13 +54,13 @@ pids=""
 while test $i -lt $1; do
        j=1
        while test $j -le $2; do
-               $VALGRIND ../systemv/lp -d test-$j testfile.jpg 2>&1
+               $runcups $VALGRIND ../systemv/lp -d test-$j testfile.jpg 2>&1
                j=`expr $j + 1`
        done
 
-       $VALGRIND ../systemv/lp -d Test1 testfile.jpg 2>&1 &
+       $runcups $VALGRIND ../systemv/lp -d Test1 testfile.jpg 2>&1 &
        pids="$pids $!"
-       $VALGRIND ../systemv/lp -d Test2 testfile.jpg 2>&1 &
+       $runcups $VALGRIND ../systemv/lp -d Test2 testfile.jpg 2>&1 &
        pids="$pids $!"
 
        i=`expr $i + 1`
@@ -82,7 +79,7 @@ echo ""
 echo "LPSTAT Completed Jobs Order Test"
 echo ""
 echo "    lpstat -W completed -o"
-$VALGRIND ../systemv/lpstat -W completed -o | tee $BASE/lpstat-completed.txt
+$runcups $VALGRIND ../systemv/lpstat -W completed -o | tee $BASE/lpstat-completed.txt
 if test "`uniq -d $BASE/lpstat-completed.txt`" != ""; then
        echo "    FAILED"
        exit 1
index d3280d2bbe33bcf7661cc7319dafbca1ab281120..1a1908349ee2e6c6175c76bbcd709c075b2f1e8f 100644 (file)
@@ -2,20 +2,17 @@
 #
 # Test the lpr command.
 #
-# Copyright 2007-2014 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007-2014 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "LPR Default Test"
 echo ""
 echo "    lpr testfile.pdf"
-$VALGRIND ../berkeley/lpr testfile.pdf 2>&1
+$runcups $VALGRIND ../berkeley/lpr testfile.pdf 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -27,7 +24,7 @@ echo ""
 echo "LPR Destination Test"
 echo ""
 echo "    lpr -P Test3 -o fit-to-page testfile.jpg"
-$VALGRIND ../berkeley/lpr -P Test3 -o fit-to-page testfile.jpg 2>&1
+$runcups $VALGRIND ../berkeley/lpr -P Test3 -o fit-to-page testfile.jpg 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -39,7 +36,7 @@ echo ""
 echo "LPR Options Test"
 echo ""
 echo "    lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf"
-$VALGRIND ../berkeley/lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf 2>&1
+$runcups $VALGRIND ../berkeley/lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -57,13 +54,13 @@ pids=""
 while test $i -lt $1; do
        j=1
        while test $j -le $2; do
-               $VALGRIND ../berkeley/lpr -P test-$j testfile.jpg 2>&1
+               $runcups $VALGRIND ../berkeley/lpr -P test-$j testfile.jpg 2>&1
                j=`expr $j + 1`
        done
 
-       $VALGRIND ../berkeley/lpr -P Test1 testfile.jpg 2>&1 &
+       $runcups $VALGRIND ../berkeley/lpr -P Test1 testfile.jpg 2>&1 &
        pids="$pids $!"
-       $VALGRIND ../berkeley/lpr -P Test2 testfile.jpg 2>&1 &
+       $runcups $VALGRIND ../berkeley/lpr -P Test2 testfile.jpg 2>&1 &
        pids="$pids $!"
 
        i=`expr $i + 1`
index e456ec0832aaf9370ac19f1d14fef2cdbfc69bce..29251f943af2a5a677043ee67130837eaa279b57 100644 (file)
@@ -2,22 +2,19 @@
 #
 # Test the lprm command.
 #
-# Copyright 2007-2011 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007-2011 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "LPRM Current Test"
 echo ""
 echo "    lpr -o job-hold-until=indefinite testfile.jpg"
-$VALGRIND ../berkeley/lpr -o job-hold-until=indefinite testfile.jpg 2>&1
+$runcups $VALGRIND ../berkeley/lpr -o job-hold-until=indefinite testfile.jpg 2>&1
 echo "    lprm"
-$VALGRIND ../berkeley/lprm 2>&1
+$runcups $VALGRIND ../berkeley/lprm 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -29,9 +26,9 @@ echo ""
 echo "LPRM Destination Test"
 echo ""
 echo "    lpr -P Test1 -o job-hold-until=indefinite testfile.jpg"
-$VALGRIND ../berkeley/lpr -P Test1 -o job-hold-until=indefinite testfile.jpg 2>&1
+$runcups $VALGRIND ../berkeley/lpr -P Test1 -o job-hold-until=indefinite testfile.jpg 2>&1
 echo "    lprm Test1"
-$VALGRIND ../berkeley/lprm Test1 2>&1
+$runcups $VALGRIND ../berkeley/lprm Test1 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 28bc0fea129d38c980f6121e020250f791a6f235..bd7cf5fbbdf7a7806bc7fd34c07edf87e3829264 100644 (file)
@@ -2,22 +2,19 @@
 #
 # Test the cancel command.
 #
-# Copyright 2007-2013 by Apple Inc.
-# Copyright 1997-2006 by Easy Software Products, all rights reserved.
+# Copyright © 2007-2013 by Apple Inc.
+# Copyright © 1997-2006 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "Cancel Destination Test"
 echo ""
 echo "    lp -d Test1 -o job-hold-until=indefinite testfile.jpg"
-$VALGRIND ../systemv/lp -d Test1 -o job-hold-until=indefinite testfile.jpg 2>&1
+$runcups $VALGRIND ../systemv/lp -d Test1 -o job-hold-until=indefinite testfile.jpg 2>&1
 echo "    cancel Test1"
-$VALGRIND ../systemv/cancel Test1 2>&1
+$runcups $VALGRIND ../systemv/cancel Test1 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -29,7 +26,7 @@ echo ""
 echo "Cancel All Test"
 echo ""
 echo "    cancel -a"
-$VALGRIND ../systemv/cancel -a 2>&1
+$runcups $VALGRIND ../systemv/cancel -a 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -41,7 +38,7 @@ echo ""
 echo "Purge All Test"
 echo ""
 echo "    cancel -a -x"
-$VALGRIND ../systemv/cancel -a -x 2>&1
+$runcups $VALGRIND ../systemv/cancel -a -x 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 9cf6cebfae5d14fac925cecd37a1f5eab83b8362..7d67fe3e06503bc41815cce6cad6164d52589718 100644 (file)
@@ -2,20 +2,17 @@
 #
 # Test the lpinfo command.
 #
-# Copyright 2007-2011 by Apple Inc.
-# Copyright 1997-2005 by Easy Software Products, all rights reserved.
+# Copyright © 2007-2011 by Apple Inc.
+# Copyright © 1997-2005 by Easy Software Products, all rights reserved.
 #
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file.  If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 echo "LPINFO Devices Test"
 echo ""
 echo "    lpinfo -v"
-$VALGRIND ../systemv/lpinfo -v 2>&1
+$runcups $VALGRIND ../systemv/lpinfo -v 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -27,7 +24,7 @@ echo ""
 echo "LPINFO Drivers Test"
 echo ""
 echo "    lpinfo -m"
-$VALGRIND ../systemv/lpinfo -m 2>&1
+$runcups $VALGRIND ../systemv/lpinfo -m 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
@@ -39,7 +36,7 @@ echo ""
 echo "LPINFO Drivers Test"
 echo ""
 echo "    lpinfo -m | grep -q sample.drv"
-$VALGRIND ../systemv/lpinfo -m | grep -q sample.drv 2>&1
+$runcups $VALGRIND ../systemv/lpinfo -m | grep -q sample.drv 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 45f903415e2ed5e0bf5f41d62dfae1c7cb965a9c..4c585e25e67ce27231b74ced16945dff0b6067e0 100755 (executable)
@@ -523,6 +523,7 @@ AccessLog $BASE/log/access_log
 ErrorLog $BASE/log/error_log
 PageLog $BASE/log/page_log
 
+PassEnv DYLD_INSERT_LIBRARIES
 PassEnv DYLD_LIBRARY_PATH
 PassEnv LD_LIBRARY_PATH
 PassEnv LD_PRELOAD
@@ -566,7 +567,7 @@ else
 fi
 
 #
-# Setup the paths...
+# Create a helper script to run programs with...
 #
 
 echo "Setting up environment variables for test..."
@@ -577,22 +578,17 @@ else
        LD_LIBRARY_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc:$LD_LIBRARY_PATH"
 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/ppdc/libcupsppdc.so.1"
+LD_PRELOAD="$root/cups/libcups.so.2:$root/cups/libcupsimage.so.2:$root/cgi-bin/libcupscgi.so.1:$root/scheduler/libcupsmime.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 -f $root/cups/libcups.2.dylib; then
         if test "x$DYLD_INSERT_LIBRARIES" = x; then
-                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="$root/cups/libcups.2.dylib:$root/cups/libcupsimage.2.dylib:$root/cgi-bin/libcupscgi.1.dylib:$root/scheduler/libcupsmime.1.dylib:$root/ppdc/libcupsppdc.1.dylib"
         else
-                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"
+                DYLD_INSERT_LIBRARIES="$root/cups/libcups.2.dylib:$root/cups/libcupsimage.2.dylib:$root/cgi-bin/libcupscgi.1.dylib:$root/scheduler/libcupsmime.1.dylib:$root/ppdc/libcupsppdc.1.dylib:$DYLD_INSERT_LIBRARIES"
         fi
-
-        export DYLD_INSERT_LIBRARIES
 fi
 
 if test "x$DYLD_LIBRARY_PATH" = x; then
@@ -601,23 +597,51 @@ else
        DYLD_LIBRARY_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc:$DYLD_LIBRARY_PATH"
 fi
 
-export DYLD_LIBRARY_PATH
-
 if test "x$SHLIB_PATH" = x; then
        SHLIB_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc"
 else
        SHLIB_PATH="$root/cups:$root/filter:$root/cgi-bin:$root/scheduler:$root/ppdc:$SHLIB_PATH"
 fi
 
-export SHLIB_PATH
-
+# These get exported because they don't have side-effects...
 CUPS_DISABLE_APPLE_DEFAULT=yes; export CUPS_DISABLE_APPLE_DEFAULT
 CUPS_SERVER=localhost:$port; export CUPS_SERVER
 CUPS_SERVERROOT=$BASE; export CUPS_SERVERROOT
 CUPS_STATEDIR=$BASE; export CUPS_STATEDIR
 CUPS_DATADIR=$BASE/share; export CUPS_DATADIR
+IPP_PORT=$port; export IPP_PORT
 LOCALEDIR=$BASE/share/locale; export LOCALEDIR
 
+echo "Creating wrapper script..."
+
+runcups="$BASE/runcups"; export runcups
+
+echo "#!/bin/sh" >$runcups
+echo "# Helper script for running CUPS test instance." >>$runcups
+echo "" >>$runcups
+echo "# Set required environment variables..." >>$runcups
+echo "CUPS_DATADIR=\"$CUPS_DATADIR\"; export CUPS_DATADIR" >>$runcups
+echo "CUPS_SERVER=\"$CUPS_SERVER\"; export CUPS_SERVER" >>$runcups
+echo "CUPS_SERVERROOT=\"$CUPS_SERVERROOT\"; export CUPS_SERVERROOT" >>$runcups
+echo "CUPS_STATEDIR=\"$CUPS_STATEDIR\"; export CUPS_STATEDIR" >>$runcups
+echo "DYLD_INSERT_LIBRARIES=\"$DYLD_INSERT_LIBRARIES\"; export DYLD_INSERT_LIBRARIES" >>$runcups
+echo "DYLD_LIBRARY_PATH=\"$DYLD_LIBRARY_PATH\"; export DYLD_LIBRARY_PATH" >>$runcups
+# IPP_PORT=$port; export IPP_PORT
+echo "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"; export LD_LIBRARY_PATH" >>$runcups
+echo "LD_PRELOAD=\"$LD_PRELOAD\"; export LD_PRELOAD" >>$runcups
+echo "LOCALEDIR=\"$LOCALEDIR\"; export LOCALEDIR" >>$runcups
+echo "SHLIB_PATH=\"$SHLIB_PATH\"; export SHLIB_PATH" >>$runcups
+if test "x$CUPS_DEBUG_LEVEL" != x; then
+       echo "CUPS_DEBUG_FILTER='$CUPS_DEBUG_FILTER'; export CUPS_DEBUG_FILTER" >>$runcups
+       echo "CUPS_DEBUG_LEVEL=$CUPS_DEBUG_LEVEL; export CUPS_DEBUG_LEVEL" >>$runcups
+       echo "CUPS_DEBUG_LOG='$CUPS_DEBUG_LOG'; export CUPS_DEBUG_LOG" >>$runcups
+fi
+echo "" >>$runcups
+echo "# Run command..." >>$runcups
+echo "exec \"\$@\"" >>$runcups
+
+chmod +x $runcups
+
 #
 # Set a new home directory to avoid getting user options mixed in...
 #
@@ -640,7 +664,7 @@ export LC_MESSAGES
 #
 
 echo "Starting scheduler:"
-echo "    $VALGRIND ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &"
+echo "    $runcups $VALGRIND ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &"
 echo ""
 
 if test `uname` = Darwin -a "x$VALGRIND" = x; then
@@ -650,9 +674,9 @@ if test `uname` = Darwin -a "x$VALGRIND" = x; then
                 insert="/usr/lib/libgmalloc.dylib:$DYLD_INSERT_LIBRARIES"
         fi
 
-       DYLD_INSERT_LIBRARIES="$insert" MallocStackLogging=1 ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &
+       DYLD_INSERT_LIBRARIES="$insert" MallocStackLogging=1 $runcups ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &
 else
-       $VALGRIND ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &
+       $runcups $VALGRIND ../scheduler/cupsd -c $BASE/cupsd.conf -f >$BASE/log/debug_log 2>&1 &
 fi
 
 cupsd=$!
@@ -662,33 +686,6 @@ if test "x$testtype" = x0; then
        echo "Scheduler is PID $cupsd and is listening on port $port."
        echo ""
 
-       # Create a helper script to run programs with...
-       runcups="$BASE/runcups"
-
-       echo "#!/bin/sh" >$runcups
-       echo "# Helper script for running CUPS test instance." >>$runcups
-       echo "" >>$runcups
-       echo "# Set required environment variables..." >>$runcups
-       echo "CUPS_DATADIR=\"$CUPS_DATADIR\"; export CUPS_DATADIR" >>$runcups
-       echo "CUPS_SERVER=\"$CUPS_SERVER\"; export CUPS_SERVER" >>$runcups
-       echo "CUPS_SERVERROOT=\"$CUPS_SERVERROOT\"; export CUPS_SERVERROOT" >>$runcups
-       echo "CUPS_STATEDIR=\"$CUPS_STATEDIR\"; export CUPS_STATEDIR" >>$runcups
-       echo "DYLD_LIBRARY_PATH=\"$DYLD_LIBRARY_PATH\"; export DYLD_LIBRARY_PATH" >>$runcups
-       echo "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"; export LD_LIBRARY_PATH" >>$runcups
-       echo "LD_PRELOAD=\"$LD_PRELOAD\"; export LD_PRELOAD" >>$runcups
-       echo "LOCALEDIR=\"$LOCALEDIR\"; export LOCALEDIR" >>$runcups
-       echo "SHLIB_PATH=\"$SHLIB_PATH\"; export SHLIB_PATH" >>$runcups
-       if test "x$CUPS_DEBUG_LEVEL" != x; then
-               echo "CUPS_DEBUG_FILTER='$CUPS_DEBUG_FILTER'; export CUPS_DEBUG_FILTER" >>$runcups
-               echo "CUPS_DEBUG_LEVEL=$CUPS_DEBUG_LEVEL; export CUPS_DEBUG_LEVEL" >>$runcups
-               echo "CUPS_DEBUG_LOG='$CUPS_DEBUG_LOG'; export CUPS_DEBUG_LOG" >>$runcups
-       fi
-       echo "" >>$runcups
-       echo "# Run command..." >>$runcups
-       echo "exec \"\$@\"" >>$runcups
-
-       chmod +x $runcups
-
        echo "The $runcups helper script can be used to test programs"
        echo "with the server."
        exit 0
@@ -704,10 +701,8 @@ else
        sleep 2
 fi
 
-IPP_PORT=$port; export IPP_PORT
-
 while true; do
-       running=`../systemv/lpstat -r 2>/dev/null`
+       running=`$runcups ../systemv/lpstat -r 2>/dev/null`
        if test "x$running" = "xscheduler is running"; then
                break
        fi
@@ -744,6 +739,7 @@ fail=0
 for file in 4*.test ipp-2.1.test; do
        echo $ac_n "Performing $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
                uri="ipp://localhost:$port/printers/Test1"
@@ -752,7 +748,7 @@ for file in 4*.test ipp-2.1.test; do
                uri="ipp://localhost:$port/printers"
                options=""
        fi
-       $VALGRIND ./ipptool -tI $options $uri $file >> $strfile
+       $runcups $VALGRIND ./ipptool -tI $options $uri $file >> $strfile
        status=$?
 
        if test $status != 0; then
@@ -781,7 +777,7 @@ echo "    <pre>" >>$strfile
 for file in 5*.sh; do
        echo $ac_n "Performing $file: $ac_c"
        echo "" >>$strfile
-       echo "\"$file\":" >>$strfile
+        echo "`date '+[%d/%b/%Y:%H:%M:%S %z]'` \"$file\":" >>$strfile
 
        sh $file $pjobs $pprinters >> $strfile
        status=$?
@@ -808,20 +804,20 @@ fi
 
 echo $ac_n "Performing restart test: $ac_c"
 echo "" >>$strfile
-echo "\"5.10-restart\":" >>$strfile
+echo "`date '+[%d/%b/%Y:%H:%M:%S %z]'` \"5.10-restart\":" >>$strfile
 
 kill -HUP $cupsd
 
 while true; do
        sleep 10
 
-       running=`../systemv/lpstat -r 2>/dev/null`
+       running=`$runcups ../systemv/lpstat -r 2>/dev/null`
        if test "x$running" = "xscheduler is running"; then
                break
        fi
 done
 
-description="`../systemv/lpstat -l -p Test1 | grep Description | sed -e '1,$s/^[^:]*: //g'`"
+description="`$runcups ../systemv/lpstat -l -p Test1 | grep Description | sed -e '1,$s/^[^:]*: //g'`"
 if test "x$description" != "xTest Printer 1"; then
        echo "Failed, printer-info for Test1 is '$description', expected 'Test Printer 1'." >>$strfile
        echo "FAIL (got '$description', expected 'Test Printer 1')"
@@ -898,7 +894,7 @@ fi
 # Paged printed on Test3
 count=`$GREP '^Test3 ' $BASE/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
 expected=2
-if test $count -lt $expected; then
+if test $count != $expected; then
        echo "FAIL: Printer 'Test3' produced $count page(s), expected $expected."
        echo "    <p>FAIL: Printer 'Test3' produced $count page(s), expected $expected.</p>" >>$strfile
        fail=`expr $fail + 1`
index dee7b1b9b7c7f1694d78d41a18dd264268ed15b3..6e20e3caf1e3aba67129dd34e10cfadb52f66da7 100755 (executable)
@@ -2,13 +2,10 @@
 #
 # Script to wait for jobs to complete.
 #
-#   Copyright 2008-2009 by Apple Inc.
+# Copyright © 2008-2009 by Apple Inc.
 #
-#   These coded instructions, statements, and computer programs are the
-#   property of Apple Inc. and are protected by Federal copyright
-#   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-#   which should have been included with this file.  If this file is
-#   file is missing or damaged, see the license at "http://www.cups.org/".
+# Licensed under Apache License v2.0.  See the file "LICENSE" for more
+# information.
 #
 
 #
@@ -37,7 +34,7 @@ echo $ac_n "Waiting for jobs to complete...$ac_c"
 oldjobs=0
 
 while test $timeout -gt 0; do
-       jobs=`../systemv/lpstat 2>/dev/null | wc -l | tr -d ' '`
+       jobs=`$runcups ../systemv/lpstat 2>/dev/null | wc -l | tr -d ' '`
        if test $jobs = 0; then
                break
        fi