5 :: IPP Everywhere Printer Self
-Certification Manual
1.0: Section
5: Bonjour Tests.
7 :: Copyright
2014-2015 by The Printer Working Group.
9 :: This program may be copied and furnished to others
, and derivative works
10 :: that comment on
, or otherwise explain it or assist in its implementation may
11 :: be prepared
, copied
, published and distributed
, in whole or in part
, without
12 :: restriction of any kind
, provided that the above copyright notice and this
13 :: paragraph are included on all such copies and derivative works.
15 :: The IEEE
-ISTO and the Printer Working Group DISCLAIM ANY AND ALL WARRANTIES
,
16 :: WHETHER EXPRESS OR IMPLIED INCLUDING
(WITHOUT LIMITATION
) ANY IMPLIED
17 :: WARRANTIES OF MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE.
21 :: bonjour
-tests.bat
'Printer Name'
24 set PLIST
=%1 Bonjour Results.plist
25 echo Sending output to
"%PLIST%"...
27 :: Write the standard XML plist header...
28 echo ^
<?xml version
=^
"1.0^" encoding
=^
"UTF-8^"?^
> >"%PLIST%"
29 echo ^
<!DOCTYPE plist PUBLIC ^
"-//Apple Computer//DTD PLIST 1.0//EN^" ^
"http://www.apple.com/DTDs/PropertyList-1.0.dtd^"^
> >>"%PLIST%"
30 echo ^
<plist version
=^
"1.0^"^
> >>"%PLIST%"
31 echo ^
<dict^
> >>"%PLIST%"
32 echo ^
<key^
>Tests^
</key^
>^
<array^
> >>"%PLIST%"
39 :: B
-1. IPP Browse test
: Printers appear in a search
for "_ipp._tcp,_print" services?
41 set <NUL
/p
="B-1. IPP Browse test: "
42 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-1. IPP Browse test^
</string^
> >>"%PLIST%"
43 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20151009.bonjour^
</string^
> >>"%PLIST%"
46 ippfind _ipp._tcp
,_print.local.
--name
"%1" --quiet
&& set result
=PASS
47 if "%result%" == "PASS" (
54 if "%result%" == "FAIL" (
55 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
57 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
59 echo ^
</dict^
> >>"%PLIST%"
61 :: B
-2. IPP TXT
keys test
: The IPP TXT record contains all required
keys.
63 set <NUL
/p
="B-2. IPP TXT keys test: "
64 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-2. IPP TXT
keys test^
</string^
> >>"%PLIST%"
65 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
68 ippfind
"%1._ipp._tcp.local." --txt adminurl
--txt pdl
--txt rp
--txt UUID
--quiet
&& set result
=PASS
69 if "%result%" == "PASS" (
73 echo ^
<key^
>Errors^
</key^
>^
<array^
>^
<string^
> >>"%PLIST%"
74 ippfind
"%1._ipp._tcp.local." -x
echo adminurl
="{txt_adminurl}" ";" >>"%PLIST%"
75 ippfind
"%1._ipp._tcp.local." -x
echo pdl
="{txt_pdl}" ";" >>"%PLIST%"
76 ippfind
"%1._ipp._tcp.local." -x
echo rp
="{txt_rp}" ";" >>"%PLIST%"
77 ippfind
"%1._ipp._tcp.local." -x
echo UUID
="{txt_uuid}" ";" >>"%PLIST%"
78 echo ^
</string^
>^
</array^
> >>"%PLIST%"
82 if "%result%" == "FAIL" (
83 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
85 ippfind
"%1._ipp._tcp.local." -x
echo adminurl
="{txt_adminurl}" ";"
86 ippfind
"%1._ipp._tcp.local." -x
echo pdl
="{txt_pdl}" ";"
87 ippfind
"%1._ipp._tcp.local." -x
echo rp
="{txt_rp}" ";"
88 ippfind
"%1._ipp._tcp.local." -x
echo UUID
="{txt_uuid}" ";"
90 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
92 echo ^
</dict^
> >>"%PLIST%"
94 :: B
-3. IPP Resolve test
: Printer responds to an IPP Get
-Printer
-Attributes request using the resolved hostname
, port
, and resource
path.
96 set <NUL
/p
="B-3. IPP Resolve test: "
97 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-3. IPP Resolve test^
</string^
> >>"%PLIST%"
98 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
101 (ippfind
"%1._ipp._tcp.local." --ls
&& set result
=PASS
) >nul
:
102 if "%result%" == "PASS" (
106 echo ^
<key^
>Errors^
</key^
>^
<array^
>^
<string^
> >>"%PLIST%"
107 ippfind
"%1._ipp._tcp.local." --ls
>>"%PLIST%"
108 echo ^
</string^
>^
</array^
> >>"%PLIST%"
112 if "%result%" == "FAIL" (
113 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
115 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
117 echo ^
</dict^
> >>"%PLIST%"
119 :: B
-4. IPP TXT values test
: The IPP TXT record values match the reported IPP attribute values.
121 set <NUL
/p
="B-4. IPP TXT values test: "
122 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-4. IPP TXT values test^
</string^
> >>"%PLIST%"
123 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
126 ippfind
"%1._ipp._tcp.local." --txt
-adminurl ^^^
(http
:^|https
:^
)// --txt
-pdl image
/pwg
-raster
--txt
-pdl image
/jpeg
--txt
-rp ^^ipp
/^
(print^|
print/[^^
/]+^
)$
--txt
-UUID ^^
[0-9a
-fA
-F
]{8,8}-[0-9a
-fA
-F
]{4,4}-[0-9a
-fA
-F
]{4,4}-[0-9a
-fA
-F
]{4,4}-[0-9a
-fA
-F
]{12,12}$
-x ipptool
-q
-d
"ADMINURL={txt_adminurl}" -d
"UUID={txt_uuid}" "{}" bonjour
-value
-tests.test
";" && set result
=PASS
127 if "%result%" == "PASS" (
131 echo ^
<key^
>Errors^
</key^
>^
<array^
>^
<string^
> >>"%PLIST%"
132 ippfind
"%1._ipp._tcp.local." -x
echo adminurl
="{txt_adminurl}" ";" >>"%PLIST%"
133 ippfind
"%1._ipp._tcp.local." -x
echo pdl
="{txt_pdl}" ";" >>"%PLIST%"
134 ippfind
"%1._ipp._tcp.local." -x
echo rp
="{txt_rp}" ";" >>"%PLIST%"
135 ippfind
"%1._ipp._tcp.local." -x
echo UUID
="{txt_uuid}" ";" >>"%PLIST%"
136 ippfind
"%1._ipp._tcp.local." -x ipptool
-t
"{}" bonjour
-value
-tests.test
";" | findstr
/r
[TG
][EO
][DT
]: >>"%PLIST%"
137 echo ^
</string^
>^
</array^
> >>"%PLIST%"
141 if "%result%" == "FAIL" (
142 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
144 ippfind
"%1._ipp._tcp.local." -x
echo adminurl
="{txt_adminurl}" ";"
145 ippfind
"%1._ipp._tcp.local." -x
echo pdl
="{txt_pdl}" ";"
146 ippfind
"%1._ipp._tcp.local." -x
echo rp
="{txt_rp}" ";"
147 ippfind
"%1._ipp._tcp.local." -x
echo UUID
="{txt_uuid}" ";"
148 ippfind
"%1._ipp._tcp.local." -x ipptool
-t
"{}" bonjour
-value
-tests.test
";" | findstr
/r
[TG
][EO
][DT
]:
150 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
152 echo ^
</dict^
> >>"%PLIST%"
154 :: B
-5. TLS tests
: Performed only
if TLS is supported
156 set <NUL
/p
="B-5. TLS tests: "
157 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-5. TLS tests^
</string^
> >>"%PLIST%"
158 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
161 ippfind
"%1._ipp._tcp.local." --txt tls
--quiet
&& set result
=PASS
162 if "%result%" == "PASS" (
171 if "%result%" == "SKIP" (
172 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
173 echo ^
<key^
>Skipped^
</key^
>^
<true
/^
> >>"%PLIST%"
175 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
177 echo ^
</dict^
> >>"%PLIST%"
179 :: B
-5.1 HTTP Upgrade test
: Printer responds to an IPP Get
-Printer
-Attributes request after doing an HTTP Upgrade to TLS.
181 set <NUL
/p
="B-5.1 HTTP Upgrade test: "
182 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-5.1 HTTP Upgrade test^
</string^
> >>"%PLIST%"
183 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
185 if "%HAVE_TLS%" == "1" (
187 ippfind
"%1._ipp._tcp.local." -x ipptool
-E
-q
"{}" bonjour
-access
-tests.test
";" && set result
=PASS
188 if "%result%" == "PASS" (
192 echo ^
<key^
>Errors^
</key^
>^
<array^
>^
<string^
> >>"%PLIST"
193 ippfind
"%1._ipp._tcp.local." -x ipptool
-E
-q
"{}" bonjour
-access
-tests.test
";" >>"%PLIST%"
194 echo ^
</string^
>^
</array^
> >>"%PLIST%"
202 if "%result%" == "FAIL" (
203 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
205 if "%result%" == "SKIP" (
206 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
207 echo ^
<key^
>Skipped^
</key^
>^
<true
/^
> >>"%PLIST%"
209 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
212 echo ^
</dict^
> >>"%PLIST%"
214 :: B
-5.2 IPPS Browse test
: Printer appears in a search
for "_ipps._tcp,_print" services.
216 set <NUL
/p
="B-5.2 IPPS Browse test: "
217 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-5.2 IPPS Browse test^
</string^
> >>"%PLIST%"
218 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
220 if "%HAVE_TLS%" == "1" (
222 ippfind _ipps._tcp
,_print.local.
--name
"%1" --quiet
&& set result
=PASS
223 if "%result%" == "PASS" (
234 if "%result%" == "FAIL" (
235 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
237 if "%result%" == "SKIP" (
238 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
239 echo ^
<key^
>Skipped^
</key^
>^
<true
/^
> >>"%PLIST%"
241 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
244 echo ^
</dict^
> >>"%PLIST%"
246 :: B
-5.3 IPPS TXT
keys test
: The TXT record
for IPPS contains all required
keys
248 set <NUL
/p
="B-5.3 IPPS TXT keys test: "
249 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-5.3 IPPS TXT
keys test^
</string^
> >>"%PLIST%"
250 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
252 if "%HAVE_TLS%" == "1" (
254 ippfind
"%1._ipps._tcp.local." --txt adminurl
--txt pdl
--txt rp
--txt TLS
--txt UUID
--quiet
&& set result
=PASS
255 if "%result%" == "PASS" (
259 echo ^
<key^
>Errors^
</key^
>^
<array^
>^
<string^
> >>"%PLIST%"
260 ippfind
"%1._ipps._tcp.local." -x
echo adminurl
={txt_adminurl
}" ";" >>"%PLIST%"
261 ippfind "%1._ipps._tcp.local.
" -x echo pdl={txt_pdl}" ";" >>"%PLIST%"
262 ippfind
"%1._ipps._tcp.local." -x
echo rp
={txt_rp
}" ";" >>"%PLIST%"
263 ippfind "%1._ipps._tcp.local.
" -x echo TLS={txt_tls}" ";" >>"%PLIST%"
264 ippfind
"%1._ipps._tcp.local." -x
echo UUID
={txt_uuid
}" ";" >>"%PLIST%"
265 echo ^</string^>^</array^> >>"%PLIST%"
273 if "%result%" == "FAIL
" (
274 echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
276 ippfind "%1._ipps._tcp.local.
" -x echo adminurl={txt_adminurl}" ";"
277 ippfind
"%1._ipps._tcp.local." -x
echo pdl
={txt_pdl
}" ";"
278 ippfind "%1._ipps._tcp.local.
" -x echo rp={txt_rp}" ";"
279 ippfind
"%1._ipps._tcp.local." -x
echo TLS
={txt_tls
}" ";"
280 ippfind "%1._ipps._tcp.local.
" -x echo UUID={txt_uuid}" ";"
282 if "%result%" == "SKIP" (
283 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
284 echo ^
<key^
>Skipped^
</key^
>^
<true
/^
> >>"%PLIST%"
286 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
289 echo ^
</dict^
> >>"%PLIST%"
291 :: B
-5.4 IPPS Resolve test
: Printer responds to an IPPS Get
-Printer
-Attributes request using the resolved hostname
, port
, and resource
path.
293 set <NUL
/p
="B-5.4 IPPS Resolve test: "
294 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-5.4 IPPS Resolve test^
</string^
> >>"%PLIST%"
295 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
297 if "%HAVE_TLS%" == "1" (
299 (ippfind
"%1._ipps._tcp.local." --ls
&& set result
=PASS
) >nul
:
300 if "%result%" == "PASS" (
304 echo ^
<key^
>Errors^
</key^
>^
<array^
>^
<string^
> >>"%PLIST%"
305 ippfind
"%1._ipps._tcp.local." --ls
>>"%PLIST%"
306 echo ^
</string^
>^
</array^
> >>"%PLIST%"
314 if "%result%" == "FAIL" (
315 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
317 if "%result%" == "SKIP" (
318 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
319 echo ^
<key^
>Skipped^
</key^
>^
<true
/^
> >>"%PLIST%"
321 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
324 echo ^
</dict^
> >>"%PLIST%"
326 :: B
-5.5 IPPS TXT values test
: The TXT record values
for IPPS match the reported IPPS attribute values.
328 set <NUL
/p
="B-5.5 IPPS TXT values test: "
329 echo ^
<dict^
>^
<key^
>Name^
</key^
>^
<string^
>B
-5.5 IPPS TXT values test^
</string^
> >>"%PLIST%"
330 echo ^
<key^
>FileId^
</key^
>^
<string^
>org.pwg.ipp
-everywhere
.20140826.bonjour^
</string^
> >>"%PLIST%"
332 if "%HAVE_TLS%" == "1" (
334 ippfind
"%1._ipps._tcp.local." --txt
-adminurl ^^^
(http
:^|https
:^
)// --txt
-pdl image
/pwg
-raster
--txt
-pdl image
/jpeg
--txt
-rp ^^ipp
/^
(print^|
print/[^^
/]+^
)$
--txt
-UUID ^^
[0-9a
-fA
-F
]{8,8}-[0-9a
-fA
-F
]{4,4}-[0-9a
-fA
-F
]{4,4}-[0-9a
-fA
-F
]{4,4}-[0-9a
-fA
-F
]{12,12}$
-x ipptool
-q
"{}" bonjour
-value
-tests.test
";" && set result
=PASS
335 if "%result%" == "PASS" (
339 echo ^
<key^
>Errors^
</key^
>^
<array^
>^
<string^
> >>"%PLIST%"
340 ippfind
"%1._ipps._tcp.local." -x
echo adminurl
="{txt_adminurl}" ";" >>"%PLIST%"
341 ippfind
"%1._ipps._tcp.local." -x
echo pdl
="{txt_pdl}" ";" >>"%PLIST%"
342 ippfind
"%1._ipps._tcp.local." -x
echo rp
="{txt_rp}" ";" >>"%PLIST%"
343 ippfind
"%1._ipps._tcp.local." -x
echo TLS
="{txt_tls}" ";" >>"%PLIST%"
344 ippfind
"%1._ipps._tcp.local." -x
echo UUID
="{txt_uuid}" ";" >>"%PLIST%"
345 ippfind
"%1._ipps._tcp.local." -x ipptool
-t
"{}" bonjour
-value
-tests.test
";" | findstr
/r
[TG
][EO
][DT
]: >>"%PLIST"
346 echo ^
</string^
>^
</array^
> >>"%PLIST%"
354 if "%result%" == "FAIL" (
355 echo ^
<key^
>Successful^
</key^
>^
<false
/^
> >>"%PLIST%"
357 ippfind
"%1._ipps._tcp.local." -x
echo adminurl
="{txt_adminurl}" ";"
358 ippfind
"%1._ipps._tcp.local." -x
echo pdl
="{txt_pdl}" ";"
359 ippfind
"%1._ipps._tcp.local." -x
echo rp
="{txt_rp}" ";"
360 ippfind
"%1._ipps._tcp.local." -x
echo TLS
="{txt_tls}" ";"
361 ippfind
"%1._ipps._tcp.local." -x
echo UUID
="{txt_uuid}" ";"
362 ippfind
"%1._ipp._tcp.local." -x ipptool
-t
"{}" bonjour
-value
-tests.test
";" | findstr
/r
[TG
][EO
][DT
]:
364 if "%result%" == "SKIP" (
365 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
366 echo ^
<key^
>Skipped^
</key^
>^
<true
/^
> >>"%PLIST%"
368 echo ^
<key^
>Successful^
</key^
>^
<true
/^
> >>"%PLIST%"
371 echo ^
</dict^
> >>"%PLIST%"
374 echo ^
</array^
> >>"%PLIST%"
375 echo ^
<key^
>Successful^
</key^
> >>"%PLIST%"
377 echo ^
<false
/^
> >>"%PLIST%"
379 echo ^
<true
/^
> >>"%PLIST%"
381 echo ^
</dict^
> >>"%PLIST%"
382 echo ^
</plist^
> >>"%PLIST%"
384 set /a score
=%pass% + %skip%
385 set /a score
=100 * %score% / %total%
386 echo Summary
: %total% tests
, %pass% passed
, %fail% failed
, %skip% skipped
387 echo Score
: %score%%%