]> granicus.if.org Git - curl/commitdiff
runtests: support variables in <strippart>
authorDaniel Stenberg <daniel@haxx.se>
Tue, 12 Jun 2018 13:48:47 +0000 (15:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 12 Jun 2018 14:11:21 +0000 (16:11 +0200)
... and make use of that to make 1455 work better without using a fixed
local port number.

Fixes #2649
Closes #2650

tests/data/test1455
tests/runtests.pl

index 7768a1f899405c094af07889b65aa5c839479378..0b77dc4f5ea2b73eb970ad03e6ab88ee6539b574 100644 (file)
@@ -35,7 +35,7 @@ http
 HTTP GET when PROXY Protocol enabled
 </name>
 <command>
-http://%HOSTIP:%HTTPPORT/1455 --haproxy-protocol --local-port 37756
+http://%HOSTIP:%HTTPPORT/1455 --haproxy-protocol
 </command>
 </client>
 
@@ -45,8 +45,11 @@ http://%HOSTIP:%HTTPPORT/1455 --haproxy-protocol --local-port 37756
 <strip>
 ^User-Agent:.*
 </strip>
+<strippart>
+s/^PROXY TCP4 %CLIENTIP %HOSTIP (\d*) %HTTPPORT/proxy-line/
+</strippart>
 <protocol>
-PROXY TCP4 %CLIENTIP %HOSTIP 37756 %HTTPPORT\r
+proxy-line\r
 GET /1455 HTTP/1.1\r
 Host: %HOSTIP:%HTTPPORT\r
 Accept: */*\r
index 054c64bf336f8175b85dd48975a53cea581c60cd..92fb447a2a368469b445cedaf4f5a4bf0c6b5691 100755 (executable)
@@ -4349,9 +4349,11 @@ sub singletest {
         # what parts to cut off from the protocol
         my @strippart = getpart("verify", "strippart");
         my $strip;
+        @strippart = fixarray(@strippart);
         for $strip (@strippart) {
             chomp $strip;
             for(@out) {
+                print STDERR ":::: $strip\n";
                 eval $strip;
             }
         }