X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=doc%2Fwebserver%2Fdeveloper-manual%2Ftesting.html;h=fae9e65e85c45eb3e0ee0fb00f045f5f9f297f9b;hp=7433caa00ce7c4200ffa85d610e3111a0f24e9de;hb=4985684a0376e6a84c5f542c7324617259092575;hpb=69b45dc21f48175fb34a8e1e2f45d46870e37941 diff --git a/doc/webserver/developer-manual/testing.html b/doc/webserver/developer-manual/testing.html index 7433caa0..fae9e65e 100644 --- a/doc/webserver/developer-manual/testing.html +++ b/doc/webserver/developer-manual/testing.html @@ -1,155 +1,158 @@ - Testing Guidelines - + - + - - + -
-

5. Testing - Guidelines

- +

5. Testing Guidelines

To be filled.

-
-

5.1. - Testplan for releases

- +

5.1. Testplan for releases

Explain release numbers. major, minor. developer releases. etc.

-
  1. Remove any existing rpm with rpm -e

  2. -
  3. -

    Remove any file that was left over. This includes (but is not - limited to)

    - +

    Remove any file that was left over. This includes (but is not limited to)

    • /var/log/privoxy

    • -
    • /etc/privoxy

    • -
    • /usr/sbin/privoxy

    • -
    • /etc/init.d/privoxy

    • -
    • /usr/doc/privoxy*

  4. -
  5. Install the rpm. Any error messages?

  6. -
  7. -

    start,stop,status Privoxy with - the specific script (e.g. /etc/rc.d/init/privoxy stop). Reboot your - machine. Does autostart work?

    +

    start,stop,status Privoxy with the specific script (e.g. + /etc/rc.d/init/privoxy stop). Reboot your machine. Does autostart work?

  8. -
  9. -

    Start browsing. Does Privoxy - work? Logfile written?

    +

    Start browsing. Does Privoxy work? Logfile written?

  10. -
  11. Remove the rpm. Any error messages? All files removed?

-
-

5.2. - Test reports

- -

Please submit test reports only with the test form at sourceforge. Three simple steps:

- - Do not mail to the mailing list (we cannot keep track on issues - there). +

5.2. Testing with Privoxy-Regression-Test

+

If you compiled, packaged or merely installed Privoxy, it is recommended to run Privoxy-Regression-Test to verify that at least the tested parts of Privoxy are working as expected.

+

This is actually pretty easy. For details, please see perldoc + privoxy-regression-test.pl.

+
+
+

5.3. Fuzzing Privoxy

+

To make fuzzing more convenient, Privoxy can be configured with --enable-fuzz which will result in the --fuzz + option becoming available.

+

Example (tested on ElectroBSD):

+ + + + +
+
# Compile Privoxy with instrumentation for afl
+$ export CC=afl-clang
+$ export CFLAGS="-fsanitize=address -ggdb"
+$ export CPPFLAGS=-I/usr/local/include/
+$ export LDFLAGS="-fsanitize=address -L/usr/local/lib"
+$ export AFL_USE_ASAN=1
+$ export AFL_HARDEN=1
+$ ./configure --with-debug --enable-extended-host-patterns --enable-accept-filter --enable-no-gifs --enable-compression --enable-strptime-sanity-checks --enable-external-filters --enable-fuzz
+
+$ ./privoxy --fuzz
+Privoxy version 3.0.24 (http://www.privoxy.org/)
+Usage: ./privoxy [--config-test] [--chroot] [--help] [--no-daemon] [--pidfile pidfile] [--pre-chroot-nslookup hostname] [--user user[.group]] [--version] [configfile]
+       ./privoxy --fuzz fuzz-mode ./path/to/fuzzed/input [--stfu]
+
+Supported fuzz modes and the expected input:
+ action: Text to parse as action file.
+ client-request: Client request to parse. Currently incomplete
+ client-header: Client header to parse.
+ chunked-transfer-encoding: Chunk-encoded data to dechunk.
+ deflate: deflate-compressed data to decompress.
+ filter: Text to parse as filter file.
+ gif: gif to deanimate.
+ gzip: gzip-compressed data to decompress.
+ pcrs-substitute: A pcrs-substitute to compile. Not a whole pcrs job! Example: Bla $1 bla C $3 blah.
+ server-header: Server header to parse.
+ server-response: Server response to parse.
+
+The following fuzz modes read data from stdin if the 'file' is '-'
+ client-request
+ client-header
+ chunked-transfer-encoding
+ deflate
+ gif
+ gzip
+ pcrs-substitute
+ server-header
+ server-response
+
+Aborting
+
+$ export ASAN_OPTIONS='abort_on_error=1'
+$ mkdir input output
+$ echo '$1 bla fasel $2' > input/pcrs
+$ afl-fuzz -i input -o output -m none ~/git/privoxy/privoxy --fuzz pcrs-substitute - --stfu
+
+$ cat >input/pcrs.txt
+FILTER: bla fasel
+s@(.{1})[432](\d+)@$1$2$hostname@UgisT
+
+$ afl-fuzz -i input/ -o output/ -f bla.filter -m none privoxy --fuzz filter bla.filter --stfu
+
-