1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <title>Testing Guidelines</title>
6 <meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
7 <link rel="HOME" title="Privoxy Developer Manual" href="index.html">
8 <link rel="PREVIOUS" title="Coding Guidelines" href="coding.html">
9 <link rel="NEXT" title="Releasing a New Version" href="newrelease.html">
10 <link rel="STYLESHEET" type="text/css" href="../p_doc.css">
11 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
13 <body class="SECT1" bgcolor="#EEEEEE" text="#000000" link="#0000FF" vlink="#840084" alink="#0000FF">
14 <div class="NAVHEADER">
15 <table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
17 <th colspan="3" align="center">Privoxy Developer Manual</th>
20 <td width="10%" align="left" valign="bottom"><a href="coding.html" accesskey="P">Prev</a></td>
21 <td width="80%" align="center" valign="bottom"></td>
22 <td width="10%" align="right" valign="bottom"><a href="newrelease.html" accesskey="N">Next</a></td>
25 <hr align="left" width="100%">
28 <h1 class="SECT1"><a name="TESTING" id="TESTING">5. Testing Guidelines</a></h1>
31 <h2 class="SECT2"><a name="TESTING-PLAN" id="TESTING-PLAN">5.1. Testplan for releases</a></h2>
32 <p>Explain release numbers. major, minor. developer releases. etc.</p>
35 <p>Remove any existing rpm with rpm -e</p>
38 <p>Remove any file that was left over. This includes (but is not limited to)</p>
41 <p>/var/log/privoxy</p>
47 <p>/usr/sbin/privoxy</p>
50 <p>/etc/init.d/privoxy</p>
53 <p>/usr/doc/privoxy*</p>
58 <p>Install the rpm. Any error messages?</p>
61 <p>start,stop,status <span class="APPLICATION">Privoxy</span> with the specific script (e.g.
62 /etc/rc.d/init/privoxy stop). Reboot your machine. Does autostart work?</p>
65 <p>Start browsing. Does <span class="APPLICATION">Privoxy</span> work? Logfile written?</p>
68 <p>Remove the rpm. Any error messages? All files removed?</p>
73 <h2 class="SECT2"><a name="FUZZING" id="FUZZING">5.2. Fuzzing Privoxy</a></h2>
74 <p>To make fuzzing more convenient, Privoxy can be configured with --enable-fuzz which will result in the --fuzz
75 option becoming available.</p>
76 <p>Example (tested on ElectroBSD):</p>
77 <table border="0" bgcolor="#E0E0E0" width="100%">
80 <pre class="PROGRAMLISTING"># Compile Privoxy with instrumentation for afl
82 $ export CFLAGS="-fsanitize=address -ggdb"
83 $ export CPPFLAGS=-I/usr/local/include/
84 $ export LDFLAGS="-fsanitize=address -L/usr/local/lib"
85 $ export AFL_USE_ASAN=1
87 $ ./configure --with-debug --enable-extended-host-patterns --enable-accept-filter --enable-no-gifs --enable-compression --enable-strptime-sanity-checks --enable-external-filters --enable-fuzz
90 Privoxy version 3.0.24 (http://www.privoxy.org/)
91 Usage: ./privoxy [--config-test] [--chroot] [--help] [--no-daemon] [--pidfile pidfile] [--pre-chroot-nslookup hostname] [--user user[.group]] [--version] [configfile]
92 ./privoxy --fuzz fuzz-mode ./path/to/fuzzed/input [--stfu]
94 Supported fuzz modes and the expected input:
95 action: Text to parse as action file.
96 client-request: Client request to parse. Currently incomplete
97 client-header: Client header to parse.
98 chunked-transfer-encoding: Chunk-encoded data to dechunk.
99 deflate: deflate-compressed data to decompress.
100 filter: Text to parse as filter file.
101 gif: gif to deanimate.
102 gzip: gzip-compressed data to decompress.
103 pcrs-substitute: A pcrs-substitute to compile. Not a whole pcrs job! Example: Bla $1 bla C $3 blah.
104 server-header: Server header to parse.
105 server-response: Server response to parse.
107 The following fuzz modes read data from stdin if the 'file' is '-'
110 chunked-transfer-encoding
120 $ export ASAN_OPTIONS='abort_on_error=1'
122 $ echo '$1 bla fasel $2' > input/pcrs
123 $ afl-fuzz -i input -o output -m none ~/git/privoxy/privoxy --fuzz pcrs-substitute - --stfu
125 $ cat >input/pcrs.txt
127 s@(.{1})[432](\d+)@$1$2$hostname@UgisT
129 $ afl-fuzz -i input/ -o output/ -f bla.filter -m none privoxy --fuzz filter bla.filter --stfu</pre>
135 <div class="NAVFOOTER">
136 <hr align="left" width="100%">
137 <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
139 <td width="33%" align="left" valign="top"><a href="coding.html" accesskey="P">Prev</a></td>
140 <td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td>
141 <td width="33%" align="right" valign="top"><a href="newrelease.html" accesskey="N">Next</a></td>
144 <td width="33%" align="left" valign="top">Coding Guidelines</td>
145 <td width="34%" align="center" valign="top"> </td>
146 <td width="33%" align="right" valign="top">Releasing a New Version</td>