about summary refs log tree commit homepage
path: root/t/httpd.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-07 23:05:13 -1000
committerEric Wong <e@80x24.org>2021-02-08 22:07:43 +0000
commit860169adcd29341142b7c4a369c09b4ac492bd1e (patch)
treef08dcf8bd04efaeb0904a6cec40665c107482cac /t/httpd.t
parentfb6aa4da304125a3fb7932e1335be85ff260e031 (diff)
downloadpublic-inbox-860169adcd29341142b7c4a369c09b4ac492bd1e.tar.gz
IPv4 gets plenty of real-world coverage, and apparently there's
Debian buildd hosts which lack IPv4(*).  So ensure everything
can work on IPv6 and not cause problems for odd setups.

(*) https://bugs.debian.org/979432
Diffstat (limited to 't/httpd.t')
-rw-r--r--t/httpd.t8
1 files changed, 3 insertions, 5 deletions
diff --git a/t/httpd.t b/t/httpd.t
index 2fc28355..af9fbfeb 100644
--- a/t/httpd.t
+++ b/t/httpd.t
@@ -44,11 +44,9 @@ EOF
                 $im->add($mime);
                 $im->done($mime);
         }
-        ok($sock, 'sock created');
         $cmd = [ '-httpd', '-W0', "--stdout=$out", "--stderr=$err" ];
         $td = start_script($cmd, undef, { 3 => $sock });
-        my $host = $sock->sockhost;
-        my $port = $sock->sockport;
+        my $http_pfx = 'http://'.tcp_host_port($sock);
         {
                 my $bad = tcp_connect($sock);
                 print $bad "GETT / HTTP/1.0\r\n\r\n" or die;
@@ -65,7 +63,7 @@ EOF
         }
 
         is(xsys(qw(git clone -q --mirror),
-                        "http://$host:$port/$group", "$tmpdir/clone.git"),
+                        "$http_pfx/$group", "$tmpdir/clone.git"),
                 0, 'smart clone successful');
 
         # ensure dumb cloning works, too:
@@ -73,7 +71,7 @@ EOF
                 qw(config http.uploadpack false)),
                 0, 'disable http.uploadpack');
         is(xsys(qw(git clone -q --mirror),
-                        "http://$host:$port/$group", "$tmpdir/dumb.git"),
+                        "$http_pfx/$group", "$tmpdir/dumb.git"),
                 0, 'clone successful');
 
         ok($td->kill, 'killed httpd');