Commit 5f2e3b88 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

tests: fix the HTTP/2 tests

The HTTP/2 tests brought with commit bf05606e were using the internal
name 'http2' for the HTTP/2 server, while in fact that name was already
used for the second instance of the HTTP server. This made tests using
the second instance (like test 2050) fail after a HTTP/2 test had run.

The server is now known as HTTP/2 internally and within the <server>
section in test cases. 1700, 1701 and 1702 were updated accordingly.
parent bb4e7921
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -181,6 +181,7 @@ http-unix
https
https
httptls+srp
httptls+srp
httptls+srp-ipv6
httptls+srp-ipv6
http/2
imap
imap
none
none
pop3
pop3
+1 −1
Original line number Original line Diff line number Diff line
@@ -40,7 +40,7 @@ Content-Type: text/html
<client>
<client>
<server>
<server>
http
http
http2
http/2
</server>
</server>
 <name>
 <name>
HTTP/2 GET with Upgrade:
HTTP/2 GET with Upgrade:
+1 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ Funny-head: yesyes
<client>
<client>
<server>
<server>
http
http
http2
http/2
</server>
</server>
 <name>
 <name>
HTTP/2 POST with Upgrade:
HTTP/2 POST with Upgrade:
+1 −1
Original line number Original line Diff line number Diff line
@@ -30,7 +30,7 @@ Funny-head: yesyes
<client>
<client>
<server>
<server>
http
http
http2
http/2
</server>
</server>
 <name>
 <name>
HTTP/2 HEAD with Upgrade:
HTTP/2 HEAD with Upgrade:
+10 −10
Original line number Original line Diff line number Diff line
@@ -367,7 +367,7 @@ delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'});
# Load serverpidfile hash with pidfile names for all possible servers.
# Load serverpidfile hash with pidfile names for all possible servers.
#
#
sub init_serverpidfile_hash {
sub init_serverpidfile_hash {
  for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp')) {
  for my $proto (('ftp', 'http', 'imap', 'pop3', 'smtp', 'http/2')) {
    for my $ssl (('', 's')) {
    for my $ssl (('', 's')) {
      for my $ipvnum ((4, 6)) {
      for my $ipvnum ((4, 6)) {
        for my $idnum ((1, 2, 3)) {
        for my $idnum ((1, 2, 3)) {
@@ -387,7 +387,7 @@ sub init_serverpidfile_hash {
      }
      }
    }
    }
  }
  }
  for my $proto (('http', 'imap', 'pop3', 'smtp')) {
  for my $proto (('http', 'imap', 'pop3', 'smtp', 'http/2')) {
    for my $ssl (('', 's')) {
    for my $ssl (('', 's')) {
      my $serv = servername_id("$proto$ssl", "unix", 1);
      my $serv = servername_id("$proto$ssl", "unix", 1);
      my $pidf = server_pidfilename("$proto$ssl", "unix", 1);
      my $pidf = server_pidfilename("$proto$ssl", "unix", 1);
@@ -1200,7 +1200,7 @@ sub runhttp2server {
    my $pidfile;
    my $pidfile;
    my $logfile;
    my $logfile;
    my $flags = "";
    my $flags = "";
    my $proto="http2";
    my $proto="http/2";
    my $ipvnum = 4;
    my $ipvnum = 4;
    my $idnum = 0;
    my $idnum = 0;
    my $exe = "$perl $srcdir/http2-server.pl";
    my $exe = "$perl $srcdir/http2-server.pl";
@@ -2543,7 +2543,7 @@ sub checksystem {
                # http2 enabled
                # http2 enabled
                $has_http2=1;
                $has_http2=1;


                push @protocols, 'http2';
                push @protocols, 'http/2';
            }
            }
        }
        }
        #
        #
@@ -3032,7 +3032,7 @@ sub singletest {
                    next;
                    next;
                }
                }
            }
            }
            elsif($1 eq "http2") {
            elsif($1 eq "http/2") {
                if($has_http2) {
                if($has_http2) {
                    next;
                    next;
                }
                }
@@ -4255,7 +4255,7 @@ sub startservers {
    for(@what) {
    for(@what) {
        my (@whatlist) = split(/\s+/,$_);
        my (@whatlist) = split(/\s+/,$_);
        my $what = lc($whatlist[0]);
        my $what = lc($whatlist[0]);
        $what =~ s/[^a-z0-9-]//g;
        $what =~ s/[^a-z0-9\/-]//g;


        my $certfile;
        my $certfile;
        if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
        if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
@@ -4341,15 +4341,15 @@ sub startservers {
                $run{'gopher-ipv6'}="$pid $pid2";
                $run{'gopher-ipv6'}="$pid $pid2";
            }
            }
        }
        }
        elsif($what eq "http2") {
        elsif($what eq "http/2") {
            if(!$run{'http2'}) {
            if(!$run{'http/2'}) {
                ($pid, $pid2) = runhttp2server($verbose, $HTTP2PORT);
                ($pid, $pid2) = runhttp2server($verbose, $HTTP2PORT);
                if($pid <= 0) {
                if($pid <= 0) {
                    return "failed starting HTTP/2 server";
                    return "failed starting HTTP/2 server";
                }
                }
                logmsg sprintf ("* pid http => %d %d\n", $pid, $pid2)
                logmsg sprintf ("* pid http/2 => %d %d\n", $pid, $pid2)
                    if($verbose);
                    if($verbose);
                $run{'http2'}="$pid $pid2";
                $run{'http/2'}="$pid $pid2";
            }
            }
        }
        }
        elsif($what eq "http") {
        elsif($what eq "http") {
Loading