my $HTTPTLS6PORT; # HTTP TLS (non-stunnel) IPv6 server port
my $HTTPPROXYPORT; # HTTP proxy port, when using CONNECT
my $HTTPPIPEPORT; # HTTP pipelining port
-my $HTTPUNIXPATH; # HTTP server Unix domain socket path
my $srcdir = $ENV{'srcdir'} || '.';
my $CURL="../src/curl".exe_ext(); # what curl executable to run on the tests
my $gdb = checktestcmd("gdb");
my $httptlssrv = find_httptlssrv();
-my $ssl_version; # set if libcurl is built with SSL support
-my $large_file; # set if libcurl is built with large file support
-my $has_idn; # set if libcurl is built with IDN support
-my $http_ipv6; # set if HTTP server has IPv6 support
-my $http_unix; # set if HTTP server has Unix sockets support
-my $ftp_ipv6; # set if FTP server has IPv6 support
-my $tftp_ipv6; # set if TFTP server has IPv6 support
-my $gopher_ipv6; # set if Gopher server has IPv6 support
-my $has_ipv6; # set if libcurl is built with IPv6 support
-my $has_unix; # set if libcurl is built with Unix sockets support
-my $has_libz; # set if libcurl is built with libz support
+my $ssl_version; # set if libcurl is built with SSL support
+my $large_file; # set if libcurl is built with large file support
+my $has_idn; # set if libcurl is built with IDN support
+my $http_ipv6; # set if HTTP server has IPv6 support
+my $ftp_ipv6; # set if FTP server has IPv6 support
+my $tftp_ipv6; # set if TFTP server has IPv6 support
+my $gopher_ipv6; # set if Gopher server has IPv6 support
+my $has_ipv6; # set if libcurl is built with IPv6 support
+my $has_libz; # set if libcurl is built with libz support
my $has_getrlimit; # set if system has getrlimit()
-my $has_ntlm; # set if libcurl is built with NTLM support
-my $has_ntlm_wb; # set if libcurl is built with NTLM delegation to winbind
-my $has_sspi; # set if libcurl is built with Windows SSPI
-my $has_gssapi; # set if libcurl is built with a GSS-API library
-my $has_kerberos; # set if libcurl is built with Kerberos support
-my $has_spnego; # set if libcurl is built with SPNEGO support
-my $has_charconv; # set if libcurl is built with CharConv support
-my $has_tls_srp; # set if libcurl is built with TLS-SRP support
-my $has_metalink; # set if curl is built with Metalink support
-my $has_http2; # set if libcurl is built with HTTP2 support
-my $has_crypto; # set if libcurl is built with cryptographic support
-my $has_cares; # set if built with c-ares
-my $has_threadedres;# set if built with threaded resolver
-
-# this version is decided by the particular nghttp2 library that is being used
-my $h2cver = "h2c-14";
-
-my $has_openssl; # built with a lib using an OpenSSL-like API
-my $has_gnutls; # built with GnuTLS
-my $has_nss; # built with NSS
-my $has_yassl; # built with yassl
-my $has_polarssl; # built with polarssl
-my $has_axtls; # built with axTLS
-my $has_winssl; # built with WinSSL (Secure Channel aka Schannel)
-my $has_darwinssl; # build with DarwinSSL (Secure Transport)
-
-my $has_sslpinning; # built with a TLS backend that supports pinning
+my $has_ntlm; # set if libcurl is built with NTLM support
+my $has_ntlm_wb; # set if libcurl is built with NTLM delegation to winbind
+my $has_sspi; # set if libcurl is built with SSPI support
+my $has_charconv;# set if libcurl is built with CharConv support
+my $has_tls_srp; # set if libcurl is built with TLS-SRP support
+my $has_metalink;# set if curl is built with Metalink support
+
+my $has_openssl; # built with a lib using an OpenSSL-like API
+my $has_gnutls; # built with GnuTLS
+my $has_nss; # built with NSS
+my $has_yassl; # built with yassl
+my $has_polarssl; # built with polarssl
+my $has_axtls; # built with axTLS
+my $has_winssl; # built with WinSSL (Secure Channel aka Schannel)
+my $has_darwinssl;# build with DarwinSSL (Secure Transport)
my $has_shared = "unknown"; # built shared
-my $resolver; # name of the resolver backend (for human presentation)
-my $ssllib; # name of the SSL library we use (for human presentation)
+my $resolver; # string to hold the resolver backend
+my $has_cares; # if built with c-ares
+my $has_threadedres; # if built with threaded resolver
-my $has_textaware; # set if running on a system that has a text mode concept
- # on files. Windows for example
+my $ssllib; # name of the lib we use (for human presentation)
+my $has_crypto; # set if libcurl is built with cryptographic support
+my $has_textaware; # set if running on a system that has a text mode concept
+ # on files. Windows for example
my @protocols; # array of lowercase supported protocol servers
if (!$USER) {
$USER = $ENV{USERNAME}; # Windows
if (!$USER) {
- $USER = $ENV{LOGNAME}; # Some Unix (I think)
+ $USER = $ENV{LOGNAME}; # Some UNIX (I think)
}
}
# Load serverpidfile hash with pidfile names for all possible servers.
#
sub init_serverpidfile_hash {
- for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp')) {
+ for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp', 'http')) {
for my $ssl (('', 's')) {
for my $ipvnum ((4, 6)) {
for my $idnum ((1, 2, 3)) {
}
}
}
- for my $proto (('http', 'imap', 'pop3', 'smtp')) {
- for my $ssl (('', 's')) {
- my $serv = servername_id("$proto$ssl", "unix", 1);
- my $pidf = server_pidfilename("$proto$ssl", "unix", 1);
- $serverpidfile{$serv} = $pidf;
- }
- }
}
#######################################################################
# All servers relative to the given one must be stopped also
#
my @killservers;
- if($server =~ /^(ftp|http|imap|pop3|smtp|httppipe)s((\d*)(-ipv6|-unix|))$/) {
+ if($server =~ /^(ftp|http|imap|pop3|smtp|httppipe)s((\d*)(-ipv6|))$/) {
# given a stunnel based ssl server, also kill non-ssl underlying one
push @killservers, "${1}${2}";
}
- elsif($server =~ /^(ftp|http|imap|pop3|smtp|httppipe)((\d*)(-ipv6|-unix|))$/) {
+ elsif($server =~ /^(ftp|http|imap|pop3|smtp|httppipe)((\d*)(-ipv6|))$/) {
# given a non-ssl server, also kill stunnel based ssl piggybacking one
push @killservers, "${1}s${2}";
}
# assign requested address")
#
sub verifyhttp {
- my ($proto, $ipvnum, $idnum, $ip, $port_or_path) = @_;
+ my ($proto, $ipvnum, $idnum, $ip, $port) = @_;
my $server = servername_id($proto, $ipvnum, $idnum);
my $pid = 0;
my $bonus="";
- # $port_or_path contains a path for Unix sockets, sws ignores the port
- my $port = ($ipvnum eq "unix") ? 80 : $port_or_path;
my $verifyout = "$LOGDIR/".
servername_canon($proto, $ipvnum, $idnum) .'_verify.out';
$flags .= "--silent ";
$flags .= "--verbose ";
$flags .= "--globoff ";
- $flags .= "--unix-socket '$port_or_path' " if $ipvnum eq "unix";
$flags .= "-1 " if($has_axtls);
$flags .= "--insecure " if($proto eq 'https');
$flags .= "\"$proto://$ip:$port/${bonus}verifiedserver\"";
}
# Connect to sftp server, authenticate and run a remote pwd
# command using our generated configuration and key files
- my $cmd = "\"$sftp\" -b $sftpcmds -F $sftpconfig -S \"$ssh\" $ip > $sftplog 2>&1";
+ my $cmd = "$sftp -b $sftpcmds -F $sftpconfig -S $ssh $ip > $sftplog 2>&1";
my $res = runclient($cmd);
# Search for pwd command response in log file
if(open(SFTPLOGFILE, "<$sftplog")) {
# start the http server
#
sub runhttpserver {
- my ($proto, $verbose, $alt, $port_or_path) = @_;
+ my ($proto, $verbose, $alt, $port) = @_;
my $ip = $HOSTIP;
my $ipvnum = 4;
my $idnum = 1;
$exe = "python $srcdir/http_pipe.py";
$verbose_flag .= "1 ";
}
- elsif($alt eq "unix") {
- # IP (protocol) is mutually exclusive with Unix sockets
- $ipvnum = "unix";
- }
$server = servername_id($proto, $ipvnum, $idnum);
$flags .= $verbose_flag if($debugprotocol);
$flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
$flags .= "--id $idnum " if($idnum > 1);
- if($ipvnum eq "unix") {
- $flags .= "--unix-socket '$port_or_path' ";
- } else {
- $flags .= "--ipv$ipvnum --port $port_or_path ";
- }
- $flags .= "--srcdir \"$srcdir\"";
+ $flags .= "--ipv$ipvnum --port $port --srcdir \"$srcdir\"";
my $cmd = "$exe $flags";
my ($httppid, $pid2) = startnew($cmd, $pidfile, 15, 0);
}
# Server is up. Verify that we can speak to it.
- my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port_or_path);
+ my $pid3 = verifyserver($proto, $ipvnum, $idnum, $ip, $port);
if(!$pid3) {
logmsg "RUN: $srvrname server failed verification\n";
# failed to talk to it properly. Kill the server and return failure
$sshlog = server_logfilename($LOGDIR, 'socks', $ipvnum, $idnum);
# start our socks server
- my $cmd="\"$ssh\" -N -F $sshconfig $ip > $sshlog 2>&1";
+ my $cmd="$ssh -N -F $sshconfig $ip > $sshlog 2>&1";
my ($sshpid, $pid2) = startnew($cmd, $pidfile, 30, 1); # fake pidfile
if($sshpid <= 0 || !pidexists($sshpid)) {
# be used to verify that a server present in %run hash is still functional
#
sub responsive_http_server {
- my ($proto, $verbose, $alt, $port_or_path) = @_;
+ my ($proto, $verbose, $alt, $port) = @_;
my $ip = $HOSTIP;
my $ipvnum = 4;
my $idnum = 1;
elsif($alt eq "proxy") {
$idnum = 2;
}
- elsif($alt eq "unix") {
- # IP (protocol) is mutually exclusive with Unix sockets
- $ipvnum = "unix";
- }
- return &responsiveserver($proto, $ipvnum, $idnum, $ip, $port_or_path);
+ return &responsiveserver($proto, $ipvnum, $idnum, $ip, $port);
}
#######################################################################
}
#######################################################################
+# filter out the specified pattern from the given input file and store the
+# results in the given output file
+#
+sub filteroff {
+ my $infile=$_[0];
+ my $filter=$_[1];
+ my $ofile=$_[2];
+
+ open(IN, "<$infile")
+ || return 1;
+
+ open(OUT, ">$ofile")
+ || return 1;
+
+ # logmsg "FILTER: off $filter from $infile to $ofile\n";
+
+ while(<IN>) {
+ $_ =~ s/$filter//;
+ print OUT $_;
+ }
+ close(IN);
+ close(OUT);
+ return 0;
+}
+
+#######################################################################
# compare test results with the expected output, we might filter off
# some pattern that is allowed to differ, output test results
#
sub compare {
+ # filter off patterns _before_ this comparison!
my ($testnum, $testname, $subject, $firstref, $secondref)=@_;
my $result = compareparts($firstref, $secondref);
}
elsif ($libcurl =~ /openssl/i) {
$has_openssl=1;
- $has_sslpinning=1;
$ssllib="OpenSSL";
}
elsif ($libcurl =~ /gnutls/i) {
$has_gnutls=1;
- $has_sslpinning=1;
$ssllib="GnuTLS";
}
elsif ($libcurl =~ /nss/i) {
@protocols = split(' ', lc($1));
# Generate a "proto-ipv6" version of each protocol to match the
- # IPv6 <server> name and a "proto-unix" to match the variant which
- # uses Unix domain sockets. This works even if support isn't
+ # IPv6 <server> name. This works even if IPv6 support isn't
# compiled in because the <features> test will fail.
- push @protocols, map(("$_-ipv6", "$_-unix"), @protocols);
+ push @protocols, map($_ . '-ipv6', @protocols);
# 'http-proxy' is used in test cases to do CONNECT through
push @protocols, 'http-proxy';
if($feat =~ /IPv6/i) {
$has_ipv6 = 1;
}
- if($feat =~ /UnixSockets/i) {
- $has_unix = 1;
- }
if($feat =~ /libz/i) {
$has_libz = 1;
}
if($feat =~ /NTLM/i) {
# NTLM enabled
$has_ntlm=1;
-
- # Use this as a proxy for any cryptographic authentication
+ # Use this as a proxy for any cryptographic authentication
$has_crypto=1;
}
if($feat =~ /NTLM_WB/i) {
# SSPI enabled
$has_sspi=1;
}
- if($feat =~ /GSS-API/i) {
- # GSS-API enabled
- $has_gssapi=1;
- }
- if($feat =~ /Kerberos/i) {
- # Kerberos enabled
- $has_kerberos=1;
-
- # Use this as a proxy for any cryptographic authentication
- $has_crypto=1;
- }
- if($feat =~ /SPNEGO/i) {
- # SPNEGO enabled
- $has_spnego=1;
-
- # Use this as a proxy for any cryptographic authentication
- $has_crypto=1;
- }
if($feat =~ /CharConv/i) {
# CharConv enabled
$has_charconv=1;
$resolver="threaded";
}
}
- if($feat =~ /HTTP2/) {
- # http2 enabled
- $has_http2=1;
- }
}
#
# Test harness currently uses a non-stunnel server in order to
}
if($has_ipv6) {
- # client has IPv6 support
+ # client has ipv6 support
# check if the HTTP server has it!
my @sws = `server/sws --version`;
if($sws[0] =~ /IPv6/) {
- # HTTP server has IPv6 support!
+ # HTTP server has ipv6 support!
$http_ipv6 = 1;
$gopher_ipv6 = 1;
}
# check if the FTP server has it!
@sws = `server/sockfilt --version`;
if($sws[0] =~ /IPv6/) {
- # FTP server has IPv6 support!
+ # FTP server has ipv6 support!
$ftp_ipv6 = 1;
}
}
- if($has_unix) {
- # client has Unix sockets support, check whether the HTTP server has it
- my @sws = `server/sws --version`;
- $http_unix = 1 if($sws[0] =~ /unix/);
- }
-
if(!$has_memory_tracking && $torture) {
die "can't run torture tests since curl was built without ".
"TrackMemory feature (--enable-curldebug)";
logmsg sprintf(" track memory: %s\n", $has_memory_tracking?"ON ":"OFF");
logmsg sprintf("* valgrind: %8s", $valgrind?"ON ":"OFF");
logmsg sprintf(" HTTP IPv6 %s\n", $http_ipv6?"ON ":"OFF");
- logmsg sprintf("* HTTP Unix %s\n", $http_unix?"ON ":"OFF");
logmsg sprintf("* FTP IPv6 %8s", $ftp_ipv6?"ON ":"OFF");
logmsg sprintf(" Libtool lib: %s\n", $libtool?"ON ":"OFF");
logmsg sprintf("* Shared build: %-3s", $has_shared);
}
logmsg sprintf("* HTTP-PIPE/%d \n", $HTTPPIPEPORT);
- if($has_unix) {
- logmsg "* Unix socket paths:\n";
- if($http_unix) {
- logmsg sprintf("* HTTP-Unix:%s\n", $HTTPUNIXPATH);
- }
- }
-
$has_textaware = ($^O eq 'MSWin32') || ($^O eq 'msys');
logmsg "***************************************** \n";
$$thing =~ s/%TFTP6PORT/$TFTP6PORT/g;
$$thing =~ s/%TFTPPORT/$TFTPPORT/g;
- # server Unix domain socket paths
-
- $$thing =~ s/%HTTPUNIXPATH/$HTTPUNIXPATH/g;
-
# client IP addresses
$$thing =~ s/%CLIENT6IP/$CLIENT6IP/g;
$$thing =~ s/%FTPTIME2/$ftp2/g;
$$thing =~ s/%FTPTIME3/$ftp3/g;
-
- # HTTP2
-
- $$thing =~ s/%H2CVER/$h2cver/g;
}
sub fixarray {
$timeprepini{$testnum} = Time::HiRes::time() if($timestats);
if($disttests !~ /test$testnum\W/ ) {
- logmsg "Warning: test$testnum not present in tests/data/Makefile.inc\n";
+ logmsg "Warning: test$testnum not present in tests/data/Makefile.am\n";
}
if($disabled{$testnum}) {
logmsg "Warning: test$testnum is explicitly disabled\n";
next;
}
}
- elsif($1 eq "SSLpinning") {
- if($has_sslpinning) {
- next;
- }
- }
elsif($1 eq "OpenSSL") {
if($has_openssl) {
next;
next;
}
}
- elsif($1 eq "GSS-API") {
- if($has_gssapi) {
- next;
- }
- }
- elsif($1 eq "Kerberos") {
- if($has_kerberos) {
- next;
- }
- }
- elsif($1 eq "SPNEGO") {
- if($has_spnego) {
- next;
- }
- }
elsif($1 eq "getrlimit") {
if($has_getrlimit) {
next;
next;
}
}
- elsif($1 eq "http2") {
- if($has_http2) {
- next;
- }
- }
elsif($1 eq "socks") {
next;
}
- elsif($1 eq "unix-sockets") {
- next if $has_unix;
- }
# See if this "feature" is in the list of supported protocols
elsif (grep /^\Q$1\E$/i, @protocols) {
next;
next;
}
}
- elsif($1 eq "unix-sockets") {
- next if !$has_unix;
- }
elsif($1 eq "libz") {
if(!$has_libz) {
next;
next;
}
}
- elsif($1 eq "GSS-API") {
- if(!$has_gssapi) {
- next;
- }
- }
- elsif($1 eq "Kerberos") {
- if(!$has_kerberos) {
- next;
- }
- }
- elsif($1 eq "SPNEGO") {
- if(!$has_spnego) {
- next;
- }
- }
elsif($1 eq "getrlimit") {
if(!$has_getrlimit) {
next;
if(!$short) {
if($skipped{$why} <= 3) {
# show only the first three skips for each reason
- logmsg sprintf("test %04d SKIPPED: $why\n", $testnum);
+ logmsg sprintf("test %03d SKIPPED: $why\n", $testnum);
}
}
timestampskippedevents($testnum);
return -1;
}
- logmsg sprintf("test %04d...", $testnum) if(!$automakestyle);
+ logmsg sprintf("test %03d...", $testnum) if(!$automakestyle);
# extract the reply data
my @reply = getpart("reply", "data");
my @killservers;
foreach my $server (@killtestservers) {
chomp $server;
- if($server =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
+ if($server =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|))$/) {
# given a stunnel ssl server, also kill non-ssl underlying one
push @killservers, "${1}${2}";
}
- elsif($server =~ /^(ftp|http|imap|pop3|smtp)((\d*)(-ipv6|-unix|))$/) {
+ elsif($server =~ /^(ftp|http|imap|pop3|smtp)((\d*)(-ipv6|))$/) {
# given a non-ssl server, also kill stunnel piggybacking one
push @killservers, "${1}s${2}";
}
$what =~ s/[^a-z0-9-]//g;
my $certfile;
- if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
+ if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|))$/) {
$certfile = ($whatlist[1]) ? $whatlist[1] : 'stunnel.pem';
}
}
elsif($what eq "http-ipv6") {
if($torture && $run{'http-ipv6'} &&
- !responsive_http_server("http", $verbose, "ipv6", $HTTP6PORT)) {
+ !responsive_http_server("http", $verbose, "IPv6", $HTTP6PORT)) {
stopserver('http-ipv6');
}
if(!$run{'http-ipv6'}) {
}
elsif($what eq "rtsp-ipv6") {
if($torture && $run{'rtsp-ipv6'} &&
- !responsive_rtsp_server($verbose, "ipv6")) {
+ !responsive_rtsp_server($verbose, "IPv6")) {
stopserver('rtsp-ipv6');
}
if(!$run{'rtsp-ipv6'}) {
- ($pid, $pid2) = runrtspserver($verbose, "ipv6");
+ ($pid, $pid2) = runrtspserver($verbose, "IPv6");
if($pid <= 0) {
return "failed starting RTSP-IPv6 server";
}
return "no gnutls-serv";
}
if($torture && $run{'httptls-ipv6'} &&
- !responsive_httptls_server($verbose, "ipv6")) {
+ !responsive_httptls_server($verbose, "IPv6")) {
stopserver('httptls-ipv6');
}
if(!$run{'httptls-ipv6'}) {
- ($pid, $pid2) = runhttptlsserver($verbose, "ipv6");
+ ($pid, $pid2) = runhttptlsserver($verbose, "IPv6");
if($pid <= 0) {
return "failed starting HTTPTLS-IPv6 server (gnutls-serv)";
}
}
elsif($what eq "tftp-ipv6") {
if($torture && $run{'tftp-ipv6'} &&
- !responsive_tftp_server("", $verbose, "ipv6")) {
+ !responsive_tftp_server("", $verbose, "IPv6")) {
stopserver('tftp-ipv6');
}
if(!$run{'tftp-ipv6'}) {
- ($pid, $pid2) = runtftpserver("", $verbose, "ipv6");
+ ($pid, $pid2) = runtftpserver("", $verbose, "IPv6");
if($pid <= 0) {
return "failed starting TFTP-IPv6 server";
}
}
}
}
- elsif($what eq "http-unix") {
- if($torture && $run{'http-unix'} &&
- !responsive_http_server("http", $verbose, "unix", $HTTPUNIXPATH)) {
- stopserver('http-unix');
- }
- if(!$run{'http-unix'}) {
- ($pid, $pid2) = runhttpserver("http", $verbose, "unix",
- $HTTPUNIXPATH);
- if($pid <= 0) {
- return "failed starting HTTP-unix server";
- }
- logmsg sprintf("* pid http-unix => %d %d\n", $pid, $pid2)
- if($verbose);
- $run{'http-unix'}="$pid $pid2";
- }
- }
elsif($what eq "none") {
logmsg "* starts no server\n" if ($verbose);
}
if($c eq "#! /") {
# A shell script. This is typically when built with libtool,
$libtool = 1;
- $gdb = "../libtool --mode=execute gdb";
+ $gdb = "libtool --mode=execute gdb";
}
}
$HTTPTLS6PORT = $base++; # HTTP TLS (non-stunnel) IPv6 server port
$HTTPPROXYPORT = $base++; # HTTP proxy port, when using CONNECT
$HTTPPIPEPORT = $base++; # HTTP pipelining port
-$HTTPUNIXPATH = 'http.sock'; # HTTP server Unix domain socket path
#######################################################################
# clear and create logging directory:
}
#######################################################################
-# Fetch all disabled tests, if there are any
+# Fetch all disabled tests
#
-if(open(D, "<$TESTDIR/DISABLED")) {
- while(<D>) {
- if(/^ *\#/) {
- # allow comments
- next;
- }
- if($_ =~ /(\d+)/) {
- $disabled{$1}=$1; # disable this test number
- }
+open(D, "<$TESTDIR/DISABLED");
+while(<D>) {
+ if(/^ *\#/) {
+ # allow comments
+ next;
+ }
+ if($_ =~ /(\d+)/) {
+ $disabled{$1}=$1; # disable this test number
}
- close(D);
}
+close(D);
#######################################################################
# If 'all' tests are requested, find out all test numbers