diff options
Diffstat (limited to 'test/run-stp-tests.sh')
-rwxr-xr-x | test/run-stp-tests.sh | 72 |
1 files changed, 41 insertions, 31 deletions
diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh index d18eac30..3054c951 100755 --- a/test/run-stp-tests.sh +++ b/test/run-stp-tests.sh @@ -1,11 +1,11 @@ #!/bin/sh # -# "$Id: run-stp-tests.sh 9258 2010-08-13 01:34:04Z mike $" +# "$Id: run-stp-tests.sh 9423 2011-01-06 22:21:05Z mike $" # # Perform the complete set of IPP compliance tests specified in the # CUPS Software Test Plan. # -# Copyright 2007-2010 by Apple Inc. +# Copyright 2007-2011 by Apple Inc. # Copyright 1997-2007 by Easy Software Products, all rights reserved. # # These coded instructions, statements, and computer programs are the @@ -24,10 +24,20 @@ argcount=$# make # +# Solaris has a non-POSIX grep in /bin... +# + +if test -x /usr/xpg4/bin/grep; then + GREP=/usr/xpg4/bin/grep +else + GREP=grep +fi + +# # Figure out the proper echo options... # -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then +if (echo "testing\c"; echo 1,2,3) | $GREP c >/dev/null; then ac_n=-n ac_c= else @@ -625,7 +635,7 @@ else fi # Pages printed on Test1 (within 1 page for timing-dependent cancel issues) -count=`grep '^Test1 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` +count=`$GREP '^Test1 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` expected=`expr $pjobs \* 2 + 34` expected2=`expr $expected + 2` if test $count -lt $expected -a $count -gt $expected2; then @@ -638,7 +648,7 @@ else fi # Paged printed on Test2 -count=`grep '^Test2 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` +count=`$GREP '^Test2 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` expected=`expr $pjobs \* 2 + 3` if test $count != $expected; then echo "FAIL: Printer 'Test2' produced $count page(s), expected $expected." @@ -662,11 +672,11 @@ else fi # Did CUPS-Get-Default get logged? -if grep -q CUPS-Get-Default /tmp/cups-$user/log/access_log; then +if $GREP -q CUPS-Get-Default /tmp/cups-$user/log/access_log; then echo "FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'" echo "<P>FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'</P>" >>$strfile echo "<PRE>" >>$strfile - grep CUPS-Get-Default /tmp/cups-$user/log/access_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile + $GREP CUPS-Get-Default /tmp/cups-$user/log/access_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile fail=`expr $fail + 1` else @@ -675,13 +685,13 @@ else fi # Emergency log messages -count=`grep '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count emergency messages, expected 0." - grep '^X ' /tmp/cups-$user/log/error_log + $GREP '^X ' /tmp/cups-$user/log/error_log echo "<P>FAIL: $count emergency messages, expected 0.</P>" >>$strfile echo "<PRE>" >>$strfile - grep '^X ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile + $GREP '^X ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile fail=`expr $fail + 1` else @@ -690,13 +700,13 @@ else fi # Alert log messages -count=`grep '^A ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^A ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count alert messages, expected 0." - grep '^A ' /tmp/cups-$user/log/error_log + $GREP '^A ' /tmp/cups-$user/log/error_log echo "<P>FAIL: $count alert messages, expected 0.</P>" >>$strfile echo "<PRE>" >>$strfile - grep '^A ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile + $GREP '^A ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile fail=`expr $fail + 1` else @@ -705,13 +715,13 @@ else fi # Critical log messages -count=`grep '^C ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^C ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count critical messages, expected 0." - grep '^C ' /tmp/cups-$user/log/error_log + $GREP '^C ' /tmp/cups-$user/log/error_log echo "<P>FAIL: $count critical messages, expected 0.</P>" >>$strfile echo "<PRE>" >>$strfile - grep '^C ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile + $GREP '^C ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile fail=`expr $fail + 1` else @@ -720,13 +730,13 @@ else fi # Error log messages -count=`grep '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 18; then echo "FAIL: $count error messages, expected 18." - grep '^E ' /tmp/cups-$user/log/error_log + $GREP '^E ' /tmp/cups-$user/log/error_log echo "<P>FAIL: $count error messages, expected 18.</P>" >>$strfile echo "<PRE>" >>$strfile - grep '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile + $GREP '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile fail=`expr $fail + 1` else @@ -735,13 +745,13 @@ else fi # Warning log messages -count=`grep '^W ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^W ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count warning messages, expected 0." - grep '^W ' /tmp/cups-$user/log/error_log + $GREP '^W ' /tmp/cups-$user/log/error_log echo "<P>FAIL: $count warning messages, expected 0.</P>" >>$strfile echo "<PRE>" >>$strfile - grep '^W ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile + $GREP '^W ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile fail=`expr $fail + 1` else @@ -750,13 +760,13 @@ else fi # Notice log messages -count=`grep '^N ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^N ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count notice messages, expected 0." - grep '^N ' /tmp/cups-$user/log/error_log + $GREP '^N ' /tmp/cups-$user/log/error_log echo "<P>FAIL: $count notice messages, expected 0.</P>" >>$strfile echo "<PRE>" >>$strfile - grep '^N ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile + $GREP '^N ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile fail=`expr $fail + 1` else @@ -765,7 +775,7 @@ else fi # Info log messages -count=`grep '^I ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^I ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count = 0; then echo "FAIL: $count info messages, expected more than 0." echo "<P>FAIL: $count info messages, expected more than 0.</P>" >>$strfile @@ -776,7 +786,7 @@ else fi # Debug log messages -count=`grep '^D ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^D ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count = 0; then echo "FAIL: $count debug messages, expected more than 0." echo "<P>FAIL: $count debug messages, expected more than 0.</P>" >>$strfile @@ -787,7 +797,7 @@ else fi # Debug2 log messages -count=`grep '^d ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^d ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count = 0; then echo "FAIL: $count debug2 messages, expected more than 0." echo "<P>FAIL: $count debug2 messages, expected more than 0.</P>" >>$strfile @@ -798,7 +808,7 @@ else fi # Page log file... -if grep -iq 'testfile.pdf na_letter_8.5x11in' /tmp/cups-$user/log/page_log; then +if $GREP -iq 'testfile.pdf na_letter_8.5x11in' /tmp/cups-$user/log/page_log; then echo "PASS: page_log formatted correctly." echo "<P>PASS: page_log formatted correctly.</P>" >>$strfile else @@ -815,7 +825,7 @@ echo "</PRE>" >>$strfile echo "<H2>error_log</H2>" >>$strfile echo "<PRE>" >>$strfile -grep -v '^d' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile +$GREP -v '^d' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/</</g' >>$strfile echo "</PRE>" >>$strfile echo "<H2>page_log</H2>" >>$strfile @@ -852,5 +862,5 @@ if test $fail != 0; then fi # -# End of "$Id: run-stp-tests.sh 9258 2010-08-13 01:34:04Z mike $" +# End of "$Id: run-stp-tests.sh 9423 2011-01-06 22:21:05Z mike $" # |