]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
<rdar://problem/16532240> Root Regression: On restart or checking share box in sys...
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 7 Apr 2014 15:18:44 +0000 (15:18 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Mon, 7 Apr 2014 15:18:44 +0000 (15:18 +0000)
Fix /DefaultPrinter handling.

Also add restart testing (just for this specific issue for now) to the "make check" suite.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11798 a1ca3aef-8c08-0410-bb20-df032aa958be

scheduler/printers.c
test/4.2-cups-printer-ops.test
test/run-stp-tests.sh

index 81e9ce860722520e2df8c541cf800cf26f307e6b..34d887ff99a37580e7e9a377c39376b6d12e1340 100644 (file)
@@ -885,7 +885,7 @@ cupsdLoadAllPrinters(void)
         cupsdLogMessage(CUPSD_LOG_ERROR,
                        "Syntax error on line %d of printers.conf.", linenum);
     }
-    else if (!_cups_strcasecmp(line, "</Printer>") || _cups_strcasecmp(line, "</DefaultPrinter>"))
+    else if (!_cups_strcasecmp(line, "</Printer>") || !_cups_strcasecmp(line, "</DefaultPrinter>"))
     {
       if (p != NULL)
       {
index 022335758c04390312dd0a78c8ba1efcaa07ba4d..241238281c8509cfb69d7e0c6a5b5bb2d3d4a3b6 100644 (file)
        ATTR uri device-uri file:/tmp/Test1
        ATTR enum printer-state 3
        ATTR boolean printer-is-accepting-jobs true
+       ATTR text printer-info "Test Printer 1"
 
        FILE testps.ppd
 
index 8569bf45f3ac8d7fd2fecfb50bb2cf42cb989efc..a9d1afa553a92542c69f1ba6b29edcee1b811a9e 100755 (executable)
@@ -766,6 +766,35 @@ for file in 5*.sh; do
        fi
 done
 
+#
+# Restart the server...
+#
+
+echo $ac_n "Performing restart test: $ac_c"
+echo "" >>$strfile
+echo "\"5.10-restart\":" >>$strfile
+
+kill -HUP $cupsd
+
+while true; do
+       running=`../systemv/lpstat -r 2>/dev/null`
+       if test "x$running" = "xscheduler is running"; then
+               break
+       fi
+
+       sleep 10
+done
+
+description="`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')"
+       fail=`expr $fail + 1`
+else
+       echo "Passed." >>$strfile
+       echo PASS
+fi
+
 echo "</PRE>" >>$strfile
 
 #
@@ -924,10 +953,10 @@ fi
 
 # Warning log messages
 count=`$GREP '^W ' $BASE/log/error_log | $GREP -v CreateProfile | wc -l | awk '{print $1}'`
-if test $count != 9; then
-       echo "FAIL: $count warning messages, expected 9."
+if test $count != 18; then
+       echo "FAIL: $count warning messages, expected 18."
        $GREP '^W ' $BASE/log/error_log
-       echo "<P>FAIL: $count warning messages, expected 9.</P>" >>$strfile
+       echo "<P>FAIL: $count warning messages, expected 18.</P>" >>$strfile
        echo "<PRE>" >>$strfile
        $GREP '^W ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
        echo "</PRE>" >>$strfile