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