PRIVOXY...ION-TEST(1)
okay bestie, buckle up π«Ά β this is the PRIVOXY...ION-TEST(1) manual page, aka the User Contributed Perl Documentation edition, and we're about to make a regression-test "framework" make sense. π
π NAME π
privoxy-regression-test β A regression test "framework" for Privoxy.
β¨ SYNOPSIS β¨
No cap, the synopsis is a whole lot, so here it is verbatim:
privoxy-regression-test [--check-bad-ssl] [--curl curl] [--debug
bitmask] [--forks forks] [--fuzzer-feeding] [--fuzzer-feeding] [--help]
[--level level] [--local-test-file testfile] [--loops count]
[--max-level max-level] [--max-time max-time] [--min-level min-level]
--privoxy-address proxy-address --privoxy-cgi-prefix cgi-prefix
[--retries retries] [--test-number test-number] [--show-skipped-tests]
[--sleep-time seconds] [--verbose] [--version]
and yes, the synopsis says --loops while the options list says --loop β I'm keeping both exactly as the page has them. π
π¦ DESCRIPTION π¦
So Privoxy-Regression-Test is supposed to one day become a regression test suite for Privoxy. It's not quite there yet, however, and can currently only test header actions, check the returned status code for requests to arbitrary URLs and verify which actions are applied to them. It's giving "promising little icon still loading." π±
Client header actions are tested by requesting http://p.p/show-request and checking whether or not Privoxy modified the original request as expected.
The original request contains both the header the action-to-be-tested acts upon and an additional tagger-triggering header that enables the action to test.
Applied actions are checked through http://p.p/show-url-info.
πΈ CONFIGURATION FILE SYNTAX πΈ
Privoxy-Regression-Test's configuration is embedded in Privoxy action files and loaded through Privoxy's web interface.
It makes testing a Privoxy version running on a remote system easier and should prevent you from updating your tests without updating Privoxy's configuration accordingly. lowkey thoughtful.
A client-header-action test section looks like this:
# Set Header = Referer: http://www.example.org.zwiebelsuppe.exit/
# Expect Header = Referer: http://www.example.org/
{+client-header-filter{hide-tor-exit-notation} -hide-referer}
TAG:^client-header-filter\{hide-tor-exit-notation\}$
The example above causes Privoxy-Regression-Test to set the header Referer: http://www.example.org.zwiebelsuppe.exit/ and to expect it to be modified to Referer: http://www.example.org/.
When testing this section, Privoxy-Regression-Test will set the header X-Privoxy-Control: client-header-filter{hide-tor-exit-notation} causing the privoxy-control tagger to create the tag client-header-filter{hide-tor-exit-notation} which will finally cause Privoxy to enable the action section.
π‘ note bestie: the actions themselves are only used by Privoxy, Privoxy-Regression-Test ignores them and will be happy as long as the expectations are satisfied.
A fetch test looks like this:
# Fetch Test = http://p.p/user-manual
# Expect Status Code = 302
It tells Privoxy-Regression-Test to request http://p.p/user-manual and to expect a response with the HTTP status code 302. Obviously that's not a very thorough test and mainly useful to get some code coverage for Valgrind or to verify that the templates are installed correctly. slay for coverage, I guess. π
If you want to test CGI pages that require a trusted referer, you can use:
# Trusted CGI Request = http://p.p/edit-actions
It works like ordinary fetch tests, but sets the referer header to a trusted value.
If no explicit status code expectation is set, 200 is used.
To verify that a URL is blocked, use:
# Blocked URL = http://www.example.com/blocked
To verify that a specific set of actions is applied to an URL, use:
# Sticky Actions = +block{foo} +handle-as-empty-document -handle-as-image
# URL = http://www.example.org/my-first-url
The sticky actions will be checked for all URLs below it until the next sticky actions directive.
To verify that requests for a URL get redirected, use:
# Redirected URL = http://www.example.com/redirect-me
# Redirect Destination = http://www.example.org/redirected
To skip a test, add the following line:
# Ignore = Yes
The difference between a skipped test and a removed one is that removing a test affects the numbers of the following tests, while a skipped test is still loaded and thus keeps the test numbers unchanged. no cap, numbering is sacred. π’
Sometimes user modifications intentionally conflict with tests in the default configuration and thus cause test failures. Adding the Ignore directive to the failing tests works but is inconvenient as the directive is likely to get lost with the next update.
Overwrite conditions are an alternative and can be added in any action file as long as they come after the test that is expected to fail. They cause all previous tests that match the condition to be skipped.
It is recommended to put the overwrite condition below the custom Privoxy section that causes the expected test failure and before the custom test that verifies the now expected behaviour. Example:
# The following section is expected to overwrite a section in
# default.action, whose effect is being tested. Thus also disable
# the test that is now expected to fail and add a new one.
#
{+block{Facebook makes Firefox even more unstable. Do not want.}}
# Overwrite condition = http://apps.facebook.com/onthefarm/track.php?creative=&cat=friendvisit&subcat=weeds&key=a789a971dc687bee4c20c044834fabdd&next=index.php%3Fref%3Dnotif%26visitId%3D898835505
# Blocked URL = http://apps.facebook.com/
.facebook./
π TEST LEVELS π
All tests have test levels to let the user control which ones to execute (see OPTIONS below). Test levels are either set with the Level directive, or implicitly through the test type.
Redirect tests default to level 108, block tests to level 7, fetch tests to level 6, "Sticky Actions" tests default to level 5, tests for trusted CGI requests to level 3 and client-header-action tests to level 1.
β οΈ heads up: the current redirect test level is above the default max-level value as failed tests will result in outgoing connections. Use the --max-level option to run them as well. fr fr, read that one twice.
The "Default level offset" directive can be used to change the default level by a given value. This directive affects all tests located after it until the end of the file or another "Default level offset" directive is reached. The purpose of this directive is to make it more convenient to skip similar tests in a given file without having to remove or disable the tests completely.
π OPTIONS π
--check-bad-sslβ Instead of running the regression tests as described above, request pages frombadssl.comwith bad certificates to verify that Privoxy is detecting the certificate issues. Only works if Privoxy has been compiled withFEATURE_HTTPS_INSPECTION, has been configured properly and can reach the Internet.--curl curlβ Use a non-defaultcurlbinary.--debug bitmaskβ Add the bitmask provided as integer to the debug settings.--forks forksβ Number of forks to start before executing the regression tests. This is mainly useful for stress-testing.--fuzzer-addressβ Listening address used when executing the regression tests. Useful to make sure that the requests to load the regression tests don't fail due to fuzzing.--fuzzer-feedingβ Ignore some errors that would otherwise causePrivoxy-Regression-Testto abort the test because they shouldn't happen in normal operation. This option is intended to be used ifPrivoxy-Regression-Testis only used to feed a fuzzer in which case there's a high chance that Privoxy gets an invalid request and returns an error message.--helpβ Shows available command line options.--header-fuzzingβ Modifies linear white space in headers in a way that should not affect the test result.--level levelβ Only execute tests with the specified level.--local-test-file test-fileβ Do not get the tests through Privoxy's web interface, but use a single local file. Not recommended for testing Privoxy, but can be useful to "misappropriate"Privoxy-Regression-Testto test other stuff, like webserver configurations.--loop countβ Loop through the regression testscounttimes. Useful to feed a fuzzer, or when doing stress tests with severalPrivoxy-Regression-Testinstances running at the same time.--max-level max-levelβ Only execute tests with a level below or equal to the numericalmax-level.--max-time max-timeβ Give Privoxymax-timeseconds to return data. Increasing the default may make sense when Privoxy is run through Valgrind, decreasing the default may make sense whenPrivoxy-Regression-Testis used to feed a fuzzer.--min-level min-levelβ Only execute tests with a level above or equal to the numericalmin-level. If themin-levelis larger than themax-level, themax-levelis set to themin-level.--privoxy-address proxy-addressβ Privoxy's listening address. If it's not set, the value of the environment variablehttp_proxywill be used unless the variable isn't set in which casehttp://127.0.0.1:8118/will be used.proxy-addresshas to be specified inhttp_proxysyntax.--privoxy-cgi-prefix privoxy-cgi-prefixβ The prefix to use when building URLs that are supposed to reach Privoxy's CGI interface. If it's not set,http://p.p/is used, which is supposed to work with the default Privoxy configuration. If Privoxy has been built withFEATURE_HTTPS_INSPECTIONenabled, and if https inspection is activated with the+https-inspectionaction, this option can be used withhttps://p.p/provided the system runningPrivoxy-Regression-Testhas been configured to trust the certificate used by Privoxy. Note that there are currently two tests in the officialregression-tests.actionfile that are expected to fail when using aprivoxy-cgi-prefixwithhttps://and aren't automatically skipped.--retries retriesβ Retryretriestimes.--test-number test-numberβ Only run the test with the specified number.--show-skipped-testsβ Log skipped tests even if verbose mode is off.--shuffle-testsβ Shuffle test sections and their tests before executing them. When combined with--forks, this can increase the chances of detecting race conditions. Of course some problems are easier to detect without this option.--sleep-time secondsβ Waitsecondsbetween tests. Useful when debugging issues with systems that don't log with millisecond precision.--verboseβ Log successful tests as well. By default only the failures are logged.--versionβ Print version and exit.
The second dash is optional, options can be shortened, as long as there are no ambiguities. π«
π PRIVOXY CONFIGURATION π
okay so here's the tea, bestie π β Privoxy-Regression-Test ships with a file called regression-tests.action, and its whole ~purpose~ is to test all the official client-header modifying actions. It can also be used to verify that the templates and the user manual files actually got installed correctly. lowkey a vibe check for your install β¨
To use it, you gotta copy it into Privoxy's configuration directory, and then reference it in Privoxy's configuration file with this line:
actionsfile regression-tests.action
In general, its tests are supposed to work without changing any other action files β unless you already added lots of taggers yourself π. If you're using taggers that cause problems, you might have to temporarily disable them for Privoxy's CGI pages. annoying but iconic, we deal.
Some of the regression tests rely on Privoxy features that may be disabled in your configuration π so like, heads up:
- Tests with a level below 7 are supposed to work with all Privoxy configurations β provided you didn't build with
FEATURE_GRACEFUL_TERMINATION. - Tests with level 9 require Privoxy to deliver the User Manual π
- Tests with level 12 require the CGI editor to be enabled.
π CAVEATS π
Expect the configuration file syntax to change with future releases. fr fr, it's giving "don't get too attached" π
π§ LIMITATIONS π§
- As Privoxy's
show-requestpage only shows client headers,Privoxy-Regression-Testcan't use it to test Privoxy actions that modify server headers. ngl that's just how it is π« - As
Privoxy-Regression-Testrelies on Privoxy's tag feature to control the actions to test, it currently only works with Privoxy 3.0.7 or later β - At the moment
Privoxy-Regression-Testfetches Privoxy's configuration page throughcurl(1)β therefore you have to have curl installed, otherwise you won't be able to runPrivoxy-Regression-Testin a meaningful way. no curl, no slay π
π SEE ALSO π
π AUTHOR π
Fabian Keil <fk@fabiankeil.de> β periodt, the main character of this manpage π«Ά
and that's a wrap bestie π¦β¨ this page is perl v5.42.2, dated 2026-03-31, and it lives under the PRIVOXY...ION-TEST(1) name in the User Contributed Perl Documentation. go forth and regression-test, ily πππΈ
π¦ where this page comes from
- arch rolling: privoxy 4.2.0-1 Β· GPL-2.0-or-later AND ISC
- nixpkgs unstable: privoxy 4.2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms