my $TELNETPORT=$noport; # TELNET server port with negotiation
my $HTTPUNIXPATH; # HTTP server Unix domain socket path
+my $use_external_proxy = 0;
+my $proxy_address;
+
my $SSHSRVMD5 = "[uninitialized]"; # MD5 of ssh server public key
my $VERSION; # curl's reported version number
}
}
+#######################################################################
+# Return flags to let curl use an external HTTP proxy
+#
+sub getexternalproxyflags {
+ return " --proxy $proxy_address ";
+}
+
#######################################################################
# Verify that the server that runs on $ip, $port is our server. This also
# implies that we can speak with it, as there might be occasions when the
$flags .= "--globoff ";
$flags .= "--unix-socket '$port_or_path' " if $ipvnum eq "unix";
$flags .= "--insecure " if($proto eq 'https');
+ if($use_external_proxy) {
+ $flags .= getexternalproxyflags();
+ }
$flags .= "\"$proto://$ip:$port/${bonus}verifiedserver\"";
my $cmd = "$VCURL $flags 2>$verifylog";
$flags .= "--verbose ";
$flags .= "--globoff ";
$flags .= $extra;
+ if($use_external_proxy) {
+ $flags .= getexternalproxyflags();
+ }
$flags .= "\"$proto://$ip:$port/verifiedserver\"";
my $cmd = "$VCURL $flags 2>$verifylog";
$flags .= "--silent ";
$flags .= "--verbose ";
$flags .= "--globoff ";
+ if($use_external_proxy) {
+ $flags .= getexternalproxyflags();
+ }
# currently verification is done using http
$flags .= "\"http://$ip:$port/verifiedserver\"";
$flags .= "--tlsauthtype SRP ";
$flags .= "--tlsuser jsmith ";
$flags .= "--tlspassword abc ";
+ if($use_external_proxy) {
+ $flags .= getexternalproxyflags();
+ }
$flags .= "\"https://$ip:$port/verifiedserver\"";
my $cmd = "$VCURL $flags 2>$verifylog";
}
}
}
+ if($use_external_proxy) {
+ $ENV{http_proxy} = $proxy_address;
+ $ENV{HTTPS_PROXY} = $proxy_address;
+ }
if(!$why) {
my @precheck = getpart("client", "precheck");
$fail_due_event_based--;
}
$cmdargs .= $cmd;
+ if ($use_external_proxy) {
+ $cmdargs .= " --proxy $proxy_address ";
+ }
}
else {
$cmdargs = " $cmd"; # $cmd is the command line for the test file
elsif($ARGV[0] eq "-p") {
$postmortem=1;
}
+ elsif($ARGV[0] eq "-P") {
+ shift @ARGV;
+ $use_external_proxy=1;
+ $proxy_address=$ARGV[0];
+ }
elsif($ARGV[0] eq "-l") {
# lists the test case names only
$listonly=1;
-k keep stdout and stderr files present after tests
-l list all test case names/descriptions
-n no valgrind
+ -P proxy use the specified proxy
-p print log file contents when a test fails
-R scrambled order (uses the random seed, see --seed)
-r run time statistics