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