1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 >Testing Guidelines</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
10 TITLE="Privoxy Developer Manual"
11 HREF="index.html"><LINK
13 TITLE="Coding Guidelines"
14 HREF="coding.html"><LINK
16 TITLE="Releasing a New Version"
17 HREF="newrelease.html"><LINK
20 HREF="../p_doc.css"><META
21 HTTP-EQUIV="Content-Type"
23 charset=ISO-8859-1"></HEAD
34 SUMMARY="Header navigation table"
43 >Privoxy Developer Manual</TH
65 HREF="newrelease.html"
80 >5. Testing Guidelines</A
90 >5.1. Testplan for releases</A
93 > Explain release numbers. major, minor. developer releases. etc.
101 >Remove any existing rpm with rpm -e</P
105 >Remove any file that was left over. This includes (but is not limited to)
120 >/usr/sbin/privoxy</P
124 >/etc/init.d/privoxy</P
128 >/usr/doc/privoxy*</P
134 >Install the rpm. Any error messages?</P
138 >start,stop,status <SPAN
141 > with the specific script
142 (e.g. /etc/rc.d/init/privoxy stop). Reboot your machine. Does
147 >Start browsing. Does <SPAN
150 > work? Logfile written?</P
154 >Remove the rpm. Any error messages? All files removed?</P
163 NAME="PRIVOXY-REGRESSION-TEST"
164 >5.2. Testing with <SPAN
166 >Privoxy-Regression-Test</SPAN
170 > If you compiled, packaged or merely installed Privoxy, it is recommended to run
173 >Privoxy-Regression-Test</SPAN
174 > to verify that at least
175 the tested parts of <SPAN
178 > are working as expected.
181 > This is actually pretty easy. For details, please see
184 >perldoc privoxy-regression-test.pl</B
188 > Here is an example of what <SPAN
190 >Privoxy-Regression-Test</SPAN
200 CLASS="PROGRAMLISTING"
201 > # Run all the tests
202 fk@t520 ~ $privoxy-regression-test.pl
203 2020-12-14 12:16:32: Asking Privoxy for the number of action files available ...
204 2020-12-14 12:16:32: Gathering regression tests from 9 action file(s) delivered by Privoxy 3.0.30.
205 2020-12-14 12:16:32: Executing regression tests ...
206 2020-12-14 12:16:41: Ooops. Expected removal but: 'Referer: https://p.p/' is still there.
207 2020-12-14 12:16:41: Failure for test 785. Header 'Referer: https://p.p/' and tag 'hide-referrer{conditional-block}'
208 2020-12-14 12:16:41: Ooops. Got: 'Referer: https://p.p/' while expecting: 'Referer: http://p.p/'
209 2020-12-14 12:16:41: Failure for test 791. Header 'Referer: https://p.p/' and tag 'hide-referrer{conditional-forge}'
210 2020-12-14 12:16:44: Executed 1087 regression tests. Skipped 115. 1085 successes, 2 failures.
211 # Repeat one of the failing tests and get a curl command to quickly reproduce the problem
212 # without causing too much log noise.
213 fk@t520 ~ $privoxy-regression-test.pl --test-number 785 --verbose --debug 4
214 2020-12-14 12:17:55: Asking Privoxy for the number of action files available ...
216 2020-12-14 12:17:56: Executing regression tests ...
217 2020-12-14 12:17:56: Executing: curl --include -H 'Proxy-Connection:' -H 'Connection: close' -s -S --user-agent 'Privoxy-Regression-Test 0.7.2' --max-time '5' --globoff -H 'X-Privoxy-Control: hide-referrer{conditional-block}' -H 'Referer: https://p.p/' http://p.p/show-request 2>&1
218 2020-12-14 12:17:56: Ooops. Expected removal but: 'Referer: https://p.p/' is still there.
219 2020-12-14 12:17:56: Failure for test 785 (0/13/5). Header 'Referer: https://p.p/' and tag 'hide-referrer{conditional-block}'
220 2020-12-14 12:17:56: Executed 1 regression tests. Skipped 1201. 0 successes, 1 failures.</PRE
227 >--privoxy-address</B
229 http_proxy environment variable isn't configured and you don't want
230 to use the default (http://127.0.0.1:8118/).
239 >5.3. Fuzzing Privoxy</A
242 > To make fuzzing more convenient, Privoxy can be configured
243 with --enable-fuzz which will result in the --fuzz option
247 > Example (tested on ElectroBSD):
256 CLASS="PROGRAMLISTING"
257 > # Compile Privoxy with instrumentation for afl
258 $ export CC=afl-clang
259 $ export CFLAGS="-fsanitize=address -ggdb"
260 $ export CPPFLAGS=-I/usr/local/include/
261 $ export LDFLAGS="-fsanitize=address -L/usr/local/lib"
262 $ export AFL_USE_ASAN=1
263 $ export AFL_HARDEN=1
264 $ ./configure --with-debug --enable-extended-host-patterns --enable-accept-filter --enable-no-gifs --enable-compression --enable-strptime-sanity-checks --enable-external-filters --enable-fuzz
267 Privoxy version 3.0.24 (http://www.privoxy.org/)
268 Usage: ./privoxy [--config-test] [--chroot] [--help] [--no-daemon] [--pidfile pidfile] [--pre-chroot-nslookup hostname] [--user user[.group]] [--version] [configfile]
269 ./privoxy --fuzz fuzz-mode ./path/to/fuzzed/input [--stfu]
271 Supported fuzz modes and the expected input:
272 action: Text to parse as action file.
273 client-request: Client request to parse. Currently incomplete
274 client-header: Client header to parse.
275 chunked-transfer-encoding: Chunk-encoded data to dechunk.
276 deflate: deflate-compressed data to decompress.
277 filter: Text to parse as filter file.
278 gif: gif to deanimate.
279 gzip: gzip-compressed data to decompress.
280 pcrs-substitute: A pcrs-substitute to compile. Not a whole pcrs job! Example: Bla $1 bla C $3 blah.
281 server-header: Server header to parse.
282 server-response: Server response to parse.
284 The following fuzz modes read data from stdin if the 'file' is '-'
287 chunked-transfer-encoding
297 $ export ASAN_OPTIONS='abort_on_error=1'
299 $ echo '$1 bla fasel $2' > input/pcrs
300 $ afl-fuzz -i input -o output -m none ~/git/privoxy/privoxy --fuzz pcrs-substitute - --stfu
302 $ cat >input/pcrs.txt
304 s@(.{1})[432](\d+)@$1$2$hostname@UgisT
306 $ afl-fuzz -i input/ -o output/ -f bla.filter -m none privoxy --fuzz filter bla.filter --stfu</PRE
317 SUMMARY="Footer navigation table"
346 HREF="newrelease.html"
356 >Coding Guidelines</TD
366 >Releasing a New Version</TD