]> granicus.if.org Git - curl/commitdiff
tests: enable HTTP/2 tests to run with non-default port numbers
authorDan Fandrich <dan@coneharvesters.com>
Mon, 27 Feb 2017 21:32:07 +0000 (22:32 +0100)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 27 Feb 2017 21:32:37 +0000 (22:32 +0100)
tests/http2-server.pl
tests/runtests.pl

index 72ed12e85a431008513a80aa746ff15746f601b6..086d5aa7629a45ac932e425107bf90c285264a58 100755 (executable)
@@ -28,6 +28,7 @@ my $pidfile = "log/nghttpx.pid";
 my $logfile = "log/http2.log";
 my $nghttpx = "nghttpx";
 my $listenport = 9015;
+my $connect = "127.0.0.1,8990";
 
 #***************************************************************************
 # Process command line options
@@ -54,6 +55,13 @@ while(@ARGV) {
             shift @ARGV;
         }
     }
+    elsif($ARGV[0] eq '--connect') {
+        if($ARGV[1]) {
+            $connect = $ARGV[1];
+            $connect =~ s/:/,/;
+            shift @ARGV;
+        }
+    }
     elsif($ARGV[0] eq '--logfile') {
         if($ARGV[1]) {
             $logfile = $ARGV[1];
@@ -66,7 +74,7 @@ while(@ARGV) {
     shift @ARGV;
 }
 
-my $cmdline="$nghttpx --backend=127.0.0.1,8990 ".
+my $cmdline="$nghttpx --backend=$connect ".
     "--frontend=\"*,$listenport;no-tls\" ".
     "--log-level=INFO ".
     "--pid-file=$pidfile ".
index 583ba3b7fd37ee4fe06b907a138d582142936305..0da5b8e772edf30a90828fa4b3c4aae49fa0a8c5 100755 (executable)
@@ -1227,6 +1227,7 @@ sub runhttp2server {
 
     $flags .= "--pidfile \"$pidfile\" --logfile \"$logfile\" ";
     $flags .= "--port $HTTP2PORT ";
+    $flags .= "--connect $HOSTIP:$HTTPPORT ";
     $flags .= $verbose_flag if($debugprotocol);
 
     my $cmd = "$exe $flags";