Newer
Older
elsif($_ =~ /^Features: (.*)/i) {
if($feat =~ /debug/i) {
# debug is a listed "feature", use that knowledge
$curl_debug = 1;
# set the NETRC debug env
$ENV{'CURL_DEBUG_NETRC'} = 'log/netrc';
}
if($feat =~ /SSL/i) {
# ssl enabled
$ssl_version=1;
}
if($feat =~ /Largefile/i) {
# large file support
$large_file=1;
}
Daniel Stenberg
committed
if($feat =~ /IDN/i) {
# IDN support
$has_idn=1;
}
if($feat =~ /libz/i) {
$has_libz = 1;
}
Daniel Stenberg
committed
if($feat =~ /NTLM/i) {
# NTLM enabled
$has_ntlm=1;
}
}
}
if(!$curl) {
logmsg "unable to get curl's version! further details are:\n";
logmsg "issued command: \n";
logmsg "$versioncmd \n";
if ($versretval == -1) {
logmsg "command failed with: \n";
logmsg "$versnoexec \n";
}
elsif ($versretval & 127) {
logmsg sprintf("command died with signal %d, and %s coredump.\n",
($versretval & 127), ($versretval & 128)?"a":"no");
}
else {
logmsg sprintf("command exited with value %d \n", $versretval >> 8);
}
logmsg "contents of $curlverout: \n";
displaylogcontent("$curlverout");
logmsg "contents of $curlvererr: \n";
displaylogcontent("$curlvererr");
die "couldn't get curl's version!";
}
if(-r "../lib/config.h") {
open(CONF, "<../lib/config.h");
while(<CONF>) {
if($_ =~ /^\#define HAVE_GETRLIMIT/) {
$has_getrlimit = 1;
}
}
close(CONF);
}
Daniel Stenberg
committed
# 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_ipv6 = 1;
}
Daniel Stenberg
committed
# check if the FTP server has it!
@sws = `server/sockfilt --version`;
Daniel Stenberg
committed
if($sws[0] =~ /IPv6/) {
# FTP server has ipv6 support!
$ftp_ipv6 = 1;
}
if(!$curl_debug && $torture) {
die "can't run torture tests since curl was not build with debug";
}
my $hostname=`hostname`;
my $hosttype=`uname -a`;
logmsg ("********* System characteristics ******** \n",
"* $curl\n",
"* $libcurl\n",
"* System: $hosttype");
logmsg sprintf("* Server SSL: %s\n", $stunnel?"ON":"OFF");
logmsg sprintf("* libcurl SSL: %s\n", $ssl_version?"ON":"OFF");
logmsg sprintf("* libcurl debug: %s\n", $curl_debug?"ON":"OFF");
logmsg sprintf("* valgrind: %s\n", $valgrind?"ON":"OFF");
logmsg sprintf("* HTTP IPv6 %s\n", $http_ipv6?"ON":"OFF");
logmsg sprintf("* FTP IPv6 %s\n", $ftp_ipv6?"ON":"OFF");
logmsg sprintf("* HTTP port: %d\n", $HTTPPORT);
logmsg sprintf("* FTP port: %d\n", $FTPPORT);
logmsg sprintf("* FTP port 2: %d\n", $FTP2PORT);
Daniel Stenberg
committed
if($stunnel) {
#logmsg sprintf("* FTPS port: %d\n", $FTPSPORT);
logmsg sprintf("* HTTPS port: %d\n", $HTTPSPORT);
logmsg sprintf("* HTTP IPv6 port: %d\n", $HTTP6PORT);
Daniel Stenberg
committed
}
Daniel Stenberg
committed
if($ftp_ipv6) {
logmsg sprintf("* FTP IPv6 port: %d\n", $FTP6PORT);
Daniel Stenberg
committed
}
logmsg sprintf("* TFTP port: %d\n", $TFTPPORT);
if($tftp_ipv6) {
logmsg sprintf("* TFTP IPv6 port: %d\n", $TFTP6PORT);
}
if($ssl_version) {
logmsg sprintf("* SSL library: %s\n",
$has_gnutls?"GnuTLS":($has_openssl?"OpenSSL":"<unknown>"));
}
$has_textaware = ($^O eq 'MSWin32') || ($^O eq 'msys');
logmsg sprintf("* Libtool lib: %s\n", $libtool?"ON":"OFF");
logmsg "***************************************** \n";
#######################################################################
# substitute the variable stuff into either a joined up file or
# a command, in either case passed by reference
#
sub subVariables {
my ($thing) = @_;
$$thing =~ s/%HOSTIP/$HOSTIP/g;
Daniel Stenberg
committed
$$thing =~ s/%HTTPPORT/$HTTPPORT/g;
$$thing =~ s/%HOST6IP/$HOST6IP/g;
$$thing =~ s/%HTTP6PORT/$HTTP6PORT/g;
$$thing =~ s/%HTTPSPORT/$HTTPSPORT/g;
$$thing =~ s/%FTPPORT/$FTPPORT/g;
Daniel Stenberg
committed
$$thing =~ s/%FTP6PORT/$FTP6PORT/g;
Daniel Stenberg
committed
$$thing =~ s/%FTP2PORT/$FTP2PORT/g;
$$thing =~ s/%FTPSPORT/$FTPSPORT/g;
$$thing =~ s/%SRCDIR/$srcdir/g;
$$thing =~ s/%PWD/$pwd/g;
$$thing =~ s/%TFTPPORT/$TFTPPORT/g;
$$thing =~ s/%TFTP6PORT/$TFTP6PORT/g;
Daniel Stenberg
committed
# The purpose of FTPTIME2 and FTPTIME3 is to provide times that can be
# used for time-out tests and that whould work on most hosts as these
# adjust for the startup/check time for this particular host. We needed
# to do this to make the test suite run better on very slow hosts.
my $ftp2 = $ftpchecktime * 2;
my $ftp3 = $ftpchecktime * 3;
$$thing =~ s/%FTPTIME2/$ftp2/g;
$$thing =~ s/%FTPTIME3/$ftp3/g;
Daniel Stenberg
committed
sub fixarray {
my @in = @_;
for(@in) {
subVariables \$_;
}
return @in;
}
#######################################################################
# Run a single specified test case
#
my ($testnum, $count, $total)=@_;
my @what;
my $why;
Daniel Stenberg
committed
my %feature;
Daniel Stenberg
committed
my $cmd;
# load the test case file definition
if(loadtest("${TESTDIR}/test${testnum}")) {
if($verbose) {
# this is not a test
logmsg "RUN: $testnum doesn't look like a test case!\n";
Daniel Stenberg
committed
$why = "no test";
}
else {
@what = getpart("client", "features");
for(@what) {
my $f = $_;
$f =~ s/\s//g;
Daniel Stenberg
committed
$feature{$f}=$f; # we require this feature
if($f eq "SSL") {
if($ssl_version) {
next;
}
}
elsif($f eq "OpenSSL") {
if($has_openssl) {
next;
}
}
elsif($f eq "GnuTLS") {
if($has_gnutls) {
next;
}
}
elsif($f eq "netrc_debug") {
if($curl_debug) {
next;
}
}
elsif($f eq "large_file") {
if($large_file) {
next;
}
}
Daniel Stenberg
committed
elsif($f eq "idn") {
if($has_idn) {
next;
}
}
elsif($f eq "ipv6") {
if($has_ipv6) {
next;
}
}
elsif($f eq "libz") {
if($has_libz) {
next;
}
}
Daniel Stenberg
committed
elsif($f eq "NTLM") {
if($has_ntlm) {
next;
}
}
elsif($f eq "getrlimit") {
if($has_getrlimit) {
next;
}
}
Daniel Stenberg
committed
$why = "curl lacks $f support";
last;
}
Daniel Stenberg
committed
if(!$why) {
$why = serverfortest($testnum);
}
Daniel Stenberg
committed
if(!$why) {
Daniel Stenberg
committed
my @precheck = getpart("client", "precheck");
Daniel Stenberg
committed
$cmd = $precheck[0];
Daniel Stenberg
committed
chomp $cmd;
if($cmd) {
my @o = `$cmd 2>/dev/null`;
Daniel Stenberg
committed
if($o[0]) {
$why = $o[0];
chomp $why;
}
logmsg "prechecked $cmd\n" if($verbose);
Daniel Stenberg
committed
}
}
Daniel Stenberg
committed
if($why) {
# there's a problem, count it as "skipped"
$skipped++;
$skipped{$why}++;
$teststat[$testnum]=$why; # store reason for this test case
if(!$short) {
Daniel Stenberg
committed
printf "test %03d SKIPPED: $why\n", $testnum;
}
return -1;
}
logmsg sprintf("test %03d...", $testnum);
# extract the reply data
my @reply = getpart("reply", "data");
my @replycheck = getpart("reply", "datacheck");
if (@replycheck) {
# we use this file instead to check the final output against
my %hash = getpartattr("reply", "datacheck");
if($hash{'nonewline'}) {
# Yes, we must cut off the final newline from the final line
# of the datacheck
chomp($replycheck[$#replycheck]);
}
Daniel Stenberg
committed
my @curlcmd= fixarray ( getpart("client", "command") );
# this is the valid protocol blurb curl should generate
Daniel Stenberg
committed
my @protocol= fixarray ( getpart("verify", "protocol") );
# redirected stdout/stderr to these files
$STDOUT="$LOGDIR/stdout$testnum";
$STDERR="$LOGDIR/stderr$testnum";
# if this section exists, we verify that the stdout contained this:
Daniel Stenberg
committed
my @validstdout = fixarray ( getpart("verify", "stdout") );
# if this section exists, we verify upload
my @upload = getpart("verify", "upload");
# if this section exists, it might be FTP server instructions:
my @ftpservercmd = getpart("reply", "servercmd");
my $CURLOUT="$LOGDIR/curl$testnum.out"; # curl output if not stdout
my @testname= getpart("client", "name");
if(!$short) {
my $name = $testname[0];
$name =~ s/\n//g;
logmsg "[$name]\n";
}
if($listonly) {
return 0; # look successful
}
my @codepieces = getpart("client", "tool");
my $tool="";
if(@codepieces) {
$tool = $codepieces[0];
chomp $tool;
}
Daniel Stenberg
committed
# remove server output logfiles
Daniel Stenberg
committed
unlink($SERVER2IN);
if(@ftpservercmd) {
# write the instructions to file
writearray($FTPDCMD, \@ftpservercmd);
}
my (@setenv)= getpart("client", "setenv");
my @envs;
my $s;
for $s (@setenv) {
chomp $s; # cut off the newline
subVariables \$s;
if($s =~ /([^=]*)=(.*)/) {
my ($var, $content)=($1, $2);
$ENV{$var}=$content;
# remember which, so that we can clear them afterwards!
push @envs, $var;
}
}
Daniel Stenberg
committed
my @blaha;
($cmd, @blaha)= getpart("client", "command");
# make some nice replace operations
$cmd =~ s/\n//g; # no newlines please
if($curl_debug) {
unlink($memdump);
}
my @inputfile=getpart("client", "file");
if(@inputfile) {
# we need to generate a file before this test is invoked
Daniel Stenberg
committed
my %fileattr = getpartattr("client", "file");
Daniel Stenberg
committed
my $filename=$fileattr{'name'};
logmsg "ERROR: section client=>file has no name attribute!\n";
my $fileContent = join('', @inputfile);
subVariables \$fileContent;
# logmsg "DEBUG: writing file " . $filename . "\n";
open OUTFILE, ">$filename";
binmode OUTFILE; # for crapage systems, use binary
print OUTFILE $fileContent;
my %cmdhash = getpartattr("client", "command");
if($cmdhash{'option'} !~ /no-output/) {
#We may slap on --output!
$out=" --output $CURLOUT ";
my $cmdargs;
if(!$tool) {
# run curl, add -v for debug information output
$cmdargs ="$out --include -v --trace-time $cmd";
}
else {
$cmdargs = " $cmd"; # $cmd is the command line for the test file
$CURLOUT = $STDOUT; # sends received data to stdout
}
my @stdintest = getpart("client", "stdin");
if(@stdintest) {
my $stdinfile="$LOGDIR/stdin-for-$testnum";
writearray($stdinfile, \@stdintest);
$cmdargs .= " <$stdinfile";
if(!$tool) {
$CMDLINE="$CURL";
else {
$CMDLINE="$LIBDIR/$tool";
if(! -f $CMDLINE) {
print "The tool set in the test case for this: '$tool' does not exist\n";
return -1;
}
if($valgrind) {
Daniel Stenberg
committed
$CMDLINE = "valgrind ".$valgrind_tool."--leak-check=yes --num-callers=16 ${valgrind_logfile}=log/valgrind$testnum $CMDLINE";
}
logmsg "$CMDLINE\n";
Daniel Stenberg
committed
}
print CMDLOG "$CMDLINE\n";
Daniel Stenberg
committed
unlink("core");
my $dumped_core;
my $cmdres;
my @precommand= getpart("client", "precommand");
if($precommand[0]) {
# this is pure perl to eval!
my $code = join("", @precommand);
eval $code;
if($@) {
logmsg "perl: $code\n";
logmsg "precommand: $@";
stopalltestservers();
if($gdbthis) {
open(GDBCMD, ">log/gdbcmd");
print GDBCMD "set args $cmdargs\n";
print GDBCMD "show args\n";
close(GDBCMD);
}
# run the command line we built
if ($torture) {
Daniel Stenberg
committed
return torture($CMDLINE,
"$gdb --directory libtest $DBGCURL -x log/gdbcmd");
}
elsif($gdbthis) {
system("$gdb --directory libtest $DBGCURL -x log/gdbcmd");
$cmdres=0; # makes it always continue after a debugged run
$cmdres = system("$CMDLINE");
my $signal_num = $cmdres & 127;
Daniel Stenberg
committed
$dumped_core = $cmdres & 128;
if(!$anyway && ($signal_num || $dumped_core)) {
$cmdres = 1000;
}
else {
$cmdres /= 256;
}
Daniel Stenberg
committed
if(!$dumped_core) {
if(-r "core") {
# there's core file present now!
$dumped_core = 1;
}
}
if($dumped_core) {
logmsg "core dumped!\n";
logmsg "running gdb for post-mortem analysis:\n";
Daniel Stenberg
committed
open(GDBCMD, ">log/gdbcmd2");
print GDBCMD "bt\n";
close(GDBCMD);
system("$gdb --directory libtest -x log/gdbcmd2 -batch $DBGCURL core ");
Daniel Stenberg
committed
# unlink("log/gdbcmd2");
}
}
# remove the special FTP command file after each test!
unlink($FTPDCMD);
my $e;
for $e (@envs) {
$ENV{$e}=""; # clean up
}
my @err = getpart("verify", "errorcode");
my $errorcode = $err[0] || "0";
my $ok="";
my $res;
if (@validstdout) {
# verify redirected stdout
my @actual = loadarray($STDOUT);
# get all attributes
my %hash = getpartattr("verify", "stdout");
# get the mode attribute
my $filemode=$hash{'mode'};
if(($filemode eq "text") && $has_textaware) {
# text mode when running on windows: fix line endings
map s/\r\n/\n/g, @actual;
}
$res = compare("stdout", \@actual, \@validstdout);
return 1;
}
$ok .= "s";
}
else {
$ok .= "-"; # stdout not checked
my %replyattr = getpartattr("reply", "data");
Daniel Stenberg
committed
if(!$replyattr{'nocheck'} && (@reply || $replyattr{'sendzero'})) {
# verify the received data
my @out = loadarray($CURLOUT);
my %hash = getpartattr("reply", "data");
# get the mode attribute
my $filemode=$hash{'mode'};
if(($filemode eq "text") && $has_textaware) {
# text mode when running on windows: fix line endings
map s/\r\n/\n/g, @out;
}
$res = compare("data", \@out, \@reply);
return 1;
}
$ok .= "d";
}
else {
$ok .= "-"; # data not checked
if(@upload) {
# verify uploaded data
my @out = loadarray("$LOGDIR/upload.$testnum");
$res = compare("upload", \@out, \@upload);
}
$ok .= "u";
}
else {
$ok .= "-"; # upload not checked
Daniel Stenberg
committed
my @out;
my $retry = 5;
# Verify the sent request. Sometimes, like in test 513 on some hosts,
# curl will return back faster than the server writes down the request
# to its file, so we might need to wait here for a while to see if the
# file gets written a bit later.
while($retry--) {
@out = loadarray($SERVERIN);
if(!$out[0]) {
# nothing there yet, wait a while and try again
sleep(1);
}
}
# what to cut off from the live protocol sent by curl
my @strip = getpart("verify", "strip");
# check if there's any attributes on the verify/protocol section
my %hash = getpartattr("verify", "protocol");
if($hash{'nonewline'}) {
# Yes, we must cut off the final newline from the final line
# of the protocol data
chomp($protstrip[$#protstrip]);
}
Daniel Stenberg
committed
# strip off all lines that match the patterns from both arrays
@out = striparray( $_, \@out);
@protstrip= striparray( $_, \@protstrip);
}
# what parts to cut off from the protocol
my @strippart = getpart("verify", "strippart");
my $strip;
for $strip (@strippart) {
chomp $strip;
for(@out) {
eval $strip;
}
}
$res = compare("protocol", \@out, \@protstrip);
if($res) {
return 1;
}
$ok .= "p";
}
else {
$ok .= "-"; # protocol not checked
}
my @outfile=getpart("verify", "file");
if(@outfile) {
# we're supposed to verify a dynamicly generated file!
my %hash = getpartattr("verify", "file");
my $filename=$hash{'name'};
if(!$filename) {
logmsg "ERROR: section verify=>file has no name attribute!\n";
stopalltestservers();
}
my @generated=loadarray($filename);
Daniel Stenberg
committed
# what parts to cut off from the file
my @stripfile = getpart("verify", "stripfile");
my $filemode=$hash{'mode'};
if(($filemode eq "text") && $has_textaware) {
# text mode when running on windows means adding an extra
# strip expression
push @stripfile, "s/\r\n/\n/";
}
Daniel Stenberg
committed
my $strip;
for $strip (@stripfile) {
chomp $strip;
for(@generated) {
eval $strip;
}
}
$res = compare("output", \@generated, \@outfile);
if($res) {
return 1;
}
$ok .= "o";
}
else {
$ok .= "-"; # output not checked
# accept multiple comma-separated error codes
my @splerr = split(/ *, */, $errorcode);
my $errok;
foreach $e (@splerr) {
if($e == $cmdres) {
# a fine error code
$errok = 1;
last;
}
}
if($errok) {
$ok .= "e";
Daniel Stenberg
committed
}
else {
if(!$short) {
printf "\ncurl returned $cmdres, %s was expected\n", $errorcode;
}
logmsg " exit FAILED\n";
Daniel Stenberg
committed
return 1;
}
@what = getpart("client", "killserver");
for(@what) {
my $serv = $_;
chomp $serv;
if($run{$serv}) {
logmsg "RUN: Stopping the $serv server\n";
stoptestserver($serv);
logmsg "RUN: The $serv server is not running\n";
if($curl_debug) {
if(! -f $memdump) {
logmsg "\n** ALERT! memory debuggin without any output file?\n";
}
else {
my @memdata=`$memanalyze $memdump`;
my $leak=0;
for(@memdata) {
if($_ ne "") {
# well it could be other memory problems as well, but
# we call it leak for short here
$leak=1;
}
}
if($leak) {
logmsg "\n** MEMORY FAILURE\n";
logmsg @memdata;
return 1;
}
else {
$ok .= "m";
Daniel Stenberg
committed
}
else {
$ok .= "-"; # memory not checked
}
Daniel Stenberg
committed
if($valgrind) {
Daniel Stenberg
committed
# this is the valid protocol blurb curl should generate
my @disable= getpart("verify", "valgrind");
if($disable[0] !~ /disable/) {
opendir(DIR, "log") ||
return 0; # can't open log dir
my @files = readdir(DIR);
closedir DIR;
my $f;
my $l;
foreach $f (@files) {
if($f =~ /^valgrind$testnum\.pid/) {
$l = $f;
last;
Daniel Stenberg
committed
}
Daniel Stenberg
committed
}
my $src=$ENV{'srcdir'};
if(!$src) {
$src=".";
}
my @e = valgrindparse($src, $feature{'SSL'}, "log/$l");
if($e[0]) {
logmsg " valgrind ERROR ";
logmsg @e;
Daniel Stenberg
committed
return 1;
}
$ok .= "v";
Daniel Stenberg
committed
}
Daniel Stenberg
committed
else {
if(!$short) {
logmsg " valgrind SKIPPED";
Daniel Stenberg
committed
}
$ok .= "-"; # skipped
Daniel Stenberg
committed
}
else {
$ok .= "-"; # valgrind not checked
logmsg "$ok " if(!$short);
my $sofar= time()-$start;
my $esttotal = $sofar/$count * $total;
my $estleft = $esttotal - $sofar;
Daniel Stenberg
committed
my $left=sprintf("remaining: %02d:%02d",
$estleft/60,
$estleft%60);
Daniel Stenberg
committed
printf "OK (%-3d out of %-3d, %s)\n", $count, $total, $left;
Daniel Stenberg
committed
# the test succeeded, remove all log files
if(!$keepoutfiles) {
cleardir($LOGDIR);
}
unlink($FTPDCMD); # remove the instructions for this test
#######################################################################
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
# Stop all processes, including slave processes, of all the running test
# servers. Wait for them to finish and unlink its pidfiles. If they were
# not running or have been successfully stopped return 1. If unable to
# stop any of them then return 0. In any case the running servers hash
# is completely cleared for all test servers.
#
sub stopalltestservers {
my $ret = 1; # assume success stopping them
my $pid;
my $pidfile;
my $pidfiles = "";
my $pidsrunning = "";
for my $serv (keys %run) {
if($run{$serv}) {
if($run{$serv}{'slavepidfiles'}) {
for $pidfile (split(" ", $run{$serv}{'slavepidfiles'})) {
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
if($pid > 0) {
$pidsrunning .= " $pid";
}
}
delete $run{$serv}{'slavepidfiles'};
}
if($run{$serv}{'pidfile'}) {
$pidfile = $run{$serv}{'pidfile'};
$pidfiles .= " $pidfile";
$pid = checkalivepidfile($pidfile);
if($pid > 0) {
$pidsrunning .= " $pid";
}
delete $run{$serv}{'pidfile'};
}
if($run{$serv}{'pids'}) {
$pid = $run{$serv}{'pids'};
$pidsrunning .= " $pid";
delete $run{$serv}{'pids'};
}
if($run{$serv}) {
delete $run{$serv};
Daniel Stenberg
committed
}
if($pidsrunning) {
$ret = stopprocess($pidsrunning);
}
if($pidfiles) {
unlinkpidfiles($pidfiles);
}
return $ret;
}
#######################################################################
# startservers() starts all the named servers
#
Daniel Stenberg
committed
# Returns: string with error reason or blank for success
sub startservers {
my @what = @_;
Daniel Stenberg
committed
my ($pid, $pid2);
for(@what) {
my $what = lc($_);
if($what eq "ftp") {
if(!$run{'ftp'}) {
Daniel Stenberg
committed
($pid, $pid2) = runftpserver("", $verbose);
if($pid <= 0) {
Daniel Stenberg
committed
return "failed starting FTP server";
Daniel Stenberg
committed
}
printf ("* pid ftp => %d %d\n", $pid, $pid2) if($verbose);
Daniel Stenberg
committed
elsif($what eq "ftp2") {
if(!$run{'ftp2'}) {
Daniel Stenberg
committed
($pid, $pid2) = runftpserver("2", $verbose);
Daniel Stenberg
committed
if($pid <= 0) {
return "failed starting FTP2 server";
}
printf ("* pid ftp2 => %d %d\n", $pid, $pid2) if($verbose);
Daniel Stenberg
committed
}
}
Daniel Stenberg
committed
elsif($what eq "ftp-ipv6") {
if(!$run{'ftp-ipv6'}) {
Daniel Stenberg
committed
($pid, $pid2) = runftpserver("", $verbose, "ipv6");
Daniel Stenberg
committed
if($pid <= 0) {
return "failed starting FTP-IPv6 server";
Daniel Stenberg
committed
}
logmsg sprintf("* pid ftp-ipv6 => %d %d\n", $pid,
Daniel Stenberg
committed
$pid2) if($verbose);
Daniel Stenberg
committed
}
}
elsif($what eq "http") {
if(!$run{'http'}) {
Daniel Stenberg
committed
($pid, $pid2) = runhttpserver($verbose);
if($pid <= 0) {
Daniel Stenberg
committed
return "failed starting HTTP server";
printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose);
elsif($what eq "http-ipv6") {
if(!$run{'http-ipv6'}) {
Daniel Stenberg
committed
($pid, $pid2) = runhttpserver($verbose, "IPv6");
return "failed starting HTTP-IPv6 server";
logmsg sprintf("* pid http-ipv6 => %d %d\n", $pid, $pid2)
Daniel Stenberg
committed
if($verbose);
# we can't run ftps tests at all for the moment
return "test suite lacks FTPS support";
elsif($what eq "file") {
# we support it but have no server!
}
elsif($what eq "https") {
if(!$stunnel) {
# we can't run ftps tests without stunnel
return "no stunnel";
# we can't run ftps tests if libcurl is SSL-less
return "curl lacks SSL support";
}
if(!$run{'http'}) {
Daniel Stenberg
committed
($pid, $pid2) = runhttpserver($verbose);
if($pid <= 0) {
Daniel Stenberg
committed
return "failed starting HTTP server";
Daniel Stenberg
committed
}
printf ("* pid http => %d %d\n", $pid, $pid2) if($verbose);
Daniel Stenberg
committed
($pid, $pid2) = runhttpsserver($verbose);
if($pid <= 0) {
Daniel Stenberg
committed
return "failed starting HTTPS server (stunnel)";
}
logmsg sprintf("* pid https => %d %d\n", $pid, $pid2)
Daniel Stenberg
committed
if($verbose);
elsif($what eq "tftp") {
if(!$run{'tftp'}) {
($pid, $pid2) = runtftpserver("", $verbose);
if($pid <= 0) {
return "failed starting TFTP server";
}
printf ("* pid tftp => %d %d\n", $pid, $pid2) if($verbose);
}
}
elsif($what eq "tftp-ipv6") {
if(!$run{'tftp-ipv6'}) {
($pid, $pid2) = runtftpserver("", $verbose, "IPv6");
if($pid <= 0) {
return "failed starting TFTP-IPv6 server";
}
printf("* pid tftp-ipv6 => %d %d\n", $pid, $pid2) if($verbose);
}
}
logmsg "* starts no server\n" if ($verbose);
else {
warn "we don't support a server for $what";
Daniel Stenberg
committed
return "no server for $what";
return 0;
}