Lines Matching +full:srv +full:- +full:ipv6 +full:- +full:single +full:- +full:target

9 # Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
28 # $HOSTIP, $HOST6IP - Set to the address of the host running the test suite
29 # $CLIENTIP, $CLIENT6IP - Set to the address of the host running curl
30 # runclient, runclientoutput - Modify to copy all the files in the log/
49 # Finally, to properly support -g and -n, checktestcmd needs to change
52 # fixed. As long as the -g option is never given, and the -n is always
60 # usually set by the Makefile, but for out-of-tree builds with direct
132 my $NOLISTENPORT=47; # port number we use for a local non-listening service
135 my $HTTP6PORT=$noport; # HTTP IPv6 server port
137 my $HTTPSPROXYPORT = $noport; # HTTPS-proxy (stunnel) port
140 my $FTP6PORT=$noport; # FTP IPv6 server port
146 my $POP36PORT=$noport; # POP3 IPv6 server port
148 my $IMAP6PORT=$noport; # IMAP IPv6 server port
150 my $SMTP6PORT=$noport; # SMTP IPv6 server port
152 my $RTSP6PORT=$noport; # RTSP IPv6 server port
154 my $GOPHER6PORT=$noport; # Gopher IPv6 server port
155 my $HTTPTLSPORT=$noport; # HTTP TLS (non-stunnel) server port
156 my $HTTPTLS6PORT=$noport; # HTTP TLS (non-stunnel) IPv6 server port
185 my $CURLCONFIG="../curl-config"; # curl-config from current build
199 my $perl="perl -I$srcdir";
202 my $debug_build=0; # built debug enabled (--enable-debug)
203 my $has_memory_tracking=0; # built with memory tracking (--enable-curldebug)
221 my $valgrind_logfile="--logfile";
226 my $uname_release = `uname -r`;
232 my $http_ipv6; # set if HTTP server has IPv6 support
234 my $ftp_ipv6; # set if FTP server has IPv6 support
235 my $tftp_ipv6; # set if TFTP server has IPv6 support
236 my $gopher_ipv6; # set if Gopher server has IPv6 support
237 my $has_ipv6; # set if libcurl is built with IPv6 support
246 my $has_gssapi; # set if libcurl is built with a GSS-API library
250 my $has_tls_srp; # set if libcurl is built with TLS-SRP support
253 my $has_httpsproxy; # set if libcurl is built with HTTPS-proxy support
255 my $has_cares; # set if built with c-ares
258 my $has_altsvc; # set if libcurl is built with alt-svc support
261 my $has_manual; # set if curl is built with built-in manual
263 my $has_mingw; # set if curl is built with MinGW (as opposed to MinGW-w64)
268 my $has_openssl; # built with a lib using an OpenSSL-like API
307 my $fullstats; # show time stats for every single test
335 my $run_event_based; # run curl with --test-event to test the event API
481 return (-1,-1);
496 # Ugly hack but ssh client and gnutls-serv don't support pid files
510 return (-1,-1);
515 while($count--) {
516 if(-f $pidfile && -s $pidfile && open(PID, "<$pidfile")) {
532 # return (-1,-1);
557 if( -x "$_/$cmd" && ! -d "$_/$cmd") {
570 if(-f "../CMakeCache.txt") {
571 $makeCmd = 'cmake --build ../.. --target';
627 # memanalyze -v is our friend, get the number of allocations made
629 my @out = `$memanalyze -v $memdump`;
643 my $discard = scalar(@ttests) - $shallow;
653 $discard--;
666 # --shallow can undefine them
692 $valgrindcmd .= "--quiet --leak-check=yes ";
693 $valgrindcmd .= "--suppressions=$srcdir/valgrind.supp ";
694 # $valgrindcmd .= "--gen-suppressions=all ";
695 $valgrindcmd .= "--num-callers=16 ";
714 if(-r "core") {
725 logmsg "FAIL: torture $testnum - valgrind\n";
754 logmsg `$memanalyze -l $memdump`;
760 " invoke with \"-t$limit\" to repeat this single case.\n";
780 if($server =~ /^(ftp|imap|pop3|smtp)s?(\d*)(-ipv6|)$/) {
790 if($server =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
791 # given a stunnel based ssl server, also kill non-ssl underlying one
794 elsif($server =~ /^(ftp|http|imap|pop3|smtp)((\d*)(-ipv6|-unix|))$/) {
795 # given a non-ssl server, also kill stunnel based ssl piggybacking one
798 elsif($server =~ /^(socks)((\d*)(-ipv6|))$/) {
802 elsif($server =~ /^(ssh)((\d*)(-ipv6|))$/) {
835 unlink($pidfile) if(-f $pidfile);
855 unlink($verifyout) if(-f $verifyout);
859 unlink($verifylog) if(-f $verifylog);
866 my $flags = "--max-time $server_response_maxtime ";
867 $flags .= "--output $verifyout ";
868 $flags .= "--silent ";
869 $flags .= "--verbose ";
870 $flags .= "--globoff ";
871 $flags .= "--unix-socket '$port_or_path' " if $ipvnum eq "unix";
872 $flags .= "--insecure " if($proto eq 'https');
884 return -1;
912 return -1;
916 return -1;
936 unlink($verifylog) if(-f $verifylog);
939 $extra .= "--insecure --ftp-ssl-control ";
942 my $flags = "--max-time $server_response_maxtime ";
943 $flags .= "--silent ";
944 $flags .= "--verbose ";
945 $flags .= "--globoff ";
958 return -1;
975 my $took = int(0.5+time()-$time);
998 unlink($verifyout) if(-f $verifyout);
1002 unlink($verifylog) if(-f $verifylog);
1004 my $flags = "--max-time $server_response_maxtime ";
1005 $flags .= "--output $verifyout ";
1006 $flags .= "--silent ";
1007 $flags .= "--verbose ";
1008 $flags .= "--globoff ";
1021 return -1;
1049 return -1;
1053 return -1;
1079 $pid = -1;
1097 return -1;
1103 return -1;
1107 my $cmd = "\"$sftp\" -b $sftpcmds -F $sftpconfig -S \"$ssh\" $ip > $sftplog 2>&1";
1123 # Verify that the non-stunnel HTTP TLS extensions capable server that runs
1136 unlink($verifyout) if(-f $verifyout);
1140 unlink($verifylog) if(-f $verifylog);
1142 my $flags = "--max-time $server_response_maxtime ";
1143 $flags .= "--output $verifyout ";
1144 $flags .= "--verbose ";
1145 $flags .= "--globoff ";
1146 $flags .= "--insecure ";
1147 $flags .= "--tlsauthtype SRP ";
1148 $flags .= "--tlsuser jsmith ";
1149 $flags .= "--tlspassword abc ";
1161 return -1;
1192 $pid = -1;
1200 return -1;
1204 return -1;
1228 $pid = -1;
1249 unlink($verifylog) if(-f $verifylog);
1251 my $flags = "--max-time $server_response_maxtime ";
1252 $flags .= "--silent ";
1253 $flags .= "--verbose ";
1254 $flags .= "--globoff ";
1255 $flags .= "-u 'curltest:curltest' ";
1268 return -1;
1285 my $took = int(0.5+time()-$time);
1310 unlink($verifylog) if(-f $verifylog);
1312 my $flags = "--max-time $server_response_maxtime ";
1313 $flags .= "--silent ";
1314 $flags .= "--verbose ";
1315 $flags .= "--globoff ";
1316 $flags .= "--upload-file - ";
1329 return -1;
1346 my $took = int(0.5+time()-$time);
1365 # and 'httptls' is used for non-stunnel https test servers.
1391 while($count--) {
1409 # Single shot server responsiveness test. This should only be used
1443 my $exe = "$perl $srcdir/http2-server.pl";
1444 my $verbose_flag = "--verbose ";
1459 unlink($pidfile) if(-f $pidfile);
1465 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
1466 $flags .= "--connect $HOSTIP:$HTTPPORT ";
1473 my $aflags = "--port $port $flags";
1512 my $verbose_flag = "--verbose ";
1514 if($alt eq "ipv6") {
1515 # if IPv6, use a different setup
1542 unlink($pidfile) if(-f $pidfile);
1548 $flags .= "--gopher " if($proto eq "gopher");
1549 $flags .= "--connect $HOSTIP " if($alt eq "proxy");
1551 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
1552 $flags .= "--portfile $portfile ";
1553 $flags .= "--id $idnum " if($idnum > 1);
1555 $flags .= "--unix-socket '$port_or_path' ";
1557 $flags .= "--ipv$ipvnum --port 0 ";
1559 $flags .= "--srcdir \"$srcdir\"";
1602 my ($verbose, $ipv6, $proxy, $certfile) = @_;
1604 my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
1605 my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
1614 # the https-proxy runs as https2
1635 unlink($pidfile) if(-f $pidfile);
1643 $flags .= "--verbose " if($debugprotocol);
1644 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
1645 $flags .= "--id $idnum " if($idnum > 1);
1646 $flags .= "--ipv$ipvnum --proto $proto ";
1647 $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
1648 $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" ";
1650 $flags .= "--connect $HTTPPORT";
1653 # for HTTPS-proxy we connect to the HTTP proxy
1654 $flags .= "--connect $HTTPPROXYPORT";
1663 my $options = "$flags --accept $port";
1689 # start the non-stunnel HTTP TLS extensions capable server
1692 my ($verbose, $ipv6) = @_;
1694 my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
1695 my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
1720 unlink($pidfile) if(-f $pidfile);
1726 $flags .= "--http ";
1727 $flags .= "--debug 1 " if($debugprotocol);
1728 $flags .= "--priority NORMAL:+SRP ";
1729 $flags .= "--srppasswd $srcdir/certs/srp-verifier-db ";
1730 $flags .= "--srppasswdconf $srcdir/certs/srp-verifier-conf";
1736 my $allflags = "--port $port $flags";
1764 my ($proto, $id, $verbose, $ipv6) = @_;
1766 my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
1767 my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
1789 unlink($pidfile) if(-f $pidfile);
1795 $flags .= "--verbose " if($debugprotocol);
1796 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
1797 $flags .= "--portfile \"$portfile\" ";
1798 $flags .= "--srcdir \"$srcdir\" --proto $proto ";
1799 $flags .= "--id $idnum " if($idnum > 1);
1800 $flags .= "--ipv$ipvnum --port 0 --addr \"$ip\"";
1837 # if IPv6, use a different setup
1880 my ($verbose, $ipv6, $certfile) = @_;
1882 my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
1883 my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
1908 unlink($pidfile) if(-f $pidfile);
1916 $flags .= "--verbose " if($debugprotocol);
1917 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
1918 $flags .= "--id $idnum " if($idnum > 1);
1919 $flags .= "--ipv$ipvnum --proto $proto ";
1920 $flags .= "--certfile \"$certfile\" " if($certfile ne 'stunnel.pem');
1921 $flags .= "--stunnel \"$stunnel\" --srcdir \"$srcdir\" ";
1922 $flags .= "--connect $FTPPORT";
1930 my $options = "$flags --accept $port";
1961 my ($id, $verbose, $ipv6) = @_;
1972 if($ipv6) {
1973 # if IPv6, use a different setup
1992 unlink($pidfile) if(-f $pidfile);
1998 $flags .= "--verbose " if($debugprotocol);
1999 $flags .= "--pidfile \"$pidfile\" ".
2000 "--portfile \"$portfile\" ".
2001 "--logfile \"$logfile\" ";
2002 $flags .= "--id $idnum " if($idnum > 1);
2003 $flags .= "--ipv$ipvnum --port 0 --srcdir \"$srcdir\"";
2043 my ($verbose, $ipv6) = @_;
2054 if($ipv6) {
2055 # if IPv6, use a different setup
2074 unlink($pidfile) if(-f $pidfile);
2080 $flags .= "--verbose " if($debugprotocol);
2081 $flags .= "--pidfile \"$pidfile\" ".
2082 "--portfile \"$portfile\" ".
2083 "--logfile \"$logfile\" ";
2084 $flags .= "--id $idnum " if($idnum > 1);
2085 $flags .= "--ipv$ipvnum --port 0 --srcdir \"$srcdir\"";
2125 my ($id, $verbose, $ipv6) = @_;
2154 unlink($pidfile) if(-f $pidfile);
2161 $flags .= "--verbose " if($verbose);
2162 $flags .= "--debugprotocol " if($debugprotocol);
2163 $flags .= "--pidfile \"$pidfile\" ";
2164 $flags .= "--id $idnum " if($idnum > 1);
2165 $flags .= "--ipv$ipvnum --addr \"$ip\" ";
2166 $flags .= "--user \"$USER\"";
2181 my $options = "$flags --sshport $port";
2235 ($SSHSRVMD5 !~ /^[a-f0-9]{32}$/i))
2252 my ($id, $verbose, $ipv6) = @_;
2278 unlink($pidfile) if(-f $pidfile);
2284 # start our MQTT server - on a random port!
2285 my $cmd="server/mqttd".exe_ext('SRV').
2286 " --port 0 ".
2287 " --pidfile $pidfile".
2288 " --portfile $portfile".
2289 " --config $FTPDCMD";
2313 my ($id, $verbose, $ipv6) = @_;
2338 unlink($pidfile) if(-f $pidfile);
2345 my $cmd="server/socksd".exe_ext('SRV').
2346 " --port 0 ".
2347 " --pidfile $pidfile".
2348 " --portfile $portfile".
2349 " --backend $HOSTIP".
2350 " --config $FTPDCMD";
2385 if($alt eq "ipv6") {
2386 # No IPv6
2402 unlink($pidfile) if(-f $pidfile);
2408 $flags .= "--verbose 1 " if($debugprotocol);
2409 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
2410 $flags .= "--id $idnum " if($idnum > 1);
2411 $flags .= "--srcdir \"$srcdir\" ";
2412 $flags .= "--host $HOSTIP";
2418 my $aflags = "--port $port $flags";
2457 if($alt eq "ipv6") {
2458 # No IPv6
2474 unlink($pidfile) if(-f $pidfile);
2480 $flags .= "--verbose 1 " if($debugprotocol);
2481 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
2482 $flags .= "--id $idnum " if($idnum > 1);
2483 $flags .= "--srcdir \"$srcdir\" ";
2484 $flags .= "--host $HOSTIP";
2490 my $aflags = "--port $port $flags";
2529 if($alt eq "ipv6") {
2530 # No IPv6
2546 unlink($pidfile) if(-f $pidfile);
2552 $flags .= "--verbose 1 " if($debugprotocol);
2553 $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
2554 $flags .= "--id $idnum " if($idnum > 1);
2555 $flags .= "--srcdir \"$srcdir\"";
2561 my $aflags = "--port $port $flags";
2587 # Single shot http and gopher server responsiveness test. This should only
2596 if($alt eq "ipv6") {
2597 # if IPv6, use a different setup
2613 # Single shot pingpong server responsiveness test. This should only be
2617 my ($proto, $id, $verbose, $ipv6) = @_;
2619 my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
2620 my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
2627 # if IPv6, use a different setup
2649 # Single shot rtsp server responsiveness test. This should only be
2653 my ($verbose, $ipv6) = @_;
2660 if($ipv6) {
2661 # if IPv6, use a different setup
2671 # Single shot tftp server responsiveness test. This should only be
2675 my ($id, $verbose, $ipv6) = @_;
2682 if($ipv6) {
2683 # if IPv6, use a different setup
2693 # Single shot non-stunnel HTTP TLS extensions capable server
2698 my ($verbose, $ipv6) = @_;
2700 my $port = ($ipv6 && ($ipv6 =~ /6$/)) ? $HTTPTLS6PORT : $HTTPTLSPORT;
2701 my $ip = ($ipv6 && ($ipv6 =~ /6$/)) ? "$HOST6IP" : "$HOSTIP";
2702 my $ipvnum = ($ipv6 && ($ipv6 =~ /6$/)) ? 6 : 4;
2721 if(-d "$dir/$file") {
2757 logmsg "FAIL: $testnum - $testname - $subject\n";
2764 $feature{"alt-svc"} = $has_altsvc;
2770 $feature{"GSS-API"} = $has_gssapi;
2772 $feature{"https-proxy"} = $has_httpsproxy;
2774 $feature{"ipv6"} = $has_ipv6;
2794 $feature{"threaded-resolver"} = $has_threadedres;
2795 $feature{"TLS-SRP"} = $has_tls_srp;
2798 $feature{"unix-sockets"} = $has_unix;
2813 $feature{"HTTP-auth"} = 1;
2818 $feature{"shuffle-dns"} = 1;
2820 $feature{"verbose-strings"} = 1;
2842 my $versioncmd="$CURL --version 1>$curlverout 2>$curlvererr";
2878 # Win32-style path.
2882 $has_mingw = 1 if ($curl =~ /-pc-mingw32/);
2922 $resolver="c-ares";
2932 # Generate a "proto-ipv6" version of each protocol to match the
2933 # IPv6 <server> name and a "proto-unix" to match the variant which
2936 push @protocols, map(("$_-ipv6", "$_-unix"), @protocols);
2938 # 'http-proxy' is used in test cases to do CONNECT through
2939 push @protocols, 'http-proxy';
2947 # built with memory tracking support (--enable-curldebug)
2951 # curl was built with --enable-debug
2970 if($feat =~ /IPv6/i) {
3000 if($feat =~ /GSS-API/i) {
3001 # GSS-API enabled
3022 if($feat =~ /TLS-SRP/i) {
3023 # TLS-SRP enabled
3034 if($feat =~ /alt-svc/i) {
3035 # alt-svc enabled
3051 if($feat =~ /HTTPS-proxy/) {
3054 # 'https-proxy' is used as "server" so consider it a protocol
3055 push @protocols, 'https-proxy';
3059 # Test harness currently uses a non-stunnel server in order to
3060 # run HTTP TLS-SRP tests required when curl is built with https
3061 # protocol support and TLS-SRP feature enabled. For convenience
3069 if($_ =~ /^https(-ipv6|)$/) {
3076 push @protocols, 'httptls-ipv6';
3084 if ($versretval == -1) {
3102 if(-r "../lib/curl_config.h") {
3113 # client has IPv6 support
3116 my $cmd = "server/sws".exe_ext('SRV')." --version";
3118 if($sws[0] =~ /IPv6/) {
3119 # HTTP server has IPv6 support!
3125 $cmd = "server/sockfilt".exe_ext('SRV')." --version";
3127 if($sws[0] =~ /IPv6/) {
3128 # FTP server has IPv6 support!
3135 my $cmd = "server/sws".exe_ext('SRV')." --version";
3142 "TrackMemory feature (--enable-curldebug)";
3145 open(M, "$CURL -M 2>&1|");
3147 if($s =~ /built-in manual was disabled at build-time/) {
3156 $has_shared = `sh $CURLCONFIG --built-shared`;
3160 my $hosttype=join(' ', runclientoutput("uname -a"));
3180 logmsg sprintf("%s", $http_ipv6?"HTTP-IPv6 ":"");
3181 logmsg sprintf("%s", $http_unix?"HTTP-unix ":"");
3182 logmsg sprintf("%s\n", $ftp_ipv6?"FTP-IPv6 ":"");
3185 $run_event_based?"event-based ":"");
3193 logmsg sprintf("* HTTP-Unix:%s\n", $HTTPUNIXPATH);
3273 if ($sshdid && $sshdid =~ /OpenSSH-Windows/) {
3285 # used for time-out tests and that would work on most hosts as these
3305 $d =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
3314 $d =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
3320 $d =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
3336 # Provide time stamps for single test skipped events
3386 # Run a single specified test case
3530 unlink($FTPDCMD) if(-f $FTPDCMD);
3643 return -1;
3752 $cmd="-";
3758 # create (possibly-empty) files before starting the test
3767 return -1;
3786 if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-output/)) {
3787 #We may slap on --output!
3789 ($cmdhash{'option'} && $cmdhash{'option'} =~ /force-output/)) {
3790 $out=" --output $CURLOUT ";
3831 if((!$cmdhash{'option'}) || ($cmdhash{'option'} !~ /no-include/)) {
3832 $inc = " --include";
3836 if($cmdhash{'option'} && ($cmdhash{'option'} =~ /binary-trace/)) {
3837 $cmdargs .= "--trace log/trace$testnum ";
3840 $cmdargs .= "--trace-ascii log/trace$testnum ";
3842 $cmdargs .= "--trace-time ";
3844 $cmdargs .= "--test-event ";
3845 $fail_due_event_based--;
3865 if(! -f $CMDLINE) {
3868 return -1;
3876 # with --db-attach=yes or --vgdb=yes.
3882 return -1;
3888 my $stdinfile="$LOGDIR/stdin-for-$testnum";
3912 $valgrindcmd .= "--quiet --leak-check=yes ";
3913 $valgrindcmd .= "--suppressions=$srcdir/valgrind.supp ";
3914 # $valgrindcmd .= "--gen-suppressions=all ";
3915 $valgrindcmd .= "--num-callers=16 ";
3941 print GDBCMD "source $gdbinit\n" if -e $gdbinit;
3952 "$gdb --directory $LIBDIR $DBGCURL -x $LOGDIR/gdbcmd");
3955 my $GDBW = ($gdbxwin) ? "-w" : "";
3956 runclient("$gdb --directory $LIBDIR $DBGCURL $GDBW -x $LOGDIR/gdbcmd");
3977 if(-r "core") {
3986 logmsg "running gdb for post-mortem analysis:\n";
3990 runclient("$gdb --directory libtest -x $LOGDIR/gdbcmd2 -batch $DBGCURL core ");
4003 while((-f $SERVERLOGS_LOCK) && $lockretry--) {
4017 # gnutls-serv also lacks this synchronization mechanism, so gnutls-serv
4102 # variable-replace in the stdout we have from the test case file
4129 $ok .= "-"; # stdout not checked
4153 # variable-replace in the stderr we have from the test case file
4180 $ok .= "-"; # stderr not checked
4235 $ok .= "-"; # protocol not checked
4248 $ok .= "-"; # data not checked
4272 $ok .= "-"; # upload not checked
4320 $ok .= "-"; # protocol not checked
4337 return -1;
4377 $ok .= ($outputok) ? "o" : "-"; # output checked or not
4379 # accept multiple comma-separated error codes
4405 if(! -f $memdump) {
4432 $ok .= "-"; # memory not checked
4461 logmsg "FAIL: $testnum - $testname - valgrind\n";
4477 $ok .= "-"; # skipped
4481 $ok .= "-"; # valgrind not checked
4483 # add 'E' for event-based
4484 $ok .= $evbased ? "E" : "-";
4491 my $sofar= time()-$start;
4493 my $estleft = $esttotal - $sofar;
4497 my $took = $timevrfyend{$testnum} - $timeprepini{$testnum};
4501 logmsg sprintf("OK (%-3d out of %-3d, %s, took %.3fs, %s)\n",
4505 logmsg "PASS: $testnum - $testname\n";
4557 unlink($pidfile) if(-f $pidfile);
4572 $what =~ s/[^a-z0-9\/-]//g;
4575 if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
4596 elsif($what eq "ftp-ipv6") {
4597 if($torture && $run{'ftp-ipv6'} &&
4598 !responsive_pingpong_server("ftp", "", $verbose, "ipv6")) {
4599 stopserver('ftp-ipv6');
4601 if(!$run{'ftp-ipv6'}) {
4602 ($pid, $pid2) = runpingpongserver("ftp", "", $verbose, "ipv6");
4604 return "failed starting FTP-IPv6 server";
4606 logmsg sprintf("* pid ftp-ipv6 => %d %d\n", $pid,
4608 $run{'ftp-ipv6'}="$pid $pid2";
4627 elsif($what eq "gopher-ipv6") {
4628 if($torture && $run{'gopher-ipv6'} &&
4629 !responsive_http_server("gopher", $verbose, "ipv6",
4631 stopserver('gopher-ipv6');
4633 if(!$run{'gopher-ipv6'}) {
4635 runhttpserver("gopher", $verbose, "ipv6");
4637 return "failed starting GOPHER-IPv6 server";
4639 logmsg sprintf("* pid gopher-ipv6 => %d %d\n", $pid,
4641 $run{'gopher-ipv6'}="$pid $pid2";
4671 elsif($what eq "http-proxy") {
4672 if($torture && $run{'http-proxy'} &&
4675 stopserver('http-proxy');
4677 if(!$run{'http-proxy'}) {
4681 return "failed starting HTTP-proxy server";
4683 logmsg sprintf ("* pid http-proxy => %d %d\n", $pid, $pid2)
4685 $run{'http-proxy'}="$pid $pid2";
4688 elsif($what eq "http-ipv6") {
4689 if($torture && $run{'http-ipv6'} &&
4690 !responsive_http_server("http", $verbose, "ipv6", $HTTP6PORT)) {
4691 stopserver('http-ipv6');
4693 if(!$run{'http-ipv6'}) {
4695 runhttpserver("http", $verbose, "ipv6");
4697 return "failed starting HTTP-IPv6 server";
4699 logmsg sprintf("* pid http-ipv6 => %d %d\n", $pid, $pid2)
4701 $run{'http-ipv6'}="$pid $pid2";
4718 elsif($what eq "rtsp-ipv6") {
4719 if($torture && $run{'rtsp-ipv6'} &&
4720 !responsive_rtsp_server($verbose, "ipv6")) {
4721 stopserver('rtsp-ipv6');
4723 if(!$run{'rtsp-ipv6'}) {
4724 ($pid, $pid2, $RTSP6PORT) = runrtspserver($verbose, "ipv6");
4726 return "failed starting RTSP-IPv6 server";
4728 logmsg sprintf("* pid rtsp-ipv6 => %d %d\n", $pid, $pid2)
4730 $run{'rtsp-ipv6'}="$pid $pid2";
4801 elsif($what eq "https-proxy") {
4803 # we can't run https-proxy tests without stunnel
4806 if($runcert{'https-proxy'} &&
4807 ($runcert{'https-proxy'} ne $certfile)) {
4809 stopserver('https-proxy');
4812 # we front the http-proxy with stunnel so we need to make sure the
4814 my $f = startservers("http-proxy");
4819 if(!$run{'https-proxy'}) {
4823 return "failed starting HTTPS-proxy (stunnel)";
4825 logmsg sprintf("* pid https-proxy => %d %d\n", $pid, $pid2)
4827 $run{'https-proxy'}="$pid $pid2";
4832 # for now, we can't run http TLS-EXT tests without gnutls-serv
4833 return "no gnutls-serv";
4843 return "failed starting HTTPTLS server (gnutls-serv)";
4850 elsif($what eq "httptls-ipv6") {
4852 # for now, we can't run http TLS-EXT tests without gnutls-serv
4853 return "no gnutls-serv";
4855 if($torture && $run{'httptls-ipv6'} &&
4856 !responsive_httptls_server($verbose, "ipv6")) {
4857 stopserver('httptls-ipv6');
4859 if(!$run{'httptls-ipv6'}) {
4861 runhttptlsserver($verbose, "ipv6");
4863 return "failed starting HTTPTLS-IPv6 server (gnutls-serv)";
4865 logmsg sprintf("* pid httptls-ipv6 => %d %d\n", $pid, $pid2)
4867 $run{'httptls-ipv6'}="$pid $pid2";
4885 elsif($what eq "tftp-ipv6") {
4886 if($torture && $run{'tftp-ipv6'} &&
4887 !responsive_tftp_server("", $verbose, "ipv6")) {
4888 stopserver('tftp-ipv6');
4890 if(!$run{'tftp-ipv6'}) {
4892 runtftpserver("", $verbose, "ipv6");
4894 return "failed starting TFTP-IPv6 server";
4896 printf("* pid tftp-ipv6 => %d %d\n", $pid, $pid2) if($verbose);
4897 $run{'tftp-ipv6'}="$pid $pid2";
4930 elsif($what eq "http-unix") {
4931 if($torture && $run{'http-unix'} &&
4933 stopserver('http-unix');
4935 if(!$run{'http-unix'}) {
4940 return "failed starting HTTP-unix server";
4942 logmsg sprintf("* pid http-unix => %d %d\n", $pid, $pid2)
4944 $run{'http-unix'}="$pid $pid2";
4994 # specified test case. This is a useful design when we run single tests as not
5009 for(my $i = scalar(@what) - 1; $i >= 0; $i--) {
5016 if($server =~ /^(httptls)(\+)(ext|srp)(\d*)(-ipv6|)$/) {
5018 $tlsext = uc("TLS-${3}");
5038 # runtimestats displays test-suite run time statistics
5063 $timesrvrtot += $timesrvrend{$testnum} - $timesrvrini{$testnum};
5065 (($timetoolini{$testnum} - $timeprepini{$testnum}) -
5066 ($timesrvrend{$testnum} - $timesrvrini{$testnum}));
5067 $timetooltot += $timetoolend{$testnum} - $timetoolini{$testnum};
5068 $timelocktot += $timesrvrlog{$testnum} - $timetoolend{$testnum};
5069 $timevrfytot += $timevrfyend{$testnum} - $timesrvrlog{$testnum};
5070 $timetesttot += $timevrfyend{$testnum} - $timeprepini{$testnum};
5072 $timesrvrend{$testnum} - $timesrvrini{$testnum}, $testnum);
5074 ($timetoolini{$testnum} - $timeprepini{$testnum}) -
5075 ($timesrvrend{$testnum} - $timesrvrini{$testnum}), $testnum);
5077 $timetoolend{$testnum} - $timetoolini{$testnum}, $testnum);
5079 $timesrvrlog{$testnum} - $timetoolend{$testnum}, $testnum);
5081 $timevrfyend{$testnum} - $timesrvrlog{$testnum}, $testnum);
5083 $timevrfyend{$testnum} - $timeprepini{$testnum}, $testnum);
5113 logmsg "-time- test\n";
5114 logmsg "------ ----\n";
5116 last if((not $fullstats) && (not $counter--));
5123 logmsg "-time- test\n";
5124 logmsg "------ ----\n";
5126 last if((not $fullstats) && (not $counter--));
5133 logmsg "-time- test\n";
5134 logmsg "------ ----\n";
5136 last if((not $fullstats) && (not $counter--));
5143 logmsg "-time- test\n";
5144 logmsg "------ ----\n";
5146 last if((not $fullstats) && (not $counter--));
5153 logmsg "-time- test\n";
5154 logmsg "------ ----\n";
5156 last if((not $fullstats) && (not $counter--));
5163 logmsg "-time- test\n";
5164 logmsg "------ ----\n";
5166 last if((not $fullstats) && (not $counter--));
5185 if(@ARGV && $ARGV[-1] eq '$TFLAGS') {
5191 my $fromnum=-1;
5194 if ($ARGV[0] eq "-v") {
5198 elsif ($ARGV[0] eq "-c") {
5203 elsif ($ARGV[0] eq "-vc") {
5213 elsif ($ARGV[0] eq "-d") {
5217 elsif($ARGV[0] eq "-e") {
5221 elsif ($ARGV[0] eq "-g") {
5225 elsif ($ARGV[0] eq "-gw") {
5230 elsif($ARGV[0] eq "-s") {
5234 elsif($ARGV[0] eq "-am") {
5235 # automake-style output
5239 elsif($ARGV[0] eq "-n") {
5243 elsif ($ARGV[0] eq "-R") {
5247 elsif($ARGV[0] =~ /^-t(.*)/) {
5256 elsif($ARGV[0] =~ /--shallow=(\d+)/) {
5262 elsif($ARGV[0] =~ /--repeat=(\d+)/) {
5263 # Repeat-run the given tests this many times
5266 elsif($ARGV[0] =~ /--seed=(\d+)/) {
5267 # Set a fixed random seed (used for -R and --shallow)
5270 elsif($ARGV[0] eq "-a") {
5274 elsif($ARGV[0] eq "-p") {
5277 elsif($ARGV[0] eq "-l") {
5281 elsif($ARGV[0] eq "-k") {
5285 elsif($ARGV[0] eq "-r") {
5299 elsif($ARGV[0] eq "-rf") {
5313 elsif(($ARGV[0] eq "-h") || ($ARGV[0] eq "--help")) {
5317 -a continue even if a test fails
5318 -am automake style output PASS/FAIL: [number] [name]
5319 -c path use this curl executable
5320 -d display server debug info
5321 -e event-based execution
5322 -g run the test case with gdb
5323 -gw run the test case with gdb as a windowed application
5324 -h this help text
5325 -k keep stdout and stderr files present after tests
5326 -l list all test case names/descriptions
5327 -n no valgrind
5328 -p print log file contents when a test fails
5329 -R scrambled order (uses the random seed, see --seed)
5330 -r run time statistics
5331 -rf full run time statistics
5332 -s short output
5333 --seed=[num] set the random seed to a fixed number
5334 --shallow=[num] randomly makes the torture tests "thinner"
5335 -t[N] torture (simulate function failures); N means fail Nth function
5336 -v verbose output
5337 -vc path use this curl only to verify the existing servers
5341 [keyword] like "IPv6" to select only tests containing the key word
5363 $fromnum = -1;
5373 $fromnum = -1;
5377 $fromnum = -1;
5386 elsif($ARGV[0] =~ /^([-[{a-zA-Z].*)/) {
5401 open(C, "$CURL --version 2>/dev/null|");
5425 # since valgrind 2.1.x, '--tool' option is mandatory
5427 runclient("valgrind --help 2>&1 | grep -- --tool > /dev/null 2>&1");
5429 $valgrind_tool="--tool=memcheck";
5435 $valgrind="../libtool --mode=execute $valgrind";
5439 # valgrind 3 renamed the --logfile option to --log-file!!!
5440 my $ver=join(' ', runclientoutput("valgrind --version"));
5442 $ver =~ s/[^0-9.]//g;
5447 $valgrind_logfile="--log-file";
5462 $gdb = "../libtool --mode=execute gdb";
5506 if(! -f "$srcdir/data/test$n") {
5507 print STDERR "WARNING! Non-existing test $n in DISABLED!\n";
5524 my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR);
5531 $_ =~ s/[a-z\/\.]*//g;
5549 if (-e "$TESTDIR/test$_") {
5588 if(open(SINGLE, "<$file")) {
5592 while(my $string = <SINGLE>) {
5613 $tailskip = $tailtotal - $tailshow;
5616 for($tailskip .. $tailtotal-1) {
5620 close(SINGLE);
5642 if((-d "$LOGDIR/$log") || (! -s "$LOGDIR/$log")) {
5691 # The main test-loop
5745 logmsg "\n - abort tests\n";
5756 my $sofar = time() - $start;
5813 logmsg " and ".($c-$max)." more";