rebuild docs
[privoxy.git] / doc / webserver / developer-manual / testing.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
2 <HTML
3 ><HEAD
4 ><TITLE
5 >Testing Guidelines</TITLE
6 ><META
7 NAME="GENERATOR"
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9 REL="HOME"
10 TITLE="Privoxy Developer Manual"
11 HREF="index.html"><LINK
12 REL="PREVIOUS"
13 TITLE="Coding Guidelines"
14 HREF="coding.html"><LINK
15 REL="NEXT"
16 TITLE="Releasing a New Version"
17 HREF="newrelease.html"><LINK
18 REL="STYLESHEET"
19 TYPE="text/css"
20 HREF="../p_doc.css"><META
21 HTTP-EQUIV="Content-Type"
22 CONTENT="text/html;
23 charset=ISO-8859-1"></HEAD
24 ><BODY
25 CLASS="SECT1"
26 BGCOLOR="#EEEEEE"
27 TEXT="#000000"
28 LINK="#0000FF"
29 VLINK="#840084"
30 ALINK="#0000FF"
31 ><DIV
32 CLASS="NAVHEADER"
33 ><TABLE
34 SUMMARY="Header navigation table"
35 WIDTH="100%"
36 BORDER="0"
37 CELLPADDING="0"
38 CELLSPACING="0"
39 ><TR
40 ><TH
41 COLSPAN="3"
42 ALIGN="center"
43 >Privoxy Developer Manual</TH
44 ></TR
45 ><TR
46 ><TD
47 WIDTH="10%"
48 ALIGN="left"
49 VALIGN="bottom"
50 ><A
51 HREF="coding.html"
52 ACCESSKEY="P"
53 >Prev</A
54 ></TD
55 ><TD
56 WIDTH="80%"
57 ALIGN="center"
58 VALIGN="bottom"
59 ></TD
60 ><TD
61 WIDTH="10%"
62 ALIGN="right"
63 VALIGN="bottom"
64 ><A
65 HREF="newrelease.html"
66 ACCESSKEY="N"
67 >Next</A
68 ></TD
69 ></TR
70 ></TABLE
71 ><HR
72 ALIGN="LEFT"
73 WIDTH="100%"></DIV
74 ><DIV
75 CLASS="SECT1"
76 ><H1
77 CLASS="SECT1"
78 ><A
79 NAME="TESTING"
80 >5. Testing Guidelines</A
81 ></H1
82 ><P
83 >To be filled.</P
84 ><DIV
85 CLASS="SECT2"
86 ><H2
87 CLASS="SECT2"
88 ><A
89 NAME="TESTING-PLAN"
90 >5.1. Testplan for releases</A
91 ></H2
92 ><P
93 >       Explain release numbers. major, minor. developer releases. etc.
94       </P
95 ><P
96 ></P
97 ><OL
98 TYPE="1"
99 ><LI
100 ><P
101 >Remove any existing rpm with rpm -e</P
102 ></LI
103 ><LI
104 ><P
105 >Remove any file that was left over. This includes (but is not limited to)
106           </P
107 ><P
108 ></P
109 ><UL
110 ><LI
111 ><P
112 >/var/log/privoxy</P
113 ></LI
114 ><LI
115 ><P
116 >/etc/privoxy</P
117 ></LI
118 ><LI
119 ><P
120 >/usr/sbin/privoxy</P
121 ></LI
122 ><LI
123 ><P
124 >/etc/init.d/privoxy</P
125 ></LI
126 ><LI
127 ><P
128 >/usr/doc/privoxy*</P
129 ></LI
130 ></UL
131 ></LI
132 ><LI
133 ><P
134 >Install the rpm. Any error messages?</P
135 ></LI
136 ><LI
137 ><P
138 >start,stop,status <SPAN
139 CLASS="APPLICATION"
140 >Privoxy</SPAN
141 > with the specific script
142       (e.g. /etc/rc.d/init/privoxy stop). Reboot your machine. Does
143       autostart work?</P
144 ></LI
145 ><LI
146 ><P
147 >Start browsing. Does <SPAN
148 CLASS="APPLICATION"
149 >Privoxy</SPAN
150 > work? Logfile written?</P
151 ></LI
152 ><LI
153 ><P
154 >Remove the rpm. Any error messages? All files removed?</P
155 ></LI
156 ></OL
157 ></DIV
158 ><DIV
159 CLASS="SECT2"
160 ><H2
161 CLASS="SECT2"
162 ><A
163 NAME="FUZZING"
164 >5.2. Fuzzing Privoxy</A
165 ></H2
166 ><P
167 >       To make fuzzing more convenient, Privoxy can be configured
168        with --enable-fuzz which will result in the --fuzz option
169        becoming available.
170      </P
171 ><P
172 >      Example (tested on ElectroBSD):
173      </P
174 ><TABLE
175 BORDER="0"
176 BGCOLOR="#E0E0E0"
177 WIDTH="100%"
178 ><TR
179 ><TD
180 ><PRE
181 CLASS="PROGRAMLISTING"
182 ># Compile Privoxy with instrumentation for afl
183 $ export CC=afl-clang
184 $ export CFLAGS="-fsanitize=address -ggdb"
185 $ export CPPFLAGS=-I/usr/local/include/
186 $ export LDFLAGS="-fsanitize=address -L/usr/local/lib"
187 $ export AFL_USE_ASAN=1
188 $ export AFL_HARDEN=1
189 $ ./configure --with-debug --enable-extended-host-patterns --enable-accept-filter --enable-no-gifs --enable-compression --enable-strptime-sanity-checks --enable-external-filters --enable-fuzz
190
191 $ ./privoxy --fuzz
192 Privoxy version 3.0.24 (http://www.privoxy.org/)
193 Usage: ./privoxy [--config-test] [--chroot] [--help] [--no-daemon] [--pidfile pidfile] [--pre-chroot-nslookup hostname] [--user user[.group]] [--version] [configfile]
194        ./privoxy --fuzz fuzz-mode ./path/to/fuzzed/input [--stfu]
195
196 Supported fuzz modes and the expected input:
197  action: Text to parse as action file.
198  client-request: Client request to parse. Currently incomplete
199  client-header: Client header to parse.
200  chunked-transfer-encoding: Chunk-encoded data to dechunk.
201  deflate: deflate-compressed data to decompress.
202  filter: Text to parse as filter file.
203  gif: gif to deanimate.
204  gzip: gzip-compressed data to decompress.
205  pcrs-substitute: A pcrs-substitute to compile. Not a whole pcrs job! Example: Bla $1 bla C $3 blah.
206  server-header: Server header to parse.
207  server-response: Server response to parse.
208
209 The following fuzz modes read data from stdin if the 'file' is '-'
210  client-request
211  client-header
212  chunked-transfer-encoding
213  deflate
214  gif
215  gzip
216  pcrs-substitute
217  server-header
218  server-response
219
220 Aborting
221
222 $ export ASAN_OPTIONS='abort_on_error=1'
223 $ mkdir input output
224 $ echo '$1 bla fasel $2' &#62; input/pcrs
225 $ afl-fuzz -i input -o output -m none ~/git/privoxy/privoxy --fuzz pcrs-substitute - --stfu
226
227 $ cat &#62;input/pcrs.txt
228 FILTER: bla fasel
229 s@(.{1})[432](\d+)@$1$2$hostname@UgisT
230
231 $ afl-fuzz -i input/ -o output/ -f bla.filter -m none privoxy --fuzz filter bla.filter --stfu</PRE
232 ></TD
233 ></TR
234 ></TABLE
235 ></DIV
236 ></DIV
237 ><DIV
238 CLASS="NAVFOOTER"
239 ><HR
240 ALIGN="LEFT"
241 WIDTH="100%"><TABLE
242 SUMMARY="Footer navigation table"
243 WIDTH="100%"
244 BORDER="0"
245 CELLPADDING="0"
246 CELLSPACING="0"
247 ><TR
248 ><TD
249 WIDTH="33%"
250 ALIGN="left"
251 VALIGN="top"
252 ><A
253 HREF="coding.html"
254 ACCESSKEY="P"
255 >Prev</A
256 ></TD
257 ><TD
258 WIDTH="34%"
259 ALIGN="center"
260 VALIGN="top"
261 ><A
262 HREF="index.html"
263 ACCESSKEY="H"
264 >Home</A
265 ></TD
266 ><TD
267 WIDTH="33%"
268 ALIGN="right"
269 VALIGN="top"
270 ><A
271 HREF="newrelease.html"
272 ACCESSKEY="N"
273 >Next</A
274 ></TD
275 ></TR
276 ><TR
277 ><TD
278 WIDTH="33%"
279 ALIGN="left"
280 VALIGN="top"
281 >Coding Guidelines</TD
282 ><TD
283 WIDTH="34%"
284 ALIGN="center"
285 VALIGN="top"
286 >&nbsp;</TD
287 ><TD
288 WIDTH="33%"
289 ALIGN="right"
290 VALIGN="top"
291 >Releasing a New Version</TD
292 ></TR
293 ></TABLE
294 ></DIV
295 ></BODY
296 ></HTML
297 >