]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Add some remote printing and IPP/2.1 conformance tests to the test suite.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 4 May 2012 18:34:39 +0000 (18:34 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 4 May 2012 18:34:39 +0000 (18:34 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10448 7a7537e8-13f0-0310-91df-b6672ffda945

test/5.1-lpadmin.sh
test/5.5-lp.sh
test/5.6-lpr.sh
test/run-stp-tests.sh

index cf116c32307d2937c2e65e495876b6484dc0b57e..668079929c75bbf5c29785db239b5274a7b4eb37 100644 (file)
@@ -4,7 +4,7 @@
 #
 #   Test the lpadmin command.
 #
-#   Copyright 2007-2009 by Apple Inc.
+#   Copyright 2007-2012 by Apple Inc.
 #   Copyright 1997-2005 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -50,6 +50,18 @@ else
 fi
 echo ""
 
+echo "Add Shared Printer Test"
+echo ""
+echo "    lpadmin -p Test3 -E -v ipp://localhost:8631/printers/Test2 -m raw"
+$VALGRIND ../systemv/lpadmin -p Test3 -E -v ipp://localhost:8631/printers/Test2 -m raw 2>&1
+if test $? != 0; then
+       echo "    FAILED"
+       exit 1
+else
+       echo "    PASSED"
+fi
+echo ""
+
 #
 # End of "$Id$".
 #
index 1acd881c4a8c35edd3fcf2ef99089469155ec5ad..949f3d770838cead7d89f06887578a32e6847cf0 100644 (file)
@@ -4,7 +4,7 @@
 #
 #   Test the lp command.
 #
-#   Copyright 2007-2011 by Apple Inc.
+#   Copyright 2007-2012 by Apple Inc.
 #   Copyright 1997-2005 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -28,8 +28,8 @@ echo ""
 
 echo "LP Destination Test"
 echo ""
-echo "    lp -d Test2 testfile.jpg"
-$VALGRIND ../systemv/lp -d Test2 testfile.jpg 2>&1
+echo "    lp -d Test3 -o fit-to-page testfile.jpg"
+$VALGRIND ../systemv/lp -d Test3 -o fit-to-page testfile.jpg 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 8e9b982c0b896df94f8943d1bc9f955df776c323..5d0663af3d10869d39cf3a265a90161fd4492b54 100644 (file)
@@ -4,7 +4,7 @@
 #
 #   Test the lpr command.
 #
-#   Copyright 2007-2011 by Apple Inc.
+#   Copyright 2007-2012 by Apple Inc.
 #   Copyright 1997-2005 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -28,8 +28,8 @@ echo ""
 
 echo "LPR Destination Test"
 echo ""
-echo "    lpr -P Test2 testfile.jpg"
-$VALGRIND ../berkeley/lpr -P Test2 testfile.jpg 2>&1
+echo "    lpr -P Test3 -o fit-to-page testfile.jpg"
+$VALGRIND ../berkeley/lpr -P Test3 -o fit-to-page testfile.jpg 2>&1
 if test $? != 0; then
        echo "    FAILED"
        exit 1
index 05f812b2deb1d7a6b3af016b0635e2ad90016c22..cade7a192e40832f8f3a277779d7e14b4618cdf2 100755 (executable)
@@ -5,7 +5,7 @@
 #   Perform the complete set of IPP compliance tests specified in the
 #   CUPS Software Test Plan.
 #
-#   Copyright 2007-2011 by Apple Inc.
+#   Copyright 2007-2012 by Apple Inc.
 #   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
@@ -371,7 +371,7 @@ cat >/tmp/cups-$user/cupsd.conf <<EOF
 Browsing Off
 FileDevice yes
 Printcap
-Listen 127.0.0.1:$port
+Listen localhost:$port
 User $user
 ServerRoot /tmp/cups-$user
 StateDir /tmp/cups-$user
@@ -395,9 +395,7 @@ LogTimeFormat usecs
 PreserveJobHistory Yes
 <Policy default>
 <Limit All>
-Order Deny,Allow
-Deny from all
-Allow from 127.0.0.1
+Order Allow,Deny
 $encryption
 </Limit>
 </Policy>
@@ -605,11 +603,18 @@ echo `date "+%Y-%m-%d"` by $user on `hostname`. >>$strfile
 echo "<PRE>" >>$strfile
 
 fail=0
-for file in 4*.test; do
+for file in 4*.test ipp-2.1.test; do
        echo $ac_n "Performing $file: $ac_c"
        echo "" >>$strfile
 
-       $VALGRIND ./ipptool -tI ipp://localhost:$port/printers $file >> $strfile
+       if test $file = ipp-2.1.test; then
+               uri="ipp://localhost:$port/printers/Test1"
+               options="-V 2.1 -d NOPRINT=1 -f testfile.ps"
+       else
+               uri="ipp://localhost:$port/printers"
+               options=""
+       fi
+       $VALGRIND ./ipptool -tI $options $uri $file >> $strfile
        status=$?
 
        if test $status != 0; then
@@ -710,9 +715,21 @@ else
        echo "<P>PASS: Printer 'Test2' correctly produced $count page(s).</P>" >>$strfile
 fi
 
+# Paged printed on Test3
+count=`$GREP '^Test3 ' /tmp/cups-$user/log/page_log | grep -v total | awk 'BEGIN{count=0}{count=count+$7}END{print count}'`
+expected=2
+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`
+else
+       echo "PASS: Printer 'Test3' correctly produced $count page(s)."
+       echo "<P>PASS: Printer 'Test3' correctly produced $count page(s).</P>" >>$strfile
+fi
+
 # Requests logged
 count=`wc -l /tmp/cups-$user/log/access_log | awk '{print $1}'`
-expected=`expr 37 + 18 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
+expected=`expr 37 + 18 + 28 + $pjobs \* 8 + $pprinters \* $pjobs \* 4`
 if test $count != $expected; then
        echo "FAIL: $count requests logged, expected $expected."
        echo "<P>FAIL: $count requests logged, expected $expected.</P>" >>$strfile
@@ -782,10 +799,10 @@ fi
 
 # Error log messages
 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."
+if test $count != 33; then
+       echo "FAIL: $count error messages, expected 33."
        $GREP '^E ' /tmp/cups-$user/log/error_log
-       echo "<P>FAIL: $count error messages, expected 18.</P>" >>$strfile
+       echo "<P>FAIL: $count error messages, expected 33.</P>" >>$strfile
        echo "<PRE>" >>$strfile
        $GREP '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile