]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: fix the HTTP/2 tests
authorDaniel Stenberg <daniel@haxx.se>
Sun, 19 Jun 2016 21:52:01 +0000 (23:52 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 19 Jun 2016 21:59:52 +0000 (23:59 +0200)
The HTTP/2 tests brought with commit bf05606ef1f 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.

tests/FILEFORMAT
tests/data/test1700
tests/data/test1701
tests/data/test1702
tests/runtests.pl
tests/serverhelp.pm

index d8beb99f764daf90b42c905cce4f7f78e3b91cba..04a6daeb7d6b7fcee14433006532d95d6e9b85b5 100644 (file)
@@ -181,6 +181,7 @@ http-unix
 https
 httptls+srp
 httptls+srp-ipv6
+http/2
 imap
 none
 pop3
index 1549cb9144e97b97f52708e2e20c962d34983a69..9ab46c9cde26fca283608d9d38c1f464b2dba8e3 100644 (file)
@@ -40,7 +40,7 @@ Content-Type: text/html
 <client>
 <server>
 http
-http2
+http/2
 </server>
  <name>
 HTTP/2 GET with Upgrade:
index 621c82d823b5eb4769becef8225d43d26b6c46c7..494328877272ce19e252488bb146a6cff42de770 100644 (file)
@@ -31,7 +31,7 @@ Funny-head: yesyes
 <client>
 <server>
 http
-http2
+http/2
 </server>
  <name>
 HTTP/2 POST with Upgrade:
index cf7f26cd7c7b132dc2875dcbd6fef97bf567c1ab..903a737c9a72a541f35df2b433b599e25c42c192 100644 (file)
@@ -30,7 +30,7 @@ Funny-head: yesyes
 <client>
 <server>
 http
-http2
+http/2
 </server>
  <name>
 HTTP/2 HEAD with Upgrade:
index ddcda5c201de7a8c24415aa0a5dfdfbb1fd8bc88..b8497f9c20924c71899ec43630277f7f3fe24264 100755 (executable)
@@ -367,7 +367,7 @@ delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'});
 # 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/2')) {
     for my $ssl (('', 's')) {
       for my $ipvnum ((4, 6)) {
         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')) {
       my $serv = servername_id("$proto$ssl", "unix", 1);
       my $pidf = server_pidfilename("$proto$ssl", "unix", 1);
@@ -1200,7 +1200,7 @@ sub runhttp2server {
     my $pidfile;
     my $logfile;
     my $flags = "";
-    my $proto="http2";
+    my $proto="http/2";
     my $ipvnum = 4;
     my $idnum = 0;
     my $exe = "$perl $srcdir/http2-server.pl";
@@ -2543,7 +2543,7 @@ sub checksystem {
                 # http2 enabled
                 $has_http2=1;
 
-                push @protocols, 'http2';
+                push @protocols, 'http/2';
             }
         }
         #
@@ -3032,7 +3032,7 @@ sub singletest {
                     next;
                 }
             }
-            elsif($1 eq "http2") {
+            elsif($1 eq "http/2") {
                 if($has_http2) {
                     next;
                 }
@@ -4255,7 +4255,7 @@ sub startservers {
     for(@what) {
         my (@whatlist) = split(/\s+/,$_);
         my $what = lc($whatlist[0]);
-        $what =~ s/[^a-z0-9-]//g;
+        $what =~ s/[^a-z0-9\/-]//g;
 
         my $certfile;
         if($what =~ /^(ftp|http|imap|pop3|smtp)s((\d*)(-ipv6|-unix|))$/) {
@@ -4341,15 +4341,15 @@ sub startservers {
                 $run{'gopher-ipv6'}="$pid $pid2";
             }
         }
-        elsif($what eq "http2") {
-            if(!$run{'http2'}) {
+        elsif($what eq "http/2") {
+            if(!$run{'http/2'}) {
                 ($pid, $pid2) = runhttp2server($verbose, $HTTP2PORT);
                 if($pid <= 0) {
                     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);
-                $run{'http2'}="$pid $pid2";
+                $run{'http/2'}="$pid $pid2";
             }
         }
         elsif($what eq "http") {
index e5818bc16a38a32f3b28b6fa970923999c4d967c..d6a06508d6f2e3d0717220c7554584a643c3e9c8 100644 (file)
@@ -105,7 +105,7 @@ sub servername_str {
 
     $proto = uc($proto) if($proto);
     die "unsupported protocol: '$proto'" unless($proto &&
-        ($proto =~ /^(((FTP|HTTP|IMAP|POP3|SMTP|HTTP-PIPE)S?)|(TFTP|SFTP|SOCKS|SSH|RTSP|GOPHER|HTTPTLS|HTTP2))$/));
+        ($proto =~ /^(((FTP|HTTP|HTTP\/2|IMAP|POP3|SMTP|HTTP-PIPE)S?)|(TFTP|SFTP|SOCKS|SSH|RTSP|GOPHER|HTTPTLS))$/));
 
     $ipver = (not $ipver) ? 'ipv4' : lc($ipver);
     die "unsupported IP version: '$ipver'" unless($ipver &&
@@ -137,6 +137,7 @@ sub servername_canon {
     my ($proto, $ipver, $idnum) = @_;
     my $string = lc(servername_str($proto, $ipver, $idnum));
     $string =~ tr/-/_/;
+    $string =~ s/\//_v/;
     return $string;
 }