for executing the regression tests. Useful to make sure that the
requests to load the regression tests don't fail due to fuzzing.
# A regression test "framework" for Privoxy. For documentation see:
# perldoc privoxy-regression-test.pl
#
# A regression test "framework" for Privoxy. For documentation see:
# perldoc privoxy-regression-test.pl
#
-# $Id: privoxy-regression-test.pl,v 1.146 2008/05/02 10:16:37 fk Exp $
+# $Id: privoxy-regression-test.pl,v 1.147 2008/05/04 18:17:45 fk Exp $
#
# Wish list:
#
# - Update documentation
# - Validate HTTP times.
#
# Wish list:
#
# - Update documentation
# - Validate HTTP times.
-# - Understand default.action.master comment syntax
-# and verify that we actually block and unblock what
-# the comments claim we do.
# - Implement a HTTP_VERSION directive or allow to
# specify whole request lines.
# - Support filter regression tests.
# - Implement a HTTP_VERSION directive or allow to
# specify whole request lines.
# - Support filter regression tests.
sub get_page_with_curl ($) {
sub get_page_with_curl ($) {
my $parameters = shift;
my @buffer;
my $curl_line = CURL;
my $retries_left = get_cli_option('retries') + 1;
my $failure_reason;
my $parameters = shift;
my @buffer;
my $curl_line = CURL;
my $retries_left = get_cli_option('retries') + 1;
my $failure_reason;
- if (cli_option_is_set('privoxy-address')) {
- $curl_line .= ' --proxy ' . get_cli_option('privoxy-address');
- }
+ $curl_line .= ' --proxy ' . $proxy if (defined $proxy);
# We want to see the HTTP status code
$curl_line .= " --include ";
# We want to see the HTTP status code
$curl_line .= " --include ";
Options and their default values if they have any:
[--debug $cli_options{'debug'}]
Options and their default values if they have any:
[--debug $cli_options{'debug'}]
[--fuzzer-feeding]
[--help]
[--level]
[--fuzzer-feeding]
[--help]
[--level]
'min-level=s' => \$cli_options{'min-level'},
'max-level=s' => \$cli_options{'max-level'},
'privoxy-address=s' => \$cli_options{'privoxy-address'},
'min-level=s' => \$cli_options{'min-level'},
'max-level=s' => \$cli_options{'max-level'},
'privoxy-address=s' => \$cli_options{'privoxy-address'},
+ 'fuzzer-address=s' => \$cli_options{'fuzzer-address'},
'level=s' => \$cli_options{'level'},
'loops=s' => \$cli_options{'loops'},
'test-number=s' => \$cli_options{'test-number'},
'level=s' => \$cli_options{'level'},
'loops=s' => \$cli_options{'loops'},
'test-number=s' => \$cli_options{'test-number'},
return $cli_options{$cli_option};
}
return $cli_options{$cli_option};
}
+sub init_proxy_settings($) {
+
+ my $choice = shift;
+ our $proxy = undef;
+
+ if (($choice eq 'fuzz-proxy') and cli_option_is_set('fuzzer-address')) {
+ $proxy = get_cli_option('fuzzer-address');
+ }
+
+ if ((not defined $proxy) or ($choice eq 'vanilla-proxy')) {
+
+ if (cli_option_is_set('privoxy-address')) {
+ $proxy .= get_cli_option('privoxy-address');
+ }
+
+ }
+}
+
sub main () {
init_our_variables();
parse_cli_options();
check_for_curl();
sub main () {
init_our_variables();
parse_cli_options();
check_for_curl();
+ init_proxy_settings('vanilla-proxy');
load_regressions_tests();
load_regressions_tests();
+ init_proxy_settings('fuzz-proxy');
execute_regression_tests();
}
execute_regression_tests();
}
-B<privoxy-regression-test> [B<--debug bitmask>] [B<--fuzzer-feeding>] [B<--help>]
-[B<--level level>] [B<--loops count>] [B<--max-level max-level>]
-[B<--max-time max-time>] [B<--min-level min-level>] B<--privoxy-address proxy-address>
+B<privoxy-regression-test> [B<--debug bitmask>] [B<--fuzzer-feeding>]
+[B<--fuzzer-feeding>] [B<--help>] [B<--level level>] [B<--loops count>]
+[B<--max-level max-level>] [B<--max-time max-time>]
+[B<--min-level min-level>] B<--privoxy-address proxy-address>
[B<--retries retries>] [B<--verbose>] [B<--version>]
=head1 DESCRIPTION
[B<--retries retries>] [B<--verbose>] [B<--version>]
=head1 DESCRIPTION
B<--debug bitmask> Add the bitmask provided as integer
to the debug settings.
B<--debug bitmask> Add the bitmask provided as integer
to the debug settings.
+B<--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.
+
B<--fuzzer-feeding> Ignore some errors that would otherwise
cause Privoxy-Regression-Test to abort the test because
they shouldn't happen in normal operation. This option is
B<--fuzzer-feeding> Ignore some errors that would otherwise
cause Privoxy-Regression-Test to abort the test because
they shouldn't happen in normal operation. This option is