Documentation for 3.0.19, regenerated with the modified tidy changes
[privoxy.git] / regression-tests.action
1 #############################################################################
2 # $Id: regression-tests.action,v 1.44 2012/04/06 15:18:12 fabiankeil Exp $
3 #############################################################################
4 #
5 # This is a configuration file for Privoxy-Regression-Test
6 # (included in the source tarball's tools directory).
7 #
8 # After referencing it in your Privoxy configuration both Privoxy and
9 # Privoxy-Regression-Test should be good to go.
10 #
11 #############################################################################
12 #
13 # Copyright (c) 2007-2012 Fabian Keil <fk@fabiankeil.de>
14 #
15 # Permission to use, copy, modify, and distribute this software for any
16 # purpose with or without fee is hereby granted, provided that the above
17 # copyright notice and this permission notice appear in all copies.
18 #
19 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
20 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
21 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
22 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
24 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
25 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26 #
27 #############################################################################
28
29 # While the syntax used is understood by Privoxy 3.0.14 and later,
30 # some of the +fast-redirects{} tests require at least 3.0.20 to work.
31 {{settings}}
32 for-privoxy-version=3.0.20
33
34 # Some dependencies Privoxy-Regression-Test should know about:
35 #
36 # Level  9 needs = config line user-manual\s+(\.?\.?/|[A-Za-z]:)
37 # Level 12 needs = config line enable-edit-actions\s+1
38 # Level 13 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes
39 # Level 13 needs = config line keep-alive-timeout\s+[1-9]+
40 # Level 14 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE No
41 # Level 15 needs = config line connection-sharing\s+0
42 # Level 16 needs = feature status FEATURE_CONNECTION_KEEP_ALIVE Yes
43 # Level 16 needs = config line connection-sharing\s+1
44 # Level 17 needs = feature status FEATURE_PTHREAD Yes
45 # Level 18 needs = feature status FEATURE_GRACEFUL_TERMINATION No
46 # Level 19 needs = feature status FEATURE_GRACEFUL_TERMINATION Yes
47 # Level 20 needs = feature status FEATURE_TOGGLE Yes
48 # Level 21 needs = feature status FEATURE_TOGGLE No
49
50 #######################################################
51 # Enable taggers to activate the tests on demand
52 # and suppress hiding the User-Agent for
53 # Privoxy-Regression-Test to save log space.
54 #######################################################
55 {\
56  +client-header-tagger{user-agent} \
57  +client-header-tagger{privoxy-control} \
58  +client-header-filter{privoxy-control} \
59 }
60 config.privoxy.org/
61 p.p/
62 127.0.0.1/
63
64 {-hide-user-agent}
65 TAG:^User-Agent: Privoxy-Regression-Test
66
67 #######################################################
68 # Test accept-language{}.
69 #######################################################
70
71 # Set Header    = Accept-Language: de-de
72 # Expect Header = Accept-Language: en-gb
73 {+hide-accept-language{en-gb}}
74 TAG:^hide-accept-language\{en-gb\}$
75
76 # Set Header    = Accept-Language: de-de
77 # Expect Header = REMOVAL
78 {+hide-accept-language{block}}
79 TAG:^hide-accept-language\{block\}$
80
81 #######################################################
82 # Sections for hide-referrer{} to test:
83 #
84 # 1) conditional-block
85 # 2) conditional-forge
86 # 3) forge
87 # 4) block
88 # 5) a parameter that looks like a valid fake referrer
89 # 6) a parameter that looks like an invalid fake referrer
90 #######################################################
91
92 # Set Header    = Referer: http://www.example.org/foo
93 # Expect Header = REMOVAL
94 #
95 # Set Header    = Referer: http://p.p/foo
96 # Expect Header = NO CHANGE
97 #
98 # Set Header    = Referer: p.p/
99 # Expect Header = REMOVAL
100 #
101 # Set Header    = Referer: p
102 # Expect Header = REMOVAL
103 #
104 # Set Header    = Referer: http://
105 # Expect Header = REMOVAL
106 #
107 # Set Header    = Referer: https://p.p/
108 # Expect Header = REMOVAL
109 {+hide-referrer{conditional-block}}
110 TAG:^hide-referrer\{conditional-block\}$
111
112 # Set Header    = Referer: http://www.example.org/foo
113 # Expect Header = Referer: http://p.p/
114 #
115 # Set Header    = Referer: http://p.p/foo
116 # Expect Header = NO CHANGE
117 #
118 # Set Header    = Referer: p.p/
119 # Expect Header = Referer: http://p.p/
120 #
121 # Set Header    = Referer: p
122 # Expect Header = Referer: http://p.p/
123 #
124 # Set Header    = Referer: http://
125 # Expect Header = Referer: http://p.p/
126 #
127 # Set Header    = Referer: https://p.p/
128 # Expect Header = Referer: http://p.p/
129 {+hide-referrer{conditional-forge}}
130 TAG:^hide-referrer\{conditional-forge\}$
131
132 # Set Header    = Referer: http://www.example.org/foo
133 # Expect Header = Referer: http://p.p/
134 {+hide-referrer{forge}}
135 TAG:^hide-referrer\{forge\}$
136
137 # Set Header    = Referer: http://www.example.org/foo
138 # Expect Header = REMOVAL
139 {+hide-referrer{block}}
140 TAG:^hide-referrer\{block\}$
141
142 # Set Header    = Referer: http://www.example.org/foo
143 # Expect Header = Referer: invalid
144 {+hide-referrer{invalid}}
145 TAG:^hide-referrer\{invalid\}$
146
147 # Set Header    = Referer: http://www.example.org/asdf
148 # Expect Header = Referer: http://www.privoxy.org/
149 {+hide-referrer{http://www.privoxy.org/}}
150 TAG:^hide-referrer\{http://www.privoxy.org/\}$
151
152 #{+hide-referrer{}}
153 #TAG:^hide-referrer\{\}$
154
155 #######################################################
156 # Test hide-user-agent{}.
157 #######################################################
158
159 # Set Header    = User-Agent: Mozilla/5.0 (X11; U; NetBSD i386; de-CH; rv:1.8.1.6) Gecko/20070806 Firefox/2.0.0.6
160 # Expect Header = User-Agent: Mozilla/5.0 (X11; U; FreeBSD alpha; en-GB; rv:1.8.1.6) Gecko/20070913 Firefox/2.0.0.6
161 {+hide-user-agent{Mozilla/5.0 (X11; U; FreeBSD alpha; en-GB; rv:1.8.1.6) Gecko/20070913 Firefox/2.0.0.6}}
162 TAG:^hide-user-agent\{Mozilla/5\.0 \(X11; U; FreeBSD alpha; en-GB; rv:1\.8\.1\.6\) Gecko/20070913 Firefox/2\.0\.0\.6\}$
163
164 # XXX: Check the code that is tested here.
165 # Set Header = ua-blah: blah
166 # Expect Header = REMOVAL
167 {+hide-user-agent{block}}
168 TAG:^hide-user-agent{block}$
169
170 # Set Header = ua-blah: blah
171 # Expect Header = NO CHANGE
172 {-hide-user-agent{}}
173 TAG:^-hide-user-agent{block}$
174
175
176 #######################################################
177 # Test add-header{}.
178 #######################################################
179
180 # Set Header    = X-Whatever: foo
181 # Expect Header = X-Custom-Header: yes, please
182
183 {+add-header{X-Custom-Header: yes, please}}
184 TAG:^add-header\{X-Custom-Header: yes, please\}$
185
186 #######################################################
187 # Test client-header-filter{hide-tor-exit-notation}.
188 #######################################################
189
190 # Set Header    = Referer: http://p.p.zwiebelsuppe.exit/
191 # Expect Header = Referer: http://p.p/
192 #
193 # Set Header    = Referer: http://p.p.zwiebelsuppe.exit/foo/bar/baaz/
194 # Expect Header = Referer: http://p.p/foo/bar/baaz/
195 #
196 # Set Header    = Referer: http://p.p/
197 # Expect Header = NO CHANGE
198 #
199 # Set Header    = Referer: http://config.privoxy.org.zwiebelsuppe.exit/foo/bar/baaz.html
200 # Expect Header = Referer: http://config.privoxy.org/foo/bar/baaz.html
201 #
202 # Set Header    = Host: p.p.zwiebelsuppe.exit
203 # Expect Header = Host: p.p
204 #
205 # Set Header    = Host: p.p
206 # Expect Header = NO CHANGE
207 #
208 # Set Header    = Referer: http://config.privoxy.org.ad356ef8e87a89e6c898b74500d58607ac691178.exit/foo/baaz.html
209 # Expect Header = Referer: http://config.privoxy.org/foo/baaz.html
210
211 {+client-header-filter{hide-tor-exit-notation} -hide-referer}
212 TAG:^client-header-filter\{hide-tor-exit-notation\}$
213
214 #######################################################
215 # Test crunch-client-header{}.
216 #######################################################
217
218 # Set Header    = Content-Type: text/html
219 # Expect Header = REMOVAL
220 #
221 # Set Header    = Content-Type: text/html; charset=4711
222 # Expect Header = REMOVAL
223 #
224 # Set Header    = Content-Type: text/plain
225 # Expect Header = NO CHANGE
226
227 {+crunch-client-header{text/html}}
228 TAG:^crunch-client-header\{text/plain\}$
229
230
231 #######################################################
232 # Test crunch-if-none-match.
233 #######################################################
234
235 # Set Header    = If-None-Match: 8987afd239d2093kd2309kd
236 # Expect Header = REMOVAL
237
238 # Set Header    = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
239 # Expect Header = REMOVAL
240
241 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
242 # Expect Header = NO CHANGE
243
244 {+crunch-if-none-match -hide-if-modified-since}
245 TAG:^crunch-if-none-match$
246
247 #######################################################
248 # Test hide-if-modified-since
249 #######################################################
250
251 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
252 # Expect Header = REMOVAL
253 #
254 # Set Header    = If-None-Match: 82c3cb50c984ef11b1fed749949b2a16
255 # Expect Header = NO CHANGE
256
257 {+hide-if-modified-since{block} -crunch-if-none-match}
258 TAG:^hide-if-modified-since\{block\}$
259
260 # Set Header    = If-Modified-Since: Gee, this date is invalid
261 # Expect Header = REMOVAL
262 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
263 # Expect Header = SOME CHANGE
264 # Set Header    = If-Modified-Since: Thu, 1 Jan 1970 00:00:00 GMT
265 # Expect Header = SOME CHANGE
266 # Level = 17
267 # Set Header    = If-Modified-Since: Thu, 1 Jan 123456789 00:00:00 GMT
268 # Expect Header = REMOVAL
269 # Set Header    = If-Modified-Since: Mon, 1 Jan 2525 00:00:00 GMT
270 # Expect Header = SOME CHANGE
271 # Level = 17
272 # Set Header    = If-Modified-Since: Thu, 1 Jan 1970 02:00:00 GMT
273 # Expect Header = SOME CHANGE
274
275 {+hide-if-modified-since{-60} -crunch-if-none-match}
276 TAG:^hide-if-modified-since\{-60\}$
277
278 # Set Header    = If-Modified-Since: Gee, this date is invalid
279 # Expect Header = REMOVAL
280 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
281 # Expect Header = SOME CHANGE
282 # Set Header    = If-Modified-Since: Wed, 31 Dec 1969 23:59:59 GMT
283 # Expect Header = SOME CHANGE
284
285 {+hide-if-modified-since{+60} -crunch-if-none-match}
286 TAG:^hide-if-modified-since\{\+60\}$
287
288 # Set Header    = If-Modified-Since: Gee, this date is invalid
289 # Expect Header = REMOVAL
290 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
291 # Expect Header = SOME CHANGE
292
293 {+hide-if-modified-since{60} -crunch-if-none-match}
294 TAG:^hide-if-modified-since\{60\}$
295
296 # Set Header    = If-Modified-Since: Gee, this date is invalid
297 # Expect Header = REMOVAL
298 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
299 # Expect Header = NO CHANGE
300
301 {+hide-if-modified-since{+0} -crunch-if-none-match}
302 TAG:^hide-if-modified-since\{\+0\}$
303
304 # Set Header    = If-Modified-Since: Gee, this date is invalid
305 # Expect Header = REMOVAL
306 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
307 # Expect Header = NO CHANGE
308
309 {+hide-if-modified-since{-0} -crunch-if-none-match}
310 TAG:^hide-if-modified-since\{-0\}$
311
312 # Set Header    = If-Modified-Since: Gee, this date is invalid
313 # Expect Header = REMOVAL
314 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
315 # Expect Header = NO CHANGE
316
317 {+hide-if-modified-since{0} -crunch-if-none-match}
318 TAG:^hide-if-modified-since\{0\}$
319
320 # Set Header    = If-Modified-Since: Gee, this date is invalid
321 # Expect Header = REMOVAL
322 # Set Header    = If-Modified-Since: Thu, 04 Oct 2007 09:56:35 GMT
323 # Expect Header = NO CHANGE
324
325 {+hide-if-modified-since{NaN} -crunch-if-none-match}
326 TAG:^hide-if-modified-since\{NaN\}$
327
328
329 #######################################################
330 # Test crunch-outgoing-cookies
331 #######################################################
332
333 # Set Header    = If-Modified-Since: Gee, this date is invalid
334 # Expect Header = NO CHANGE
335 #
336 # Set Header    = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
337 # Expect Header = REMOVAL
338 {\
339  +crunch-outgoing-cookies \
340  -crunch-incoming-cookies \
341  -session-cookies-only    \
342  -hide-if-modified-since  \
343 }
344 TAG:^crunch-outgoing-cookies$
345
346 #######################################################
347 # Test session-cookies-only
348 #
349 # XXX: pretty useless as session-cookies-only doesn't
350 # affect client headers.
351 #######################################################
352
353 # Set Header    = Cookie: NSC_gffe-iuuq-mc-wtfswfs=8efb330d3660;expires=Thu, 04-Oct-07 19:11:34 GMT;path=/
354 # Expect Header = NO CHANGE
355 #
356 # Set Header    = Cookie: PREF=ID=6cf0abd34262:TM=117335617:LM=1617:S=jZypyJ7LPiwFi1_
357 # Expect Header = NO CHANGE
358 {\
359  -crunch-outgoing-cookies \
360  -crunch-incoming-cookies \
361  +session-cookies-only    \
362  -hide-if-modified-since  \
363 }
364 TAG:^session-cookies-only$
365
366 #######################################################
367 # Test change-x-forwarded-for
368 #######################################################
369
370 # Set Header    = X-Forwarded-For: 10.0.0.1
371 # Expect Header = NO CHANGE
372 {\
373  -change-x-forwarded-for \
374 }
375 TAG:^-change-x-forwarded-for$
376
377 # Set Header    = X-Forwarded-For: 10.0.0.1
378 # Expect Header = REMOVAL
379 {\
380  +change-x-forwarded-for{block} \
381 }
382 TAG:^change-x-forwarded-for\{block\}$
383
384 # Set Header    = X-Forwarded-For: 10.0.0.1
385 # Expect Header = SOME CHANGE
386 {\
387  +change-x-forwarded-for{add} \
388 }
389 TAG:^change-x-forwarded-for\{add\}$
390
391 #######################################################
392 # Test hide-from-header
393 #######################################################
394
395 # Set Header    = From: schneewitchen@example.org
396 # Expect Header = REMOVAL
397 {\
398  +hide-from-header{block}\
399 }
400 TAG:^hide-from-header\{block\}$
401
402 # Set Header    = From: schneewitchen@example.org
403 # Expect Header = From: siebenzwerge@example.org
404 {\
405  +hide-from-header{siebenzwerge@example.org}\
406 }
407 TAG:^hide-from-header\{siebenzwerge@example.org\}$
408
409 #######################################################
410 # Test prevent-compression
411 #######################################################
412
413 # Set Header    = Accept-Encoding: gzip, deflate
414 # Expect Header = REMOVAL
415 #
416 # Set Header    = Accept-Encoding: gzip
417 # Expect Header = REMOVAL
418 #
419 # Set Header    = Accept-Encoding: deflate
420 # Expect Header = REMOVAL
421 {\
422  +prevent-compression\
423 }
424 TAG:^prevent-compression$
425
426 #######################################################
427 # Test content filters which could cause problems with
428 # range requests.
429 #######################################################
430
431 # Set Header    = Range: bytes=1234-5678
432 # Expect Header = REMOVAL
433 # Set Header    = Range: bytes=1-5
434 # Expect Header = REMOVAL
435 # Set Header    = If-Range: bytes=1234-5678
436 # Expect Header = REMOVAL
437 # Set Header    = Request-Range: bytes=1234-5678
438 # Expect Header = REMOVAL
439 # Set Header    = Range: foo
440 # Expect Header = REMOVAL
441 # Set Header    = If-Range: foo
442 # Expect Header = REMOVAL
443 # Set Header    = Request-Range: foo
444 # Expect Header = REMOVAL
445 # Set Header    = Range: bytes=0-5678
446 # Expect Header = NO CHANGE
447 # Set Header    = Range: bytes=0-
448 # Expect Header = NO CHANGE
449 # Set Header    = If-Range: bytes=0-5678
450 # Expect Header = NO CHANGE
451 # Set Header    = If-Range: bytes=0-
452 # Expect Header = NO CHANGE
453 # Set Header    = Request-Range: bytes=0-5678
454 # Expect Header = NO CHANGE
455 # Set Header    = Request-Range: bytes=0-
456 # Expect Header = NO CHANGE
457 {\
458  -client-header-tagger{range-requests} \
459  +deanimate-gifs{last} \
460  -filter \
461 }
462 TAG:^deanimate-gifs\{last\}$
463
464 # Set Header    = Range: bytes=1234-5678
465 # Expect Header = REMOVAL
466 # Set Header    = Range: bytes=1-5
467 # Expect Header = REMOVAL
468 # Set Header    = If-Range: bytes=1234-5678
469 # Expect Header = REMOVAL
470 # Set Header    = Request-Range: bytes=1234-5678
471 # Expect Header = REMOVAL
472 # Set Header    = Range: bytes=1-5
473 # Expect Header = REMOVAL
474 # Set Header    = If-Range: bytes=1234-5678
475 # Expect Header = REMOVAL
476 # Set Header    = Request-Range: bytes=1234-5678
477 # Expect Header = REMOVAL
478 # Set Header    = Range: foo
479 # Expect Header = REMOVAL
480 # Set Header    = If-Range: foo
481 # Expect Header = REMOVAL
482 # Set Header    = Request-Range: foo
483 # Expect Header = REMOVAL
484 # Set Header    = Range: bytes=0-5678
485 # Expect Header = NO CHANGE
486 # Set Header    = Range: bytes=0-
487 # Expect Header = NO CHANGE
488 # Set Header    = If-Range: bytes=0-5678
489 # Expect Header = NO CHANGE
490 # Set Header    = If-Range: bytes=0-
491 # Expect Header = NO CHANGE
492 # Set Header    = Request-Range: bytes=0-5678
493 # Expect Header = NO CHANGE
494 # Set Header    = Request-Range: bytes=0-
495 # Expect Header = NO CHANGE
496 {\
497  -client-header-tagger{range-requests} \
498  -deanimate-gifs \
499  +filter{banners-by-size} \
500 }
501 TAG:^filter\{banners-by-size\}$
502
503 # Set Header    = Range: bytes=1234-5678
504 # Expect Header = NO CHANGE
505 # Set Header    = If-Range: bytes=1234-5678
506 # Expect Header = NO CHANGE
507 # Set Header    = Request-Range: bytes=1234-5678
508 # Expect Header = NO CHANGE
509 {\
510  -client-header-tagger{range-requests} \
511  -deanimate-gifs \
512  -filter \
513 }
514 TAG:^no-content-filter$
515
516 # Set Header    = Connection: keep-alive
517 # Expect Header = NO CHANGE
518 # Level = 13
519 # Set Header    = Connection:
520 # Expect Header = REMOVAL
521 # Level = 13
522 {}
523 TAG:^Connection: keep-alive$
524
525 # Set Header    = Connection: keep-alive
526 # Expect Header = Connection: close
527 # Level = 14
528 # Set Header    = Connection:
529 # Expect Header = Connection: close
530 # Level = 14
531 {}
532 TAG:^Connection: close$
533
534 # Set Header    = Connection: close
535 # Expect Header = NO CHANGE
536 # Level = 15
537 {}
538 TAG:^connection-sharing disabled$
539
540 # Set Header    = Connection: close
541 # Expect Header = REMOVAL
542 # Level = 16
543 # Set Header    = Connection: keep-alive
544 # Expect Header = NO CHANGE
545 # Level = 16
546 {}
547 TAG:^connection-sharing enabled$
548
549 # XXX: Removing a header by not specifying a value is
550 # an inherited curl feature and could be viewed as a
551 # bug as far as Privoxy-Regression-Test is concerned.
552 #
553 # Set Header    = Host:
554 # Expect Header = Host: p.p
555 {}
556 TAG:^No Host header$
557
558 # Set Header    = Host: whatever.example.org
559 # Expect Header = NO CHANGE
560 {}
561 TAG:^Host header other than the target host$
562
563 # Set Header = Keep-Alive: 20
564 # Expect Header = NO CHANGE
565 # Level = 13
566 {}
567 TAG:^Pass Keep-Alive header$
568
569 # Set Header = Keep-Alive: 20
570 # Expect Header = REMOVAL
571 # Level = 14
572 {}
573 TAG:^Keep-Alive header removal$
574
575 # XXX: check the RFC to use a real value
576 # Set Header = proxy-connection: keep-alive
577 # Expect Header = REMOVAL
578 {}
579 TAG:^Proxy-Connection removal$
580
581 # Set Header = Proxy-Connection: keep-alive
582 # Expect Header = REMOVAL
583 {}
584 TAG:^Proxy-Connection removal$
585
586 # These are somewhat redundant when testing with
587 # GET requests, but I want to remember then when
588 # TRACE requests are supported.
589 #
590 # Set Header = Max-Forwards: 0
591 # Expect Header = NO CHANGE
592 # Set Header = Max-Forwards: 1
593 # Expect Header = NO CHANGE
594 # Set Header = Max-Forwards: -1
595 # Expect Header = NO CHANGE
596 # Set Header = Max-Forwards: 3
597 # Expect Header = NO CHANGE
598 {}
599 TAG:^Max-Forwards header without TRACE method$
600
601 ################################################################
602 #
603 # Fairly dumb tests for Privoxy CGI pages.
604 #
605 # These are mainly useful for checking for memory leaks
606 # with Valgrind or whether or not the user manual is installed
607 # correctly and are unlikely to actually detect any
608 #
609 # Note that if "Expect Status Code" is missing, 200 is implied.
610 #
611 ################################################################
612
613 # Fetch Test = http://p.p/
614 # Fetch Test = http://p.p/die
615 # Expect Status Code = 404
616 # Level = 18
617 # Fetch Test = http://p.p/die
618 # Expect Status Code = 200
619 # Level = 19
620 # Fetch Test = http://p.p/show-status
621 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=0
622 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=0
623 # XXX: for the invalid ones we probably shouldn't return status code 200.
624 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=100
625 # Fetch Test = http://config.privoxy.org/show-status?file=actions&index=NaN
626 # Fetch Test = http://config.privoxy.org/show-status?file=actions
627 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=100
628 # Fetch Test = http://config.privoxy.org/show-status?file=filter&index=NaN
629 # Fetch Test = http://config.privoxy.org/show-status?file=filter
630 # Fetch Test = http://config.privoxy.org/show-status?file=invalid
631 # Fetch Test = http://config.privoxy.org/show-status?file=trust
632 # Fetch Test = http://p.p/show-version
633 # Fetch Test = http://p.p/show-request
634 # Fetch Test = http://p.p/show-url-info
635 # Fetch Test = http://p.p/show-url-info?url=www.privoxy.org%2F
636 # Fetch Test = http://p.p/show-url-info?url=http:%2F%2Fwww.privoxy.org%2F
637 # Fetch Test = http://p.p/show-url-info?url=HTTp:%2F%2Fwww.privoxy.org%2F
638 # Fetch Test = http://p.p/show-url-info?url=https:%2F%2Fwww.privoxy.org%2F
639 # Fetch Test = http://p.p/show-url-info?url=HtTps:%2F%2Fwww.privoxy.org%2F
640 # Fetch Test = http://p.p/show-url-info?url=ftp:%2F%2Fwww.privoxy.org%2F
641 # Fetch Test = http://p.p/show-url-info?url=FTp:%2F%2Fwww.privoxy.org%2F
642 # Fetch Test = http://p.p/show-url-info?url=
643 # Fetch Test = http://p.p/show-url-info?url=%2F
644 # Depends on FEATURE_TOGGLE
645 # Fetch Test = http://p.p/toggle
646 # Level = 20
647 # Fetch Test = http://p.p/toggle
648 # Expect Status Code = 404
649 # Level = 21
650 # Fetch Test = http://p.p/edit-actions
651 # Fetch Test = http://p.p/eaa
652 # Fetch Test = http://p.p/eau
653 # Fetch Test = http://p.p/ear
654 # Fetch Test = http://p.p/eal
655 # Fetch Test = http://p.p/eafu
656 # Fetch Test = http://p.p/eas
657 # Fetch Test = http://p.p/easa
658 # Fetch Test = http://p.p/easr
659 # Fetch Test = http://p.p/eass
660 # Fetch Test = http://p.p/edit-actions-for-url
661 # Fetch Test = http://p.p/edit-actions-list
662 # Fetch Test = http://p.p/edit-actions-submit
663 # Fetch Test = http://p.p/edit-actions-url
664 # Fetch Test = http://p.p/edit-actions-url-form
665 # Fetch Test = http://p.p/edit-actions-add-url
666 # Fetch Test = http://p.p/edit-actions-add-url-form
667 # Fetch Test = http://p.p/edit-actions-remove-url
668 # Fetch Test = http://p.p/edit-actions-remove-url-form
669 # Fetch Test = http://p.p/edit-actions-section-add
670 # Fetch Test = http://p.p/edit-actions-section-remove
671 # Fetch Test = http://p.p/edit-actions-section-swap
672 # Fetch Test = http://p.p/error-favicon.ico
673 # Fetch Test = http://p.p/favicon.ico
674 # Fetch Test = http://p.p/robots.txt
675 # Fetch Test = http://p.p/send-banner
676 # Fetch Test = http://p.p/send-stylesheet
677 # Fetch Test = http://p.p/t
678 # Fetch Test = http://p.p/url-info-osd.xml
679
680 # Trusted CGI Request = http://p.p/edit-actions
681 # Expect Status Code = 302
682 # Level = 12 # Depends on the CGI editor being enabled
683 # Fetch Test = http://p.p/does-not-exist
684 # Expect Status Code = 404
685 # Trusted CGI Request = http://p.p/eaa
686 # Trusted CGI Request = http://p.p/eau
687 # Trusted CGI Request = http://p.p/ear
688 # Trusted CGI Request = http://p.p/eal
689 # Trusted CGI Request = http://p.p/eafu
690 # Trusted CGI Request = http://p.p/eas
691 # Trusted CGI Request = http://p.p/easa
692 # Trusted CGI Request = http://p.p/easr
693 # Trusted CGI Request = http://p.p/eass
694 # Trusted CGI Request = http://p.p/edit-actions-for-url
695 # Trusted CGI Request = http://p.p/edit-actions-list
696 # Trusted CGI Request = http://p.p/edit-actions-submit
697 # Trusted CGI Request = http://p.p/edit-actions-url
698 # Trusted CGI Request = http://p.p/edit-actions-url-form
699 # Trusted CGI Request = http://p.p/edit-actions-add-url
700 # Trusted CGI Request = http://p.p/edit-actions-add-url-form
701 # Trusted CGI Request = http://p.p/edit-actions-remove-url
702 # Trusted CGI Request = http://p.p/edit-actions-remove-url-form
703 # Trusted CGI Request = http://p.p/edit-actions-section-add
704 # Trusted CGI Request = http://p.p/edit-actions-section-remove
705 # Trusted CGI Request = http://p.p/edit-actions-section-swap
706 # Trusted CGI Request = http://p.p/send-stylesheet
707
708 # The following tests depend on Privoxy being configured to deliver the user manual
709
710 # Fetch Test = http://p.p/user-manual
711 # Expect Status Code = 302
712 # Level = 9
713 # Fetch Test = http://p.p/user-manual/
714 # Level = 9
715 # Fetch Test = http://p.p/user-manual/actions-file.html
716 # Level = 9
717 # Fetch Test = http://p.p/user-manual/appendix.html
718 # Level = 9
719 # Fetch Test = http://p.p/user-manual/config.html
720 # Level = 9
721 # Fetch Test = http://p.p/user-manual/configuration.html
722 # Level = 9
723 # Fetch Test = http://p.p/user-manual/contact.html
724 # Level = 9
725 # Fetch Test = http://p.p/user-manual/copyright.html
726 # Level = 9
727 # Fetch Test = http://p.p/user-manual/files-in-use.jpg
728 # Level = 9
729 # Fetch Test = http://p.p/user-manual/filter-file.html
730 # Level = 9
731 # Fetch Test = http://p.p/user-manual/index.html
732 # Level = 9
733 # Fetch Test = http://p.p/user-manual/installation.html
734 # Level = 9
735 # Fetch Test = http://p.p/user-manual/introduction.html
736 # Level = 9
737 # Fetch Test = http://p.p/user-manual/p_doc.css
738 # Level = 9
739 # Fetch Test = http://p.p/user-manual/proxy2.jpg
740 # Level = 9
741 # Fetch Test = http://p.p/user-manual/proxy_setup.jpg
742 # Level = 9
743 # Fetch Test = http://p.p/user-manual/quickstart.html
744 # Level = 9
745 # Fetch Test = http://p.p/user-manual/seealso.html
746 # Level = 9
747 # Fetch Test = http://p.p/user-manual/startup.html
748 # Level = 9
749 # Fetch Test = http://p.p/user-manual/templates.html
750 # Level = 9
751 # Fetch Test = http://p.p/user-manual/whatsnew.html
752 # Level = 9
753
754
755 # Method Test = OPTIONS
756 # Method Test = GET
757 # Method Test = get
758 # Method Test = gEt
759 # Method Test = HEAD
760 # Method Test = POST
761 # Method Test = PUT
762 # Method Test = DELETE
763 # Method Test = OPTIONS
764 # Method Test = TRACE
765 # Method Test = CONNECT
766 # Method Test = PROPFIND
767 # Method Test = PROPPATCH
768 # Method Test = MOVE
769 # Method Test = COPY
770 # Method Test = MKCOL
771 # Method Test = LOCK
772 # Method Test = UNLOCK
773 # Method Test = BCOPY
774 # Method Test = BMOVE
775 # Method Test = BDELETE
776 # Method Test = BPROPFIND
777 # Method Test = BPROPPATCH
778 # Method Test = SUBSCRIBE
779 # Method Test = UNSUBSCRIBE
780 # Method Test = NOTIFY
781 # Method Test = POLL
782 # Method Test = VERSION-CONTROL
783 # Method Test = REPORT
784 # Method Test = CHECKOUT
785 # Method Test = CHECKIN
786 # Method Test = UNCHECKOUT
787 # Method Test = MKWORKSPACE
788 # Method Test = UPDATE
789 # Method Test = LABEL
790 # Method Test = MERGE
791 # Method Test = BASELINE-CONTROL
792 # Method Test = MKACTIVITY
793 # Method Test = PRIVOXY-REGRESSION-TEST-IN-THE-HOUSE
794 # Expect Status Code = 400
795
796 {+block{Forbidden Port. You are not supposed to see this.}}
797 config.privoxy.org:1-/
798 p.p:1-/
799
800 {-block}
801 config.privoxy.org:3,79-81/
802 p.p:3,22,79-81/
803
804 # Fetch Test = http://oh-dear-this-hostname-is-so-very-long-that-it-can-not-possibly-be-forwarded-through-socks5-as-a-result-we-therefore-expect-privoxy-to-return-an-error-response-instead-of-forwarding-the-request-because-as-already-mentioned-this-host-is-really-very-long.example
805 # Expect Status Code = 503
806 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
807 oh-dear-this-hostname-is-so-very-long-that-it-can-not-possibly-be-forwarded-through-socks5-as-a-result-we-therefore-expect-privoxy-to-return-an-error-response-instead-of-forwarding-the-request-because-as-already-mentioned-this-host-is-really-very-long.example/
808
809 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
810 # Expect Status Code = 503
811 {+forward-override{forward-socks5 127.0.0.1:12345 .}}
812 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks5-server-listening.example
813
814 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
815 # Expect Status Code = 503
816 {+forward-override{forward-socks4 127.0.0.1:12345 .}}
817 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4-server-listening.example
818
819 # Fetch Test = http://oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
820 # Expect Status Code = 503
821 {+forward-override{forward-socks4a 127.0.0.1:12345 .}}
822 oh-dear-this-hostname-is-short-enough-but-there-is-no-socks4a-server-listening.example
823
824 # This one currently triggers the same error condition as the
825 # test above (socks5 server unreachable), but once Privoxy
826 # starts to properly reject invalid ports it should become useful.
827
828 # Fetch Test = http://invalid-forward5-gateway-port.example
829 # Expect Status Code = 503
830 {+forward-override{forward-socks5 127.0.0.1:-1 127.0.0.1:12345}}
831 invalid-forward5-gateway-port.example
832
833 # Fetch Test = http://forward5-null-gateway-host.example
834 # Expect Status Code = 503
835 {+forward-override{forward-socks5 :12345 127.0.0.1:12345}}
836 forward5-null-gateway-host.example
837
838 # Fetch Test = http://www.forbidden-connect.example:444/
839 # Method = CONNECT
840 # Expect Status Code = 403
841 {+limit-connect{443}}
842 www.forbidden-connect.example/
843
844 # Fetch Test = http://www.blocked-request.example/blocked-request
845 # Expect Status Code = 403
846 {+block{This request failed to make it to the target destination which means the test succeeded.}}
847 www.blocked-request.example/blocked-request
848
849 # Fetch Test = http://www.blocked-request.example/blocked-request-with-no-reason-specified
850 # Expect Status Code = 403
851 {+block}
852 www.blocked-request.example/blocked-request-with-no-reason-specified
853
854 # Some domain pattern tests
855 #
856 {+block{domain pattern test}}
857 # Blocked URL = http://domain-pattern-test.example/
858 # Blocked URL = http://domain-pattern-test.example.org/
859 domain-pattern-test.example.
860
861 {+block{Hostname patterns without trailing dots cover hostnames with trailing dots as well.}}
862 # Blocked URL = http://trailing-dot.example.org./
863 # Blocked URL = http://trailing-dot.example.org./foo
864 trailing-dot.example.org
865
866 # Just in case there is no white-space fuzzer in the house ...
867 #
868 # Set Header = X-LWS-Test: no superfluous white space here
869 # Expect Header = NO CHANGE
870 # Set Header = X-LWS-Test:  superfluous   white space  in  the   house
871 # Expect Header = X-LWS-Test: superfluous white space in the house
872 # Set Header = X-LWS-Test   :  superfluous   white   space   in   the    house
873 # Expect Header = X-LWS-Test: superfluous white space in the house
874 # Set Header = X-LWS-Test:  :superfluous white space in the house
875 # Expect Header = X-LWS-Test: :superfluous white space in the house
876 # Set Header = X-LWS-Test: :no superfluous white space here
877 # Expect Header = NO CHANGE
878 # Set Header = X-LWS-Test:      superfluous             white                   tabs in the house
879 # Expect Header = X-LWS-Test: superfluous white tabs in the house
880 # Set Header = X-LWS-Test       :       superfluous             white                   tabs in the house
881 # Expect Header = X-LWS-Test: superfluous white tabs in the house
882 # Set Header = X-LWS-Test: "leave  quoted  lws alone"
883 # Expect Header = X-LWS-Test: "leave  quoted  lws alone"
884 # Set Header = X-LWS-Test:  "leave  quoted  lws alone"  thxbye
885 # Expect Header = X-LWS-Test: "leave  quoted  lws alone" thxbye
886 # Set Header = X-LWS-Test: " Do I Look like     quoted  text? Me    thinks  not.
887 # Expect Header = X-LWS-Test: " Do I Look like quoted text? Me thinks not.
888 # Set Header = X-LWS-Test: "This  is  quoted" this  is  not "but   this  is  again"
889 # Expect Header = X-LWS-Test: "This  is  quoted" this is not "but   this  is  again"
890 # Set Header = X-LWS-Test:  "This  is  quoted" this   is  not "this  is  "  but  "  this again   is  not
891 # Expect Header = X-LWS-Test: "This  is  quoted" this is not "this  is  " but " this again is not
892 {}
893 TAG:^LWS Tests$
894
895 {+fast-redirects{check-decoded-url}}
896 # Redirected URL = http://redirect.example.net/blafasel&url=http://redirected1.example.net/
897 # Redirect Destination = http://redirected1.example.net/
898 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected2.example.net%2F&parameter=not-part-of-the-redirected-url
899 # Redirect Destination = http://redirected2.example.net/
900 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected3.example.net%2F&parameter=not-part-of-the-redirected-url
901 # Redirect Destination = http://redirected3.example.net/
902 # Redirected URL = http://redirect.example.net/blafasel&url=http%3A%2F%2Fredirected4.example.net%2F%26parameter=part-of-the-redirected-url
903 # Redirect Destination = http://redirected4.example.net/&parameter=part-of-the-redirected-url
904 # Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected5.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected5.example.net%2F%26parameter2=part-of-the-redirected-url2
905 # Redirect Destination = http://redirected5.example.net/&parameter2=part-of-the-redirected-url2
906 # Redirected URL = http://redirect.example.net/blafasel&url1=http%3A%2F%2Fredirected6.example.net%2F%26parameter1=part-of-the-redirected-url&url2=http%3A%2F%2Fredirected6.example.net%2F%26parameter2=part-of-the-redirected-url2&parameter3=not-part-of-the-redirected-url2
907 # Redirect Destination = http://redirected6.example.net/&parameter2=part-of-the-redirected-url2
908 # Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected7.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1
909 # Redirect Destination = http://redirected7.example.net/&parameter1=part-of-the-redirected-url1
910 # Redirected URL = http://redirect.example.net/blafasel?x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
911 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
912 # Redirected URL = http://redirect.example.net/blafasel?a?b?c?d?e?f?g?h?i?j?k?l?m?n?o?p?q?r?s&t&u&v&w&x&y&z&1&2&3&4&5&6&7&8&9&10&11&12&13&14&15&16x=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
913 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
914 # Redirected URL = http://redirect.example.net/blafasel???????????????????????????????=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
915 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
916 # Redirected URL = http://redirect.example.net/blafasel&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&=http%3A%2F%2Fredirected8.example.net%2F%26parameter1=part-of-the-redirected-url1&parameter2=not-part-of-the-redirected-url1&parameter3=not-part-of-the-redirected-url1
917 # Redirect Destination = http://redirected8.example.net/&parameter1=part-of-the-redirected-url1
918 redirect.example.net/
919 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http://redirect2.example.net/
920 # Redirect Destination = http://redirect2.example.net/
921 # Redirected URL = http://redirect.example.net/blafasel%3A%2F%2Fredirect1.example.net/http://redirect2.example.net/
922 # Redirect Destination = http://redirect2.example.net/
923 # Redirected URL = http://redirect.example.net/blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/
924 # Redirect Destination = http://redirect2.example.net/
925 # These tests verify that Privoxy behaves as intended,
926 # given that the encoded redirect URLs are invalid,
927 # there are no correct redirect URLs.
928 # Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%%%%%%%%%%%%%%
929 # Redirect Destination = http://redirect2.example.net/%%%%%%%%%%%%%%
930 # Redirected URL = http://redirect.example.net/%%%%%%%%%%%%%%%%%%%%%%blafaselhttp://redirect1.example.net/http%3A%2F%2Fredirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%%
931 # Redirect Destination = http://redirect2.example.net/%1%2%%3%4%5%6%7%8%9%0%0%%
932
933 {+fast-redirects{simple-check}}
934 # Redirected URL = http://redirect2.example.net/blafasel?x=http://redirected.example.net/&parameter1=part-of-the-redirected-url1&parameter2=part-of-the-redirected-url1
935 # Redirect Destination = http://redirected.example.net/&parameter1=part-of-the-redirected-url1&parameter2=part-of-the-redirected-url1
936 redirect2.example.net/
937