constant of 5 seconds.
</pre>
<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
<a href="man-ipptoolfile.html?TOPIC=Man+Pages"><b>ipptoolfile</b>(5),</a>
-CUPS Online Help (<a href="http://localhost:631/help)">http://localhost:631/help)</a>,
IANA IPP Registry (<a href="http://www.iana.org/assignments/ipp\-registrations)">http://www.iana.org/assignments/ipp\-registrations)</a>,
PWG Internet Printing Protocol Workgroup (<a href="http://www.pwg.org/ipp">http://www.pwg.org/ipp</a>)
-RFC 2911 (<a href="http://tools.ietf.org/html/rfc2911)">http://tools.ietf.org/html/rfc2911)</a>,
+RFC 8011 (<a href="http://tools.ietf.org/html/rfc8011)">http://tools.ietf.org/html/rfc8011)</a>,
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
Copyright © 2007-2017 by Apple Inc.
<h2 class="title"><a name="DESCRIPTION">Description</a></h2>
The
<a href="man-ipptool.html?TOPIC=Man+Pages"><b>ipptool</b>(1)</a>
-program accepts free-form plain text files that describe one or more IPP requests. Comments start with the "#" character and continue to the end of the line. Each request is enclosed by curly braces, for example:
+program accepts free-form plain text files that describe one or more IPP requests.
+Comments start with the "#" character and continue to the end of the line.
+Each request is enclosed by curly braces, for example:
<pre class="man">
# This is a comment
{
# The name of the test
- NAME "Print PostScript File"
+ NAME "Print PDF File"
# The request to send
OPERATION Print-Job
+
GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
ATTR uri printer-uri $uri
ATTR name requesting-user-name $user
- FILE testfile.ps
+ ATTR mimeMediaType document-format application/pdf
+
+ GROUP job-attributes-tag
+ ATTR collection media-col {
+ # US Letter plain paper from the "main" tray
+ MEMBER collection media-size {
+ MEMBER integer x-dimension 21590
+ MEMBER integer y-dimension 27940
+ }
+ MEMBER integer media-top-margin 423
+ MEMBER integer media-bottom-margin 423
+ MEMBER integer media-left-margin 423
+ MEMBER integer media-right-margin 423
+ MEMBER keyword media-source "main"
+ MEMBER keyword media-type "stationery"
+ }
+
+ FILE testfile.pdf
# The response to expect
STATUS successful-ok
}
{
# The name of the test
- NAME "Get Attributes of PostScript Job"
+ NAME "Wait for Job to Complete"
# The request to send
OPERATION Get-Job-Attributes
+
GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR language attributes-natural-language en
STATUS successful-ok
EXPECT job-id OF-TYPE integer WITH-VALUE $job-id
EXPECT job-uri OF-TYPE uri
- EXPECT job-state OF-TYPE enum WITH-VALUE 3,4,5,6,7,8,9
+ EXPECT job-state OF-TYPE enum WITH-VALUE >5 REPEAT-NO-MATCH
EXPECT job-originating-user-name OF-TYPE name WITH-VALUE "$user"
+
+ # Show the job state until completed...
+ DISPLAY job-state
+ DISPLAY job-state-reasons
}
</pre>
<h3><a name="TOP_LEVEL_DIRECTIVES">Top-level Directives</a></h3>
The following directives are understood within a <i>test</i>:
<dl class="man">
<dt><b>ATTR </b><i>tag attribute-name value(s)</i>
-<dd style="margin-left: 5.0em">Adds an attribute to the test request. Values are separated by the comma (",") character - escape commas using the "" character. Common attributes and values are listed in the IANA IPP registry - see references below.
+<dd style="margin-left: 5.0em">Adds an attribute to the test request.
+Values are separated by the comma (",") character - escape commas using the "" character.
+Common attributes and values are listed in the IANA IPP registry - see references below.
<dt><b>ATTR collection </b><i>attribute-name </i><b>{ MEMBER </b><i>tag member-name value(s) ... </i><b>}</b> [ <i>... </i><b>,{ </b><i>... </i><b>} </b>]
-<dd style="margin-left: 5.0em">Adds a collection attribute to the test request. Member attributes follow the same syntax as regular attributes and can themselves be nested collections. Multiple collection values can be supplied as needed, separated by commas.
+<dd style="margin-left: 5.0em">Adds a collection attribute to the test request.
+Member attributes follow the same syntax as regular attributes and can themselves be nested collections.
+Multiple collection values can be supplied as needed, separated by commas.
<dt><b>COMPRESSION deflate</b>
<dd style="margin-left: 5.0em"><dt><b>COMPRESSION gzip</b>
<dd style="margin-left: 5.0em"><dt><b>COMPRESSION none</b>
<dd style="margin-left: 5.0em">Uses the specified compression on the document data following the attributes in a Print-Job or Send-Document request.
-<dt><b>DELAY </b><i>seconds</i>
-<dd style="margin-left: 5.0em">Specifies a delay before this test will be run.
+<dt><b>DELAY </b><i>seconds</i>[<i>,repeat-seconds</i>]
+<dd style="margin-left: 5.0em">Specifies a delay in seconds before this test will be run.
+If two values are specified, the second value is used as the delay between repeated tests.
<dt><b>DISPLAY </b><i>attribute-name</i>
<dd style="margin-left: 5.0em">Specifies that value of the named attribute should be output as part of the
test report.
</dl>
<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
<a href="man-ipptool.html?TOPIC=Man+Pages"><b>ipptool</b>(1),</a>
-CUPS Online Help (<a href="http://localhost:631/help)">http://localhost:631/help)</a>,
IANA IPP Registry (<a href="http://www.iana.org/assignments/ipp-registrations)">http://www.iana.org/assignments/ipp-registrations)</a>,
PWG Internet Printing Protocol Workgroup (<a href="http://www.pwg.org/ipp)">http://www.pwg.org/ipp)</a>,
-RFC 2911 (<a href="http://tools.ietf.org/html/rfc3911">http://tools.ietf.org/html/rfc3911</a>)
+RFC 8011 (<a href="http://tools.ietf.org/html/rfc8011">http://tools.ietf.org/html/rfc8011</a>)
<h2 class="title"><a name="COPYRIGHT">Copyright</a></h2>
Copyright © 2007-2017 by Apple Inc.
] ] [
<b>-d</b>
] [
+<b>-e</b>
+] [
<b>-o</b>
[
<i>destination(s)</i>
If no classes are specified then all classes are listed.
<dt><b>-d</b>
<dd style="margin-left: 5.0em">Shows the current default destination.
+<dt><b>-e</b>
+<dd style="margin-left: 5.0em">Shows all available destinations on the local network.
<dt><b>-h </b><i>server</i>[<b>:</b><i>port</i>]
<dd style="margin-left: 5.0em">Specifies an alternate server.
<dt><b>-l</b>
<h2 class="title"><a name="CONFORMING_TO">Conforming To</a></h2>
Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", and "#".
Also, printer and class names are <i>not</i> case-sensitive.
-<p>The <i>-h</i>, <i>-E</i>, <i>-U</i>, and <i>-W</i> options are unique to CUPS.
+<p>The <i>-h</i>, <i>-e</i>, <i>-E</i>, <i>-U</i>, and <i>-W</i> options are unique to CUPS.
<p>The Solaris <i>-f</i>, <i>-P</i>, and <i>-S</i> options are silently ignored.
<h2 class="title"><a name="SEE_ALSO">See Also</a></h2>
<a href="man-cancel.html?TOPIC=Man+Pages"><b>cancel</b>(1),</a>
.\"
-.\" ipptool man page for CUPS.
+.\" ipptool man page.
.\"
-.\" Copyright 2010-2015 by Apple Inc.
+.\" Copyright 2010-2017 by Apple Inc.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Apple Inc. and are protected by Federal copyright
.\" 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/".
.\"
-.TH ipptool 1 "CUPS" "26 August 2015" "Apple Inc."
+.TH ipptool 1 "CUPS" "13 June 2017" "Apple Inc."
.SH NAME
ipptool \- perform internet printing protocol requests
.SH SYNOPSIS
.fi
.SH SEE ALSO
.BR ipptoolfile (5),
-CUPS Online Help (http://localhost:631/help),
IANA IPP Registry (http://www.iana.org/assignments/ipp\-registrations),
PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp)
-RFC 2911 (http://tools.ietf.org/html/rfc2911),
+RFC 8011 (http://tools.ietf.org/html/rfc8011),
.SH COPYRIGHT
Copyright \[co] 2007-2017 by Apple Inc.
.\"
-.\" ipptoolfile man page for CUPS.
+.\" ipptoolfile man page.
.\"
-.\" Copyright 2010-2014 by Apple Inc.
+.\" Copyright 2010-2017 by Apple Inc.
.\"
.\" These coded instructions, statements, and computer programs are the
.\" property of Apple Inc. and are protected by Federal copyright
.\" 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/".
.\"
-.TH ipptoolfile 5 "CUPS" "4 February 2015" "Apple Inc."
+.TH ipptoolfile 5 "CUPS" "13 June 2017" "Apple Inc."
.SH NAME
ipptoolfile \- ipptool file format
.SH DESCRIPTION
The
.BR ipptool (1)
-program accepts free-form plain text files that describe one or more IPP requests. Comments start with the "#" character and continue to the end of the line. Each request is enclosed by curly braces, for example:
+program accepts free-form plain text files that describe one or more IPP requests.
+Comments start with the "#" character and continue to the end of the line.
+Each request is enclosed by curly braces, for example:
.nf
# This is a comment
{
# The name of the test
- NAME "Print PostScript File"
+ NAME "Print PDF File"
# The request to send
OPERATION Print\-Job
+
GROUP operation\-attributes\-tag
ATTR charset attributes\-charset utf\-8
ATTR language attributes\-natural\-language en
ATTR uri printer\-uri $uri
ATTR name requesting\-user\-name $user
- FILE testfile.ps
+ ATTR mimeMediaType document\-format application/pdf
+
+ GROUP job\-attributes\-tag
+ ATTR collection media\-col {
+ # US Letter plain paper from the "main" tray
+ MEMBER collection media\-size {
+ MEMBER integer x\-dimension 21590
+ MEMBER integer y\-dimension 27940
+ }
+ MEMBER integer media\-top\-margin 423
+ MEMBER integer media\-bottom\-margin 423
+ MEMBER integer media\-left\-margin 423
+ MEMBER integer media\-right\-margin 423
+ MEMBER keyword media\-source "main"
+ MEMBER keyword media\-type "stationery"
+ }
+
+ FILE testfile.pdf
# The response to expect
STATUS successful\-ok
}
{
# The name of the test
- NAME "Get Attributes of PostScript Job"
+ NAME "Wait for Job to Complete"
# The request to send
OPERATION Get\-Job\-Attributes
+
GROUP operation\-attributes\-tag
ATTR charset attributes\-charset utf\-8
ATTR language attributes\-natural\-language en
STATUS successful\-ok
EXPECT job\-id OF\-TYPE integer WITH\-VALUE $job\-id
EXPECT job\-uri OF\-TYPE uri
- EXPECT job\-state OF\-TYPE enum WITH\-VALUE 3,4,5,6,7,8,9
+ EXPECT job\-state OF\-TYPE enum WITH\-VALUE >5 REPEAT\-NO\-MATCH
EXPECT job\-originating\-user\-name OF\-TYPE name WITH\-VALUE "$user"
+
+ # Show the job state until completed...
+ DISPLAY job-state
+ DISPLAY job-state-reasons
}
.fi
.SS TOP-LEVEL DIRECTIVES
The following directives are understood within a \fItest\fR:
.TP 5
\fBATTR \fItag attribute-name value(s)\fR
-Adds an attribute to the test request. Values are separated by the comma (",") character - escape commas using the "\" character. Common attributes and values are listed in the IANA IPP registry - see references below.
+Adds an attribute to the test request.
+Values are separated by the comma (",") character - escape commas using the "\" character.
+Common attributes and values are listed in the IANA IPP registry - see references below.
.TP 5
\fBATTR collection \fIattribute-name \fB{ MEMBER \fItag member-name value(s) ... \fB}\fR [ \fI... \fB,{ \fI... \fB} \fR]
-Adds a collection attribute to the test request. Member attributes follow the same syntax as regular attributes and can themselves be nested collections. Multiple collection values can be supplied as needed, separated by commas.
+Adds a collection attribute to the test request.
+Member attributes follow the same syntax as regular attributes and can themselves be nested collections.
+Multiple collection values can be supplied as needed, separated by commas.
.TP 5
\fBCOMPRESSION deflate\fR
.TP 5
\fBCOMPRESSION none\fR
Uses the specified compression on the document data following the attributes in a Print-Job or Send-Document request.
.TP 5
-\fBDELAY \fIseconds\fR
-Specifies a delay before this test will be run.
+\fBDELAY \fIseconds\fR[\fI,repeat-seconds\fR]
+Specifies a delay in seconds before this test will be run.
+If two values are specified, the second value is used as the delay between repeated tests.
.TP 5
\fBDISPLAY \fIattribute-name\fR
Specifies that value of the named attribute should be output as part of the
Inserts the current user's login name.
.SH SEE ALSO
.BR ipptool (1),
-CUPS Online Help (http://localhost:631/help),
IANA IPP Registry (http://www.iana.org/assignments/ipp-registrations),
PWG Internet Printing Protocol Workgroup (http://www.pwg.org/ipp),
-RFC 2911 (http://tools.ietf.org/html/rfc3911)
+RFC 8011 (http://tools.ietf.org/html/rfc8011)
.SH COPYRIGHT
Copyright \[co] 2007-2017 by Apple Inc.
ignore_errors, /* Ignore test failures? */
skip_previous = 0, /* Skip on previous test failure? */
repeat_count, /* Repeat count */
- repeat_interval, /* Repeat interval */
- repeat_prev, /* Previous repeat interval */
repeat_test; /* Repeat a test? */
+ useconds_t delay, /* Initial delay */
+ repeat_interval; /* Repeat interval (delay) */
http_t *http = NULL; /* HTTP connection to server */
FILE *fp = NULL; /* Test file */
char resource[512], /* Resource for request */
* Loop on tests...
*/
- CUPS_SRAND(time(NULL));
+ CUPS_SRAND((unsigned)time(NULL));
errors = cupsArrayNew3(NULL, NULL, NULL, 0, (cups_acopy_func_t)strdup,
(cups_afree_func_t)free);
strlcpy(resource, vars->resource, sizeof(resource));
request_id ++;
- request = ippNew();
- op = (ipp_op_t)0;
- group = IPP_TAG_ZERO;
- ignore_errors = IgnoreErrors;
- last_expect = NULL;
- last_status = NULL;
- filename[0] = '\0';
- skip_previous = 0;
- skip_test = 0;
- test_id[0] = '\0';
- version = Version;
- transfer = Transfer;
- compression[0] = '\0';
+ request = ippNew();
+ op = (ipp_op_t)0;
+ group = IPP_TAG_ZERO;
+ ignore_errors = IgnoreErrors;
+ last_expect = NULL;
+ last_status = NULL;
+ filename[0] = '\0';
+ skip_previous = 0;
+ skip_test = 0;
+ test_id[0] = '\0';
+ version = Version;
+ transfer = Transfer;
+ compression[0] = '\0';
+ delay = 0;
+ repeat_count = 0;
+ repeat_interval = 5000000;
strlcpy(name, testfile, sizeof(name));
if (strrchr(name, '.') != NULL)
* Delay before operation...
*/
- double delay;
+ double dval; /* Delay value */
if (!get_token(fp, temp, sizeof(temp), &linenum))
{
expand_variables(vars, token, temp, sizeof(token));
- if ((delay = _cupsStrScand(token, NULL, localeconv())) <= 0.0)
+ if ((dval = _cupsStrScand(token, &tokenptr, localeconv())) <= 0.0 || (*tokenptr && *tokenptr != ','))
{
print_fatal_error(outfile, "Bad DELAY value \"%s\" on line %d.", token,
linenum);
pass = 0;
goto test_exit;
}
- else
- {
+
+ delay = (useconds_t)(1000000.0 * dval);
+
+ if (*tokenptr == ',')
+ {
+ if ((dval = _cupsStrScand(tokenptr + 1, &tokenptr, localeconv())) <= 0.0 || *tokenptr)
+ {
+ print_fatal_error(outfile, "Bad DELAY value \"%s\" on line %d.", token,
+ linenum);
+ pass = 0;
+ goto test_exit;
+ }
+
+ repeat_interval = (useconds_t)(1000000.0 * dval);
+ }
+ else
+ repeat_interval = delay;
+
+ if (delay > 0)
+ {
if (Output == _CUPS_OUTPUT_TEST)
- printf(" [%g second delay]\n", delay);
+ printf(" [%g second delay]\n", delay * 0.000001);
- usleep((useconds_t)(1000000.0 * delay));
+ usleep(delay);
}
}
else if (!_cups_strcasecmp(token, "ATTR"))
}
PasswordTries = 0;
- repeat_count = 0;
- repeat_interval = 1;
- repeat_prev = 1;
do
{
}
}
- sleep((unsigned)repeat_interval);
- repeat_interval = _cupsNextDelay(repeat_interval, &repeat_prev);
+ usleep(repeat_interval);
if (Output == _CUPS_OUTPUT_TEST || (Output == _CUPS_OUTPUT_PLIST && outfile != stdout))
{