#
# 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
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
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
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
#
# 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
#
# 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
#
# 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
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
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
#
# 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
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
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
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`
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
#
# 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
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
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
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`
#
# 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
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
#
# 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
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
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
#
# 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
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
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
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
fi
#
-# Setup the paths...
+# Create a helper script to run programs with...
#
echo "Setting up environment variables for test..."
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
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...
#
#
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
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=$!
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
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
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"
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
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=$?
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')"
# 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`
#
# 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.
#
#
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