]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix some output issues in ipptool introduced by migrating to the cupsFile API.
authorMichael Sweet <michael.r.sweet@gmail.com>
Fri, 16 Jun 2017 21:04:07 +0000 (17:04 -0400)
committerMichael Sweet <michael.r.sweet@gmail.com>
Fri, 16 Jun 2017 21:04:07 +0000 (17:04 -0400)
Have cupsFilePuts and cupsFilePrintf flush output on stdio files (keeps with
expectations when moving from stdio calls).

Update IPP tests to point to the right specs and sections, and fix IPP/1.1
tests WRT job progress attributes (which can have "no-value" out of band values
instead of integers).

Add an "lpstat -e" test.

Update test output to conform to HTML 5.

Copy all log files to HTML report and test directory.

Clean out old log and report files in test directory after a failed run.

cups/file.c
test/5.4-lpstat.sh
test/ipp-1.1.test
test/ipp-2.0.test
test/ipp-2.1.test
test/ipp-2.2.test
test/ipp-everywhere.test
test/ipptool.c
test/run-stp-tests.sh
test/str-header.html
test/str-trailer.html

index 731a7fafa35c479a121a1937a6e40ddd4e4ef61c..8cdf0368ce5ae422b4696455eac32895b9caf779 100644 (file)
@@ -1387,7 +1387,11 @@ cupsFilePrintf(cups_file_t *fp,          /* I - CUPS file */
   {
     memcpy(fp->ptr, fp->printf_buffer, (size_t)bytes);
     fp->ptr += bytes;
-    return ((int)bytes);
+
+    if (fp->is_stdio && cupsFileFlush(fp))
+      return (-1);
+    else
+      return ((int)bytes);
   }
 }
 
@@ -1566,7 +1570,11 @@ cupsFilePuts(cups_file_t *fp,            /* I - CUPS file */
   {
     memcpy(fp->ptr, s, (size_t)bytes);
     fp->ptr += bytes;
-    return ((int)bytes);
+
+    if (fp->is_stdio && cupsFileFlush(fp))
+      return (-1);
+    else
+      return ((int)bytes);
   }
 }
 
index 5092dbe98ea0698636727fd9353d79d91e257ed9..6dbd44a009aee055fe8075b63f4ac0609598ea73 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Test the lpstat command.
 #
-# Copyright 2007-2011 by Apple Inc.
+# 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
@@ -12,7 +12,7 @@
 # file is missing or damaged, see the license at "http://www.cups.org/".
 #
 
-echo "LPSTAT Test"
+echo "LPSTAT Basic Test"
 echo ""
 echo "    lpstat -t"
 $VALGRIND ../systemv/lpstat -t 2>&1
@@ -24,7 +24,22 @@ else
 fi
 echo ""
 
-echo "LPSTAT Test"
+echo "LPSTAT Enumeration Test"
+echo ""
+echo "    lpstat -e"
+printers="`$VALGRIND ../systemv/lpstat -e 2>&1`"
+if test $? != 0 -o "x$printers" = x; then
+       echo "    FAILED"
+       exit 1
+else
+       for printer in $printers; do
+               echo $printer
+       done
+       echo "    PASSED"
+fi
+echo ""
+
+echo "LPSTAT Get Host Test"
 echo ""
 echo "    lpstat -H"
 server="`$VALGRIND ../systemv/lpstat -H 2>&1`"
index ffb4ae92f43f82bc5e18831d6c1456f60c43c0cc..f7d8b82ba74a65ff0a197e9a3439d7241b08433b 100644 (file)
@@ -1,16 +1,14 @@
 #
-# "$Id$"
+# IPP/1.1 test suite.
 #
-#   IPP/1.1 test suite.
+# Copyright 2007-2017 by Apple Inc.
+# Copyright 2001-2006 by Easy Software Products. All rights reserved.
 #
-#   Copyright 2007-2015 by Apple Inc.
-#   Copyright 2001-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/".
+# 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/".
 #
 # Usage:
 #
@@ -30,9 +28,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test that a request-id value of 0 is not accepted.
 #
-# Required by: RFC 2911 section 3.1.1
+# Required by: RFC 8011 section 4.1.1
 {
-       NAME "RFC 2911 section 3.1.1: Bad request-id value 0"
+       NAME "RFC 8011 section 4.1.1: Bad request-id value 0"
        REQUEST-ID 0
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
@@ -48,9 +46,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 # Test that the first two attributes must be attributes-charset and
 # attributes-natural-language.
 #
-# Required by: RFC 2911 section 3.1.4
+# Required by: RFC 8011 section 4.1.4
 {
-       NAME "RFC 2911 section 3.1.4: No Operation Attributes"
+       NAME "RFC 8011 section 4.1.4: No Operation Attributes"
        REQUEST-ID random
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
@@ -59,7 +57,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT !printer-uri-supported
 }
 {
-       NAME "RFC 2911 section 3.1.4: attributes-charset"
+       NAME "RFC 8011 section 4.1.4: attributes-charset"
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -69,7 +67,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT !printer-uri-supported
 }
 {
-       NAME "RFC 2911 section 3.1.4: attributes-natural-language"
+       NAME "RFC 8011 section 4.1.4: attributes-natural-language"
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
        ATTR naturalLanguage attributes-natural-language en
@@ -79,7 +77,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT !printer-uri-supported
 }
 {
-       NAME "RFC 2911 section 3.1.4: attributes-natural-language + attributes-charset"
+       NAME "RFC 8011 section 4.1.4: attributes-natural-language + attributes-charset"
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
        ATTR naturalLanguage attributes-natural-language en
@@ -90,7 +88,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT !printer-uri-supported
 }
 {
-       NAME "RFC 2911 section 3.1.4: attributes-charset + attributes-natural-language"
+       NAME "RFC 8011 section 4.1.4: attributes-charset + attributes-natural-language"
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -104,10 +102,10 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test that bad IPP versions are not supported.
 #
-# Required by: RFC 2911 section 3.1.8
+# Required by: RFC 8011 section 4.1.8
 {
        # The name of the test...
-       NAME "RFC 2911 section 3.1.8: Unsupported IPP version 0.0"
+       NAME "RFC 8011 section 4.1.8: Unsupported IPP version 0.0"
        VERSION 0.0
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
@@ -122,9 +120,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test that printer operations require the printer-uri operation attribute.
 #
-# Required by: RFC 2911 section 3.2
+# Required by: RFC 8011 section 4.2
 {
-       NAME "RFC 2911 section 3.2: No printer-uri operation attribute"
+       NAME "RFC 8011 section 4.2: No printer-uri operation attribute"
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -137,9 +135,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Print-Job operation
 #
-# Required by: RFC 2911 section 3.2.1
+# Required by: RFC 8011 section 4.2.1
 {
-       NAME "RFC 2911 section 3.2.1: Print-Job Operation"
+       NAME "RFC 8011 section 4.2.1: Print-Job Operation"
        OPERATION Print-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -172,9 +170,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Validate-Job operation
 #
-# Required by: RFC 2911 section 3.2.3
+# Required by: RFC 8011 section 4.2.3
 {
-       NAME "RFC 2911 section 3.2.3: Validate-Job Operation"
+       NAME "RFC 8011 section 4.2.3: Validate-Job Operation"
        OPERATION Validate-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -193,9 +191,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Printer-Attributes operation
 #
-# Required by: RFC 2911 section 3.2.5
+# Required by: RFC 8011 section 4.2.5
 {
-       NAME "RFC 2911 section 3.2.5: Get-Printer-Attributes Operation (default)"
+       NAME "RFC 8011 section 4.2.5: Get-Printer-Attributes Operation (default)"
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -337,9 +335,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Printer-Attributes operation with requested-attributes
 #
-# Required by: RFC 2911 section 3.2.5
+# Required by: RFC 8011 section 4.2.5
 {
-       NAME "RFC 2911 section 3.2.5: Get-Printer-Attributes Operation (requested-attributes)"
+       NAME "RFC 8011 section 4.2.5: Get-Printer-Attributes Operation (requested-attributes)"
        OPERATION Get-Printer-Attributes
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -358,9 +356,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Jobs operation
 #
-# Required by: RFC 2911 section 3.2.6
+# Required by: RFC 8011 section 4.2.6
 {
-       NAME "RFC 2911 section 3.2.6: Get-Jobs Operation (default)"
+       NAME "RFC 8011 section 4.2.6: Get-Jobs Operation (default)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -415,11 +413,11 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Jobs operation
 #
-# Required by: RFC 2911 section 3.2.6
+# Required by: RFC 8011 section 4.2.6
 {
        SKIP-IF-DEFINED PRINT_JOB_COMPLETED
 
-       NAME "RFC 2911 section 3.2.6: Get-Jobs Operation (requested-attributes)"
+       NAME "RFC 8011 section 4.2.6: Get-Jobs Operation (requested-attributes)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -450,12 +448,12 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT ?date-time-at-completed OF-TYPE no-value|dateTime IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?number-of-intervening-jobs OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?job-message-from-operator OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-k-octets OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-impressions OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-media-sheets OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-k-octets-processed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-media-sheets-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-k-octets OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-media-sheets OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-k-octets-processed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-impressions-completed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-media-sheets-completed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
 
        EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
        EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
@@ -475,11 +473,11 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Jobs operation
 #
-# Required by: RFC 2911 section 3.2.6
+# Required by: RFC 8011 section 4.2.6
 {
        SKIP-IF-DEFINED PRINT_JOB_COMPLETED
 
-       NAME "RFC 2911 section 3.2.6: Get-Jobs Operation (my-jobs)"
+       NAME "RFC 8011 section 4.2.6: Get-Jobs Operation (my-jobs)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -535,7 +533,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Jobs operation
 #
-# Required by: RFC 2911 section 3.2.6
+# Required by: RFC 8011 section 4.2.6
 {
        SKIP-IF-DEFINED PRINT_JOB_COMPLETED
 
@@ -543,7 +541,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        # use the authenticated username over the requesting-user-name value.
        SKIP-IF-DEFINED uriuser
 
-       NAME "RFC 2911 section 3.2.6: Get-Jobs Operation (my-jobs different user)"
+       NAME "RFC 8011 section 4.2.6: Get-Jobs Operation (my-jobs different user)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -599,11 +597,11 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Jobs operation
 #
-# Required by: RFC 2911 section 3.2.6
+# Required by: RFC 8011 section 4.2.6
 {
        SKIP-IF-DEFINED PRINT_JOB_COMPLETED
 
-       NAME "RFC 2911 section 3.2.6: Get-Jobs Operation (which-jobs=not-completed)"
+       NAME "RFC 8011 section 4.2.6: Get-Jobs Operation (which-jobs=not-completed)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -678,9 +676,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Jobs operation
 #
-# Required by: RFC 2911 section 3.2.6
+# Required by: RFC 8011 section 4.2.6
 {
-       NAME "RFC 2911 section 3.2.6: Get-Jobs Operation (which-jobs=completed)"
+       NAME "RFC 8011 section 4.2.6: Get-Jobs Operation (which-jobs=completed)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -736,11 +734,11 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Jobs operation
 #
-# Required by: RFC 2911 section 3.2.6
+# Required by: RFC 8011 section 4.2.6
 {
        SKIP-IF-DEFINED PRINT_JOB_COMPLETED
 
-       NAME "RFC 2911 section 3.2.6: Get-Jobs Operation (which-jobs, requested-attributes)"
+       NAME "RFC 8011 section 4.2.6: Get-Jobs Operation (which-jobs, requested-attributes)"
        OPERATION Get-Jobs
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -772,12 +770,12 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT ?date-time-at-completed OF-TYPE no-value|dateTime IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?number-of-intervening-jobs OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?job-message-from-operator OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-k-octets OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-impressions OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-media-sheets OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-k-octets-processed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-media-sheets-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-k-octets OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-media-sheets OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-k-octets-processed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-impressions-completed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-media-sheets-completed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
 
        EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
        EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
@@ -797,9 +795,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Cancel-Job operation
 #
-# Required by: RFC 2911 section 3.3.3
+# Required by: RFC 8011 section 4.3.3
 {
-       NAME "RFC 2911 section 3.3.3: Cancel-Job Operation (completed job)"
+       NAME "RFC 8011 section 4.3.3: Cancel-Job Operation (completed job)"
        OPERATION Cancel-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -814,9 +812,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Print-Job operation
 #
-# Required by: RFC 2911 section 3.2.1
+# Required by: RFC 8011 section 4.2.1
 {
-       NAME "RFC 2911 section 3.2.1: Print-Job Operation"
+       NAME "RFC 8011 section 4.2.1: Print-Job Operation"
        OPERATION Print-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -849,9 +847,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Cancel-Job operation
 #
-# Required by: RFC 2911 section 3.3.3
+# Required by: RFC 8011 section 4.3.3
 {
-       NAME "RFC 2911 section 3.3.3: Cancel-Job Operation (pending/processing job)"
+       NAME "RFC 8011 section 4.3.3: Cancel-Job Operation (pending/processing job)"
        OPERATION Cancel-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -867,9 +865,9 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Get-Job-Attributes operation
 #
-# Required by: RFC 2911 section 3.3.4
+# Required by: RFC 8011 section 4.3.4
 {
-       NAME "RFC 2911 section 3.3.4: Get-Job-Attributes Operation"
+       NAME "RFC 8011 section 4.3.4: Get-Job-Attributes Operation"
        OPERATION Get-Job-Attributes
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -900,12 +898,12 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        EXPECT ?date-time-at-completed OF-TYPE no-value|dateTime IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?number-of-intervening-jobs OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
        EXPECT ?job-message-from-operator OF-TYPE text IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-k-octets OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-impressions OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-media-sheets OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-k-octets-processed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-impressions-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
-       EXPECT ?job-media-sheets-completed OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-k-octets OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-impressions OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-media-sheets OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-k-octets-processed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-impressions-completed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
+       EXPECT ?job-media-sheets-completed OF-TYPE integer|no-value IN-GROUP job-attributes-tag COUNT 1
 
        EXPECT ?copies OF-TYPE integer IN-GROUP job-attributes-tag COUNT 1 WITH-VALUE >0
        EXPECT ?finishings OF-TYPE enum IN-GROUP job-attributes-tag
@@ -925,12 +923,12 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Print-URI operation
 #
-# Defined by: RFC 2911 section 3.2.2
+# Defined by: RFC 8011 section 4.2.2
 {
        SKIP-IF-NOT-DEFINED OPTIONAL_PRINT_URI
        SKIP-IF-NOT-DEFINED document-uri
 
-       NAME "RFC 2911 section 3.2.2: Print-URI Operation"
+       NAME "RFC 8011 section 4.2.2: Print-URI Operation"
        OPERATION Print-URI
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -961,7 +959,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Print-URI operation with bad document-uri
 #
-# Defined by: RFC 2911 section 3.2.2
+# Defined by: RFC 8011 section 4.2.2
 {
        SKIP-IF-NOT-DEFINED OPTIONAL_PRINT_URI
        SKIP-IF-NOT-DEFINED document-uri
@@ -991,12 +989,12 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Create-Job and Send-Document operations
 #
-# Defined by: RFC 2911 section 3.2.4 and 3.3.1
+# Defined by: RFC 8011 section 4.2.4 and 4.3.1
 {
        SKIP-IF-NOT-DEFINED OPTIONAL_CREATE_JOB
        SKIP-IF-NOT-DEFINED OPTIONAL_SEND_DOCUMENT
 
-       NAME "RFC 2911 section 3.2.4: Create-Job Operation"
+       NAME "RFC 8011 section 4.2.4: Create-Job Operation"
        OPERATION Create-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -1024,7 +1022,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        SKIP-IF-NOT-DEFINED OPTIONAL_SEND_DOCUMENT
        SKIP-PREVIOUS-ERROR yes
 
-       NAME "RFC 2911 section 3.3.1: Send-Document Operation"
+       NAME "RFC 8011 section 4.3.1: Send-Document Operation"
        OPERATION Send-Document
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -1045,7 +1043,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Create-Job and Send-Document operations (no last-document)
 #
-# Defined by: RFC 2911 section 3.2.4 and 3.3.1
+# Defined by: RFC 8011 section 4.2.4 and 4.3.1
 {
        SKIP-IF-NOT-DEFINED OPTIONAL_CREATE_JOB
        SKIP-IF-NOT-DEFINED OPTIONAL_SEND_DOCUMENT
@@ -1099,7 +1097,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        SKIP-IF-NOT-DEFINED OPTIONAL_SEND_DOCUMENT
        SKIP-PREVIOUS-ERROR yes
 
-       NAME "RFC 2911 section 3.3.3: Cancel-Job Operation"
+       NAME "RFC 8011 section 4.3.3: Cancel-Job Operation"
        OPERATION Cancel-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -1114,13 +1112,13 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Create-Job and Send-URI operations
 #
-# Defined by: RFC 2911 section 3.2.4 and 3.3.2
+# Defined by: RFC 8011 section 4.2.4 and 4.3.2
 {
        SKIP-IF-NOT-DEFINED OPTIONAL_CREATE_JOB
        SKIP-IF-NOT-DEFINED OPTIONAL_SEND_URI
        SKIP-IF-NOT-DEFINED document-uri
 
-       NAME "RFC 2911 section 3.2.4: Create-Job Operation"
+       NAME "RFC 8011 section 4.2.4: Create-Job Operation"
        OPERATION Create-Job
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -1149,7 +1147,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        SKIP-IF-NOT-DEFINED document-uri
        SKIP-PREVIOUS-ERROR yes
 
-       NAME "RFC 2911 section 3.3.2: Send-URI Operation"
+       NAME "RFC 8011 section 4.3.2: Send-URI Operation"
        OPERATION Send-URI
        GROUP operation-attributes-tag
        ATTR charset attributes-charset utf-8
@@ -1169,7 +1167,7 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
 
 # Test Create-Job and Send-URI operations (bad URI)
 #
-# Defined by: RFC 2911 section 3.2.4 and 3.3.2
+# Defined by: RFC 8011 section 4.2.4 and 4.3.2
 {
        SKIP-IF-NOT-DEFINED OPTIONAL_CREATE_JOB
        SKIP-IF-NOT-DEFINED OPTIONAL_SEND_URI
@@ -2343,8 +2341,3 @@ DEFINE IPP_URI_SCHEME "/^ipps?://.+$$/"
        STATUS successful-ok
        STATUS client-error-not-possible
 }
-
-
-#
-# End of "$Id$".
-#
index 0ee0e94e3e9f24af2534154af06ffc8f8cfef2b3..28ab4be3492a01e8d0a6c1054cb31f1febedc7e9 100644 (file)
@@ -1,16 +1,14 @@
 #
-# "$Id$"
+# IPP/2.0 test suite.
 #
-#   IPP/2.0 test suite.
+# Copyright 2007-2017 by Apple Inc.
+# Copyright 2001-2006 by Easy Software Products. All rights reserved.
 #
-#   Copyright 2007-2012 by Apple Inc.
-#   Copyright 2001-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/".
+# 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/".
 #
 # Usage:
 #
@@ -19,7 +17,7 @@
 
 # Do all of the IPP/1.1 tests as an IPP/2.0 client
 #
-# Required by: PWG 5100.12 section 4.3
+# Required by: PWG 5100.12 section 4.1
 INCLUDE "ipp-1.1.test"
 
 
@@ -108,8 +106,3 @@ DEFINE MEDIA_REGEX "/^(choice(_((custom|na|asme|roc|oe|roll)_[a-z0-9][-a-z0-9]*_
        EXPECT printer-make-and-model OF-TYPE text IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "/^.{0,127}$$/"
        EXPECT printer-more-info OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1
 }
-
-
-#
-# End of "$Id$".
-#
index e8ddae4d11ad2d10c50170c02f1f138360808022..52655564582938e273086163bd703ff8f0d1ff45 100644 (file)
@@ -1,16 +1,14 @@
 #
-# "$Id$"
+# IPP/2.1 test suite.
 #
-#   IPP/2.1 test suite.
+# Copyright 2007-2017 by Apple Inc.
+# Copyright 2001-2006 by Easy Software Products. All rights reserved.
 #
-#   Copyright 2007-2011 by Apple Inc.
-#   Copyright 2001-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/".
+# 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/".
 #
 # Usage:
 #
@@ -89,8 +87,3 @@ INCLUDE "ipp-2.0.test"
        EXPECT printer-state-change-time OF-TYPE integer IN-GROUP printer-attributes-tag COUNT 1
        EXPECT printer-state-reasons OF-TYPE keyword IN-GROUP printer-attributes-tag
 }
-
-
-#
-# End of "$Id$".
-#
index 3042ec2474ead08d0fe4cf8349152066d13af7c6..a8cbc195378da308a83d41cfe0796393377fabd1 100644 (file)
@@ -1,16 +1,14 @@
 #
-# "$Id$"
+# IPP/2.2 test suite.
 #
-#   IPP/2.2 test suite.
+# Copyright 2007-2017 by Apple Inc.
+# Copyright 2001-2006 by Easy Software Products. All rights reserved.
 #
-#   Copyright 2007-2011 by Apple Inc.
-#   Copyright 2001-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/".
+# 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/".
 #
 # Usage:
 #
@@ -79,8 +77,3 @@ INCLUDE "ipp-2.1.test"
        EXPECT operations-supported WITH-VALUE 0x003A # Resubmit-Job
        EXPECT operations-supported WITH-VALUE 0x003B # Close-Job
 }
-
-
-#
-# End of "$Id$".
-#
index d1e5b2ce37406a17d2e2cbb4eafdf78da242bb2f..a1c8f0025edfe5607fc3b24a6fd972c1eac3070b 100644 (file)
@@ -1,16 +1,14 @@
 #
-# "$Id$"
+# IPP Everywhere test suite.
 #
-#   IPP Everywhere test suite.
+# Copyright 2007-2013 by Apple Inc.
+# Copyright 2001-2006 by Easy Software Products. All rights reserved.
 #
-#   Copyright 2007-2013 by Apple Inc.
-#   Copyright 2001-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/".
+# 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/".
 #
 # Usage:
 #
@@ -9682,8 +9680,3 @@ INCLUDE "ipp-2.0.test"
        STATUS successful-ok
        STATUS server-error-busy REPEAT-MATCH
 }
-
-
-#
-# End of "$Id$".
-#
index 46dd44d1876264a3bd3607aeb0c9539aed70e848..55b9b9796c0ca6acdb5fbfed334040c14bcc8972 100644 (file)
@@ -697,12 +697,12 @@ main(int  argc,                           /* I - Number of command-line args */
     * Show a summary report if there were multiple tests...
     */
 
-    printf("\nSummary: %d tests, %d passed, %d failed, %d skipped\n"
-           "Score: %d%%\n", TestCount, PassCount, FailCount, SkipCount,
-           100 * (PassCount + SkipCount) / TestCount);
+    cupsFilePrintf(cupsFileStdout(), "\nSummary: %d tests, %d passed, %d failed, %d skipped\nScore: %d%%\n", TestCount, PassCount, FailCount, SkipCount, 100 * (PassCount + SkipCount) / TestCount);
   }
 
- /*
+  cupsFileClose(outfile);
+
+/*
   * Exit...
   */
 
@@ -1265,7 +1265,7 @@ do_tests(cups_file_t  *outfile,           /* I - Output file */
       if (Output == _CUPS_OUTPUT_PLIST)
        print_xml_header(outfile);
       if (Output == _CUPS_OUTPUT_TEST || (Output == _CUPS_OUTPUT_PLIST && outfile != cupsFileStdout()))
-       printf("\"%s\":\n", testfile);
+       cupsFilePrintf(cupsFileStdout(), "\"%s\":\n", testfile);
 
       show_header = 0;
     }
@@ -2623,14 +2623,13 @@ do_tests(cups_file_t  *outfile,         /* I - Output file */
     {
       if (Verbosity)
       {
-       printf("    %s:\n", ippOpString(op));
+       cupsFilePrintf(cupsFileStdout(), "    %s:\n", ippOpString(op));
 
        for (attrptr = request->attrs; attrptr; attrptr = attrptr->next)
          print_attr(cupsFileStdout(), _CUPS_OUTPUT_TEST, attrptr, NULL);
       }
 
       cupsFilePrintf(cupsFileStdout(), "    %-68.68s [", name);
-      cupsFileFlush(cupsFileStdout());
     }
 
     if ((skip_previous && !prev_pass) || skip_test)
@@ -2653,7 +2652,7 @@ do_tests(cups_file_t  *outfile,           /* I - Output file */
       }
 
       if (Output == _CUPS_OUTPUT_TEST || (Output == _CUPS_OUTPUT_PLIST && outfile != cupsFileStdout()))
-       cupsFilePuts(cupsFileStdout(), "SKIP]");
+       cupsFilePuts(cupsFileStdout(), "SKIP]\n");
 
       goto skip_error;
     }
@@ -3325,8 +3324,7 @@ do_tests(cups_file_t  *outfile,           /* I - Output file */
        if (Output == _CUPS_OUTPUT_TEST || (Output == _CUPS_OUTPUT_PLIST && outfile != cupsFileStdout()))
         {
           cupsFilePrintf(cupsFileStdout(), "%04d]\n", repeat_count);
-          cupsFileFlush(cupsFileStdout());
-
+\
          if (num_displayed > 0)
          {
            for (attrptr = ippFirstAttribute(response); attrptr; attrptr = ippNextAttribute(response))
@@ -3350,7 +3348,6 @@ do_tests(cups_file_t  *outfile,           /* I - Output file */
        if (Output == _CUPS_OUTPUT_TEST || (Output == _CUPS_OUTPUT_PLIST && outfile != cupsFileStdout()))
        {
          cupsFilePrintf(cupsFileStdout(), "    %-68.68s [", name);
-         cupsFileFlush(cupsFileStdout());
        }
       }
     }
@@ -3388,7 +3385,7 @@ do_tests(cups_file_t  *outfile,           /* I - Output file */
 
     if (Output == _CUPS_OUTPUT_TEST || (Output == _CUPS_OUTPUT_PLIST && outfile != cupsFileStdout()))
     {
-      cupsFilePuts(cupsFileStdout(), prev_pass ? "PASS]" : "FAIL]");
+      cupsFilePuts(cupsFileStdout(), prev_pass ? "PASS]\n" : "FAIL]\n");
 
       if (!prev_pass || (Verbosity && response))
       {
@@ -3500,8 +3497,6 @@ do_tests(cups_file_t  *outfile,           /* I - Output file */
     if (Output == _CUPS_OUTPUT_PLIST)
       cupsFilePuts(outfile, "</dict>\n");
 
-    cupsFileFlush(cupsFileStdout());
-
     ippDelete(response);
     response = NULL;
 
@@ -4402,8 +4397,7 @@ pause_message(const char *message)        /* I - Message */
   * Display the prompt...
   */
 
-  printf("%s\n---- PRESS ANY KEY ----", message);
-  cupsFileFlush(cupsFileStdout());
+  cupsFilePrintf(cupsFileStdout(), "%s\n---- PRESS ANY KEY ----", message);
 
 #ifdef WIN32
  /*
@@ -4438,7 +4432,6 @@ pause_message(const char *message)        /* I - Message */
   */
 
   cupsFilePuts(cupsFileStdout(), "\r                       \r");
-  cupsFileFlush(cupsFileStdout());
 }
 
 
index 7b49d16557fb6493d402ace4b3332dd12407de40..54ed7fbf4c146e85c87b60f087deeaada94a05dc 100755 (executable)
@@ -3,7 +3,7 @@
 # Perform the complete set of IPP compliance tests specified in the
 # CUPS Software Test Plan.
 #
-# Copyright 2007-2016 by Apple Inc.
+# Copyright 2007-2017 by Apple Inc.
 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
 #
 # These coded instructions, statements, and computer programs are the
@@ -739,12 +739,7 @@ done
 
 date=`date "+%Y-%m-%d"`
 
-if test -d $root/.svn; then
-       rev=`svn info . | grep Revision: | awk '{print $2}'`
-       strfile=$BASE/cups-str-2.2-r$rev-$user.html
-else
-       strfile=$BASE/cups-str-2.2-$date-$user.html
-fi
+strfile=$BASE/cups-str-$date-$user.html
 
 rm -f $strfile
 cat str-header.html >$strfile
@@ -756,11 +751,11 @@ cat str-header.html >$strfile
 echo ""
 echo "Running IPP compliance tests..."
 
-echo "<H1><A NAME='IPP'>1 - IPP Compliance Tests</A></H1>" >>$strfile
-echo "<P>This section provides the results to the IPP compliance tests" >>$strfile
-echo "outlined in the CUPS Software Test Plan. These tests were run on" >>$strfile
-echo `date "+%Y-%m-%d"` by $user on `hostname`. >>$strfile
-echo "<PRE>" >>$strfile
+echo "    <h1><a name='IPP'>1 - IPP Compliance Tests</a></h1>" >>$strfile
+echo "    <p>This section provides the results to the IPP compliance tests" >>$strfile
+echo "    outlined in the CUPS Software Test Plan. These tests were run on" >>$strfile
+echo "    $date by $user on `hostname`." >>$strfile
+echo "    <pre>" >>$strfile
 
 fail=0
 for file in 4*.test ipp-2.1.test; do
@@ -785,7 +780,7 @@ for file in 4*.test ipp-2.1.test; do
        fi
 done
 
-echo "</PRE>" >>$strfile
+echo "    </pre>" >>$strfile
 
 #
 # Run the command tests...
@@ -794,11 +789,11 @@ echo "</PRE>" >>$strfile
 echo ""
 echo "Running command tests..."
 
-echo "<H1><A NAME='COMMAND'>2 - Command Tests</A></H1>" >>$strfile
-echo "<P>This section provides the results to the command tests" >>$strfile
-echo "outlined in the CUPS Software Test Plan. These tests were run on" >>$strfile
-echo $date by $user on `hostname`. >>$strfile
-echo "<PRE>" >>$strfile
+echo "    <h1><a name='COMMAND'>2 - Command Tests</a></h1>" >>$strfile
+echo "    <p>This section provides the results to the command tests" >>$strfile
+echo "    outlined in the CUPS Software Test Plan. These tests were run on" >>$strfile
+echo "    $date by $user on `hostname`." >>$strfile
+echo "    <pre>" >>$strfile
 
 for file in 5*.sh; do
        echo $ac_n "Performing $file: $ac_c"
@@ -819,6 +814,7 @@ done
 #
 # Log all allocations made by the scheduler...
 #
+
 if test `uname` = Darwin -a "x$VALGRIND" = x; then
        malloc_history $cupsd -callTree -showContent >$BASE/log/malloc_log 2>&1
 fi
@@ -852,7 +848,7 @@ else
        echo PASS
 fi
 
-echo "</PRE>" >>$strfile
+echo "    </pre>" >>$strfile
 
 #
 # Stop the server...
@@ -868,15 +864,15 @@ cupsdstatus=$?
 
 echo "Test Summary"
 echo ""
-echo "<H1><A NAME='SUMMARY'>3 - Test Summary</A></H1>" >>$strfile
+echo "    <h1><a name='SUMMARY'>3 - Test Summary</a></h1>" >>$strfile
 
 if test $cupsdstatus != 0; then
        echo "FAIL: cupsd failed with exit status $cupsdstatus."
-       echo "<p>FAIL: cupsd failed with exit status $cupsdstatus.</p>" >>$strfile
+       echo "    <p>FAIL: cupsd failed with exit status $cupsdstatus.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: cupsd exited with no errors."
-       echo "<p>PASS: cupsd exited with no errors.</p>" >>$strfile
+       echo "    <p>PASS: cupsd exited with no errors.</p>" >>$strfile
 fi
 
 # Job control files
@@ -884,11 +880,11 @@ count=`ls -1 $BASE/spool | wc -l`
 count=`expr $count - 1`
 if test $count != 0; then
        echo "FAIL: $count job control files were not purged."
-       echo "<P>FAIL: $count job control files were not purged.</P>" >>$strfile
+       echo "    <p>FAIL: $count job control files were not purged.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: All job control files purged."
-       echo "<P>PASS: All job control files purged.</P>" >>$strfile
+       echo "    <p>PASS: All job control files purged.</p>" >>$strfile
 fi
 
 # Pages printed on Test1 (within 1 page for timing-dependent cancel issues)
@@ -897,11 +893,11 @@ expected=`expr $pjobs \* 2 + 34`
 expected2=`expr $expected + 2`
 if test $count -lt $expected -a $count -gt $expected2; then
        echo "FAIL: Printer 'Test1' produced $count page(s), expected $expected."
-       echo "<P>FAIL: Printer 'Test1' produced $count page(s), expected $expected.</P>" >>$strfile
+       echo "    <p>FAIL: Printer 'Test1' produced $count page(s), expected $expected.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: Printer 'Test1' correctly produced $count page(s)."
-       echo "<P>PASS: Printer 'Test1' correctly produced $count page(s).</P>" >>$strfile
+       echo "    <p>PASS: Printer 'Test1' correctly produced $count page(s).</p>" >>$strfile
 fi
 
 # Paged printed on Test2
@@ -909,11 +905,11 @@ count=`$GREP '^Test2 ' $BASE/log/page_log | awk 'BEGIN{count=0}{count=count+$7}E
 expected=`expr $pjobs \* 2 + 3`
 if test $count != $expected; then
        echo "FAIL: Printer 'Test2' produced $count page(s), expected $expected."
-       echo "<P>FAIL: Printer 'Test2' produced $count page(s), expected $expected.</P>" >>$strfile
+       echo "    <p>FAIL: Printer 'Test2' produced $count page(s), expected $expected.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: Printer 'Test2' correctly produced $count page(s)."
-       echo "<P>PASS: Printer 'Test2' correctly produced $count page(s).</P>" >>$strfile
+       echo "    <p>PASS: Printer 'Test2' correctly produced $count page(s).</p>" >>$strfile
 fi
 
 # Paged printed on Test3
@@ -921,11 +917,11 @@ count=`$GREP '^Test3 ' $BASE/log/page_log | grep -v total | awk 'BEGIN{count=0}{
 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
+       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
+       echo "    <p>PASS: Printer 'Test3' correctly produced $count page(s).</p>" >>$strfile
 fi
 
 # Requests logged
@@ -933,24 +929,24 @@ count=`wc -l $BASE/log/access_log | awk '{print $1}'`
 expected=`expr 37 + 18 + 30 + $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
+       echo "    <p>FAIL: $count requests logged, expected $expected.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count requests logged."
-       echo "<P>PASS: $count requests logged.</P>" >>$strfile
+       echo "    <p>PASS: $count requests logged.</p>" >>$strfile
 fi
 
 # Did CUPS-Get-Default get logged?
 if $GREP -q CUPS-Get-Default $BASE/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
+       echo "    <p>FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'</p>" >>$strfile
+       echo "    <pre>" >>$strfile
        $GREP CUPS-Get-Default $BASE/log/access_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
-       echo "</PRE>" >>$strfile
+       echo "    </pre>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: CUPS-Get-Default not logged."
-       echo "<P>PASS: CUPS-Get-Default not logged.</P>" >>$strfile
+       echo "    <p>PASS: CUPS-Get-Default not logged.</p>" >>$strfile
 fi
 
 # Emergency log messages
@@ -958,14 +954,14 @@ count=`$GREP '^X ' $BASE/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count emergency messages, expected 0."
        $GREP '^X ' $BASE/log/error_log
-       echo "<P>FAIL: $count emergency messages, expected 0.</P>" >>$strfile
-       echo "<PRE>" >>$strfile
+       echo "    <p>FAIL: $count emergency messages, expected 0.</p>" >>$strfile
+       echo "    <pre>" >>$strfile
        $GREP '^X ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
-       echo "</PRE>" >>$strfile
+       echo "    </pre>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count emergency messages."
-       echo "<P>PASS: $count emergency messages.</P>" >>$strfile
+       echo "    <p>PASS: $count emergency messages.</p>" >>$strfile
 fi
 
 # Alert log messages
@@ -973,14 +969,14 @@ count=`$GREP '^A ' $BASE/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count alert messages, expected 0."
        $GREP '^A ' $BASE/log/error_log
-       echo "<P>FAIL: $count alert messages, expected 0.</P>" >>$strfile
-       echo "<PRE>" >>$strfile
+       echo "    <p>FAIL: $count alert messages, expected 0.</p>" >>$strfile
+       echo "    <pre>" >>$strfile
        $GREP '^A ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
-       echo "</PRE>" >>$strfile
+       echo "    </pre>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count alert messages."
-       echo "<P>PASS: $count alert messages.</P>" >>$strfile
+       echo "    <p>PASS: $count alert messages.</p>" >>$strfile
 fi
 
 # Critical log messages
@@ -988,14 +984,14 @@ count=`$GREP '^C ' $BASE/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count critical messages, expected 0."
        $GREP '^C ' $BASE/log/error_log
-       echo "<P>FAIL: $count critical messages, expected 0.</P>" >>$strfile
-       echo "<PRE>" >>$strfile
+       echo "    <p>FAIL: $count critical messages, expected 0.</p>" >>$strfile
+       echo "    <pre>" >>$strfile
        $GREP '^C ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
-       echo "</PRE>" >>$strfile
+       echo "    </pre>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count critical messages."
-       echo "<P>PASS: $count critical messages.</P>" >>$strfile
+       echo "    <p>PASS: $count critical messages.</p>" >>$strfile
 fi
 
 # Error log messages
@@ -1003,14 +999,14 @@ count=`$GREP '^E ' $BASE/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 33; then
        echo "FAIL: $count error messages, expected 33."
        $GREP '^E ' $BASE/log/error_log
-       echo "<P>FAIL: $count error messages, expected 33.</P>" >>$strfile
-       echo "<PRE>" >>$strfile
+       echo "    <p>FAIL: $count error messages, expected 33.</p>" >>$strfile
+       echo "    <pre>" >>$strfile
        $GREP '^E ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
-       echo "</PRE>" >>$strfile
+       echo "    </pre>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count error messages."
-       echo "<P>PASS: $count error messages.</P>" >>$strfile
+       echo "    <p>PASS: $count error messages.</p>" >>$strfile
 fi
 
 # Warning log messages
@@ -1018,14 +1014,14 @@ count=`$GREP '^W ' $BASE/log/error_log | $GREP -v CreateProfile | wc -l | awk '{
 if test $count != 8; then
        echo "FAIL: $count warning messages, expected 8."
        $GREP '^W ' $BASE/log/error_log
-       echo "<P>FAIL: $count warning messages, expected 8.</P>" >>$strfile
-       echo "<PRE>" >>$strfile
+       echo "    <p>FAIL: $count warning messages, expected 8.</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
+       echo "    </pre>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count warning messages."
-       echo "<P>PASS: $count warning messages.</P>" >>$strfile
+       echo "    <p>PASS: $count warning messages.</p>" >>$strfile
 fi
 
 # Notice log messages
@@ -1033,69 +1029,74 @@ count=`$GREP '^N ' $BASE/log/error_log | wc -l | awk '{print $1}'`
 if test $count != 0; then
        echo "FAIL: $count notice messages, expected 0."
        $GREP '^N ' $BASE/log/error_log
-       echo "<P>FAIL: $count notice messages, expected 0.</P>" >>$strfile
-       echo "<PRE>" >>$strfile
+       echo "    <p>FAIL: $count notice messages, expected 0.</p>" >>$strfile
+       echo "    <pre>" >>$strfile
        $GREP '^N ' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
-       echo "</PRE>" >>$strfile
+       echo "    </pre>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count notice messages."
-       echo "<P>PASS: $count notice messages.</P>" >>$strfile
+       echo "    <p>PASS: $count notice messages.</p>" >>$strfile
 fi
 
 # Info log messages
 count=`$GREP '^I ' $BASE/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
+       echo "    <p>FAIL: $count info messages, expected more than 0.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count info messages."
-       echo "<P>PASS: $count info messages.</P>" >>$strfile
+       echo "    <p>PASS: $count info messages.</p>" >>$strfile
 fi
 
 # Debug log messages
 count=`$GREP '^D ' $BASE/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
+       echo "    <p>FAIL: $count debug messages, expected more than 0.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count debug messages."
-       echo "<P>PASS: $count debug messages.</P>" >>$strfile
+       echo "    <p>PASS: $count debug messages.</p>" >>$strfile
 fi
 
 # Debug2 log messages
 count=`$GREP '^d ' $BASE/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
+       echo "    <p>FAIL: $count debug2 messages, expected more than 0.</p>" >>$strfile
        fail=`expr $fail + 1`
 else
        echo "PASS: $count debug2 messages."
-       echo "<P>PASS: $count debug2 messages.</P>" >>$strfile
+       echo "    <p>PASS: $count debug2 messages.</p>" >>$strfile
 fi
 
 #
 # Log files...
 #
 
-echo "<H1><A NAME='LOGS'>4 - Log Files</A></H1>" >>$strfile
-
-echo "<H2><A NAME='access_log'>access_log</A></H2>" >>$strfile
-echo "<PRE>" >>$strfile
-sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' $BASE/log/access_log >>$strfile
-echo "</PRE>" >>$strfile
-
-echo "<H2><A NAME='error_log'>error_log</A></H2>" >>$strfile
-echo "<PRE>" >>$strfile
-$GREP -v '^d' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
-echo "</PRE>" >>$strfile
-
-echo "<H2><A NAME='page_log'>page_log</A></H2>" >>$strfile
-echo "<PRE>" >>$strfile
-sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' $BASE/log/page_log >>$strfile
-echo "</PRE>" >>$strfile
+echo "    <h1><a name='LOGS'>4 - Log Files</a></h1>" >>$strfile
+
+for file in $BASE/log/*_log; do
+        baselog=`basename $file`
+
+        echo "    <h2><a name=\"$baselog\">$baselog</a></h2>" >>$strfile
+        case $baselog in
+                error_log)
+                        echo "    <blockquote>Note: debug2 messages have been filtered out of the HTML report.</blockquote>" >>$strfile
+                        echo "    <pre>" >>$strfile
+                        $GREP -v '^d' $BASE/log/error_log | sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' >>$strfile
+                        echo "    </pre>" >>$strfile
+                        ;;
+
+                *)
+                        echo "    <pre>" >>$strfile
+                        sed -e '1,$s/&/&amp;/g' -e '1,$s/</&lt;/g' $file >>$strfile
+                        echo "    </pre>" >>$strfile
+                        ;;
+        esac
+done
 
 #
 # Format the reports and tell the user where to find them...
@@ -1108,25 +1109,25 @@ echo ""
 if test $fail != 0; then
        echo "$fail tests failed."
 
-       if test -d $root/.svn; then
-               cp $BASE/log/error_log error_log-r$rev-$user
-       else
-               cp $BASE/log/error_log error_log-$date-$user
-       fi
-
+        for file in $BASE/log/*_log; do
+                baselog=`basename $file`
+                cp $file $baselog-$date-$user
+                echo "Copied log file \"$baselog-$date-$user\" to test directory."
+        done
        cp $strfile .
-else
-       echo "All tests were successful."
-fi
+        echo "Copied report file \"cups-str-$date-$user.html\" to test directory."
 
-echo "Log files can be found in $BASE/log."
-echo "A HTML report was created in $strfile."
-echo ""
-
-if test $fail != 0; then
-       echo "Copies of the error_log and `basename $strfile` files are in"
-       echo "`pwd`."
-       echo ""
+        # Clean out old failure log files after 1 week...
+        find . -name \*_log-\*-$user -a -mtime +1w -print -exec rm -f '{}' \; | awk '{print "Removed old log file \"" substr($1,3) "\" from test directory."}'
+        find . -name cups-str-\*-$user.html -a -mtime +1w -print -exec rm -f '{}' \; | awk '{print "Removed old report file \"" $1 "\" from test directory."}'
 
+        echo ""
        exit 1
+
+else
+       echo "All tests were successful."
+       echo ""
+        echo "Log files can be found in $BASE/log."
+        echo "A HTML report was created in $strfile."
+        echo ""
 fi
index ff53eaf832c60db11e6aae49dc873c66cb92eabc..35f622ab4a4580b5963926dfeb05908bf9d38729 100644 (file)
@@ -1,35 +1,43 @@
-<HTML>
-<HEAD>
-       <META NAME="Description" CONTENT="CUPS Test Report">
-       <META NAME="COPYRIGHT" CONTENT="Copyright 2007-2016, All Rights Reserved">
-       <META NAME="DOCNUMBER" CONTENT="CUPS-STR-2.2">
-       <META NAME="Author" CONTENT="Apple Inc.">
-       <TITLE>CUPS 2.2 Software Test Report</TITLE>
-       <STYLE TYPE="text/css"><!--
-       PRE {
-         font-size: 80%;
-         margin-left: 2em;
-       }
-       --></STYLE>
-</HEAD>
-<BODY>
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta name="Description" content="CUPS Test Report">
+    <meta name="Copyright" content="Copyright &copy; 2007-2017, All Rights Reserved">
+    <meta name="Author" content="Apple Inc.">
+    <title>CUPS Software Test Report</title>
+    <style type="text/css"><!--
+blockquote {
+  background: #eee;
+  border: 1px solid #ccc;
+  padding: 5px;
+}
+pre {
+  background: #eee;
+  border-left: 2px solid #ccc;
+  font-size: 80%;
+  margin-left: 2em;
+  padding: 5px;
+  white-space: pre-wrap;
+}
+--></style>
+   </head>
+  <body>
+    <h1>CUPS Software Test Report</h1>
 
-<H1>CUPS 2.2 Software Test Report</H1>
+    <p>This software test report provides detailed test results that are used to evaluate the stability and standards compliance of the CUPS software.</p>
 
-<P>This software test report provides detailed test results that
-are used to evaluate the stability and compliance of CUPS Version 2.2.
+    <h2>Document Overview</h2>
 
-<H2>Document Overview</H2>
+    <p>This software test plan is organized into the following sections:</p>
 
-<P>This software test plan is organized into the following sections:
-
-<UL>
-       <LI><A HREF="#IPP">1 - IPP Compliance Tests</A></LI>
-       <LI><A HREF="#COMMAND">2 - Command Tests</A></LI>
-       <LI><A HREF="#SUMMARY">3 - Test Summary</A></LI>
-       <LI><A HREF="#LOGS">4 - Log Files</A><UL>
-               <LI><A HREF="#access_log">access_log</A></LI>
-               <LI><A HREF="#error_log">error_log</A></LI>
-               <LI><A HREF="#page_log">page_log</A></LI>
-       </UL></LI>
-</UL>
+    <ul>
+      <li><a href="#IPP">1 - IPP Compliance Tests</a></li>
+      <li><a href="#COMMAND">2 - Command Tests</a></li>
+      <li><a href="#SUMMARY">3 - Test Summary</a></li>
+      <li><a href="#LOGS">4 - Log Files</a><ul>
+        <li><a href="#access_log">access_log</a></li>
+        <li><a href="#debug_log">debug_log</a></li>
+        <li><a href="#error_log">error_log</a></li>
+        <li><a href="#page_log">page_log</a></li>
+      </ul></li>
+    </ul>
index e04310fdd2d58c69a390aef96e25821cf20ae5ee..b605728ee26a9b0a7be60e81d23f660a87893ebb 100644 (file)
@@ -1,2 +1,2 @@
-</BODY>
-</HTML>
+  </body>
+</html>