[PATCH 1 of 8 ipv6] runtests: export HGIPV6 to hint test scripts whether to use IPv6

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 1 of 8 ipv6] runtests: export HGIPV6 to hint test scripts whether to use IPv6

Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487221422 28800
#      Wed Feb 15 21:03:42 2017 -0800
# Node ID f2743873dfbd6adedcd3aa1777b651ce5bd6f6ed
# Parent  a70e11929c63cd9245812f3db8091a449cd1273e
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r f2743873dfbd
runtests: export HGIPV6 to hint test scripts whether to use IPv6

Previously, run-tests.py only exports HGPORT, and scripts in tests do not
know if IPv6 should be used. And that breaks scripts like dumbhttp.py which
always uses IPv4.

This patch makes run-tests.py export HGIPV6, which can help test scripts
like dumbhttp.py and tinyproxy.py to decide whether to use IPv6 or not.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -584,4 +584,5 @@ class Test(unittest.TestCase):
         self._hgcommand = hgcommand or b'hg'
         self._usechg = usechg
+        self._useipv6 = useipv6
 
         self._aborted = False
@@ -874,4 +875,5 @@ class Test(unittest.TestCase):
         env["HGENCODING"] = "ascii"
         env["HGENCODINGMODE"] = "strict"
+        env['HGIPV6'] = str(int(self._useipv6))
 
         # Reset some environment variables to well-known values so that
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 2 of 8 ipv6] dumbhttp: use IPv6 if HGIPV6 is set to 1

Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487221740 28800
#      Wed Feb 15 21:09:00 2017 -0800
# Node ID 28bb800077fd83098320b6f21334a71eedf03bbe
# Parent  f2743873dfbd6adedcd3aa1777b651ce5bd6f6ed
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 28bb800077fd
dumbhttp: use IPv6 if HGIPV6 is set to 1

This will fix flaky tests using dumbhttp.

The patch was tested on gcc112.fsffrance.org using the following command:

  ./run-tests.py -j 40 --runs-per-test 120 test-bundle2-remote-changegroup.t

diff --git a/tests/dumbhttp.py b/tests/dumbhttp.py
--- a/tests/dumbhttp.py
+++ b/tests/dumbhttp.py
@@ -8,5 +8,7 @@ Small and dumb HTTP server for use in te
 
 import optparse
+import os
 import signal
+import socket
 import sys
 
@@ -19,9 +21,15 @@ httpserver = util.httpserver
 OptionParser = optparse.OptionParser
 
+if os.environ.get('HGIPV6', '0') == '1':
+    class simplehttpserver(httpserver.httpserver):
+        address_family = socket.AF_INET6
+else:
+    simplehttpserver = httpserver.httpserver
+
 class simplehttpservice(object):
     def __init__(self, host, port):
         self.address = (host, port)
     def init(self):
-        self.httpd = httpserver.httpserver(
+        self.httpd = simplehttpserver(
             self.address, httpserver.simplehttprequesthandler)
     def run(self):
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 3 of 8 ipv6] tinyproxy: use IPv6 if HGIPV6 is set to 1

Jun Wu
In reply to this post by Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487228025 28800
#      Wed Feb 15 22:53:45 2017 -0800
# Node ID 72115e4deca500bd6da1929479a966b8b0eb0e1d
# Parent  28bb800077fd83098320b6f21334a71eedf03bbe
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 72115e4deca5
tinyproxy: use IPv6 if HGIPV6 is set to 1

This patch makes tinyproxy.py work in IPv6 mode if HGIPV6 is set to 1.

This will make test-http-proxy.t pass on IPv6 machines.

diff --git a/tests/tinyproxy.py b/tests/tinyproxy.py
--- a/tests/tinyproxy.py
+++ b/tests/tinyproxy.py
@@ -27,4 +27,9 @@ urlparse = util.urlparse
 socketserver = util.socketserver
 
+if os.environ.get('HGIPV6', '0') == '1':
+    family = socket.AF_INET6
+else:
+    family = socket.AF_INET
+
 class ProxyHandler (httpserver.basehttprequesthandler):
     __base = httpserver.basehttprequesthandler
@@ -66,5 +71,5 @@ class ProxyHandler (httpserver.basehttpr
 
     def do_CONNECT(self):
-        soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        soc = socket.socket(family, socket.SOCK_STREAM)
         try:
             if self._connect_to(self.path, soc):
@@ -86,5 +91,5 @@ class ProxyHandler (httpserver.basehttpr
             self.send_error(400, "bad url %s" % self.path)
             return
-        soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        soc = socket.socket(family, socket.SOCK_STREAM)
         try:
             if self._connect_to(netloc, soc):
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 4 of 8 ipv6] runtests: set web.address to localhost

Jun Wu
In reply to this post by Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487232809 28800
#      Thu Feb 16 00:13:29 2017 -0800
# Node ID 91137c500c4f8761c2d70bab7438d8d87959bd15
# Parent  72115e4deca500bd6da1929479a966b8b0eb0e1d
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 91137c500c4f
runtests: set web.address to localhost

Previously, "hg serve" will listen on "", which is not clear which interface
it will actually listen on - it could listen on all interfaces (ex. 0.0.0.0
on IPv4).

The run-tests.py script only checks "localhost" for available ports. So
let's make it the same for "hg serve" by explicitly setting "web.address" to
"localhost".

This resolves some IPv6 EADDRINUSE errors.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -918,4 +918,6 @@ class Test(unittest.TestCase):
         hgrc.write(b'usercache = %s\n' %
                    (os.path.join(self._testtmp, b'.cache/largefiles')))
+        hgrc.write(b'[web]\n')
+        hgrc.write(b'address = localhost\n')
 
         for opt in self._extraconfigopts:
diff --git a/tests/test-basic.t b/tests/test-basic.t
--- a/tests/test-basic.t
+++ b/tests/test-basic.t
@@ -12,4 +12,5 @@ Create a repository:
   ui.mergemarkers=detailed
   ui.promptecho=True
+  web.address=localhost
   web.ipv6=True (?)
   $ hg init t
diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -200,4 +200,5 @@ check that local configs for the cached
   ui.foo=bar
   ui.nontty=true
+  web.address=localhost
   web.ipv6=True (?)
   *** runcommand init foo
diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
--- a/tests/test-http-bundle1.t
+++ b/tests/test-http-bundle1.t
@@ -29,9 +29,9 @@ Test server address cannot be reused
 #if windows
   $ hg serve -p $HGPORT1 2>&1
-  abort: cannot start server at ':$HGPORT1': * (glob)
+  abort: cannot start server at 'localhost:$HGPORT1': * (glob)
   [255]
 #else
   $ hg serve -p $HGPORT1 2>&1
-  abort: cannot start server at ':$HGPORT1': Address already in use
+  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
   [255]
 #endif
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -24,5 +24,5 @@ Test server address cannot be reused
 #else
   $ hg serve -p $HGPORT1 2>&1
-  abort: cannot start server at ':$HGPORT1': Address already in use
+  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
   [255]
 #endif
diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -37,9 +37,9 @@ Test server address cannot be reused
 #if windows
   $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
-  abort: cannot start server at ':$HGPORT':
+  abort: cannot start server at 'localhost:$HGPORT':
   [255]
 #else
   $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
-  abort: cannot start server at ':$HGPORT': Address already in use
+  abort: cannot start server at 'localhost:$HGPORT': Address already in use
   [255]
 #endif
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 5 of 8 ipv6] runtests: always set web.ipv6

Jun Wu
In reply to this post by Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487263439 28800
#      Thu Feb 16 08:43:59 2017 -0800
# Node ID b38591e034d5508ddfc73d50b95d6b29d6370671
# Parent  91137c500c4f8761c2d70bab7438d8d87959bd15
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r b38591e034d5
runtests: always set web.ipv6

Previously, we only set web.ipv6 if IPv6 is used, but not on the IPv4 case.

Since we already have set web.address, it makes sense to move "web.ipv6" out
from "extra config options".

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -595,9 +595,4 @@ class Test(unittest.TestCase):
         self._chgsockdir = None
 
-        # If IPv6 is used, set web.ipv6=1 in hgrc so servers will use IPv6
-        if useipv6:
-            self._extraconfigopts = list(self._extraconfigopts)
-            self._extraconfigopts.append('web.ipv6 = True')
-
         # If we're not in --debug mode and reference output file exists,
         # check test output against it.
@@ -920,4 +915,5 @@ class Test(unittest.TestCase):
         hgrc.write(b'[web]\n')
         hgrc.write(b'address = localhost\n')
+        hgrc.write(b'ipv6 = %s\n' % self._useipv6)
 
         for opt in self._extraconfigopts:
diff --git a/tests/test-basic.t b/tests/test-basic.t
--- a/tests/test-basic.t
+++ b/tests/test-basic.t
@@ -13,5 +13,5 @@ Create a repository:
   ui.promptecho=True
   web.address=localhost
-  web.ipv6=True (?)
+  web\.ipv6=(?:True|False) (re)
   $ hg init t
   $ cd t
diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
--- a/tests/test-commandserver.t
+++ b/tests/test-commandserver.t
@@ -201,5 +201,5 @@ check that local configs for the cached
   ui.nontty=true
   web.address=localhost
-  web.ipv6=True (?)
+  web\.ipv6=(?:True|False) (re)
   *** runcommand init foo
   *** runcommand -R foo showconfig ui defaults
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 6 of 8 ipv6] runtests: export LOCALIP

Jun Wu
In reply to this post by Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487260879 28800
#      Thu Feb 16 08:01:19 2017 -0800
# Node ID ce9f5e640bdfcc6270f0be98d7fc6520740ba464
# Parent  b38591e034d5508ddfc73d50b95d6b29d6370671
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r ce9f5e640bdf
runtests: export LOCALIP

Previously, tests hard-code local IP address as "127.0.0.1". That won't work
for IPv6.

This patch exports the $LOCALIP environment variable, which is set to "::1"
if we decide to use IPv6.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -833,4 +833,5 @@ class Test(unittest.TestCase):
             (br'(?m)^(saved backup bundle to .*\.hg)( \(glob\))?$',
              br'\1 (glob)'),
+            (br'([^0-9])%s' % re.escape(self._localip()), br'\1$LOCALIP'),
             ]
         r.append((self._escapepath(self._testtmp), b'$TESTTMP'))
@@ -848,4 +849,10 @@ class Test(unittest.TestCase):
             return re.escape(p)
 
+    def _localip(self):
+        if self._useipv6:
+            return b'::1'
+        else:
+            return b'127.0.0.1'
+
     def _getenv(self):
         """Obtain environment variables to use during test execution."""
@@ -872,4 +879,8 @@ class Test(unittest.TestCase):
         env['HGIPV6'] = str(int(self._useipv6))
 
+        # LOCALIP could be ::1 or 127.0.0.1. Useful for tests that require raw
+        # IP addresses.
+        env['LOCALIP'] = self._localip()
+
         # Reset some environment variables to well-known values so that
         # the tests produce repeatable output.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 7 of 8 ipv6] dummyssh: use LOCALIP

Jun Wu
In reply to this post by Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487229843 28800
#      Wed Feb 15 23:24:03 2017 -0800
# Node ID 2bd74124ed8f3824f956f301d15a6816bfa5d483
# Parent  ce9f5e640bdfcc6270f0be98d7fc6520740ba464
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 2bd74124ed8f
dummyssh: use LOCALIP

This patch replaces hard-coded 127.0.0.1 with $LOCALIP in dummyssh.

diff --git a/tests/dummyssh b/tests/dummyssh
--- a/tests/dummyssh
+++ b/tests/dummyssh
@@ -11,5 +11,5 @@ if sys.argv[1] != "user@dummy":
     sys.exit(-1)
 
-os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
+os.environ["SSH_CLIENT"] = "%s 1 2" % os.environ.get('LOCALIP', '127.0.0.1')
 
 log = open("dummylog", "ab")
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

[PATCH 8 of 8 ipv6] tests: use LOCALIP

Jun Wu
In reply to this post by Jun Wu
# HG changeset patch
# User Jun Wu <[hidden email]>
# Date 1487266732 28800
#      Thu Feb 16 09:38:52 2017 -0800
# Node ID a23452874b2a39c6e2b71c63f7edfc4f4d5df2d5
# Parent  2bd74124ed8f3824f956f301d15a6816bfa5d483
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r a23452874b2a
tests: use LOCALIP

This patch replaces hardcoded 127.0.0.1 with $LOCALIP in all tests.

Till now, the IPv6 series should make tests pass on common IPv6 systems
where the local device has the address "::1" and the hostname "localhost"
resolves to "::1".

diff --git a/tests/test-archive.t b/tests/test-archive.t
--- a/tests/test-archive.t
+++ b/tests/test-archive.t
@@ -100,5 +100,5 @@ invalid arch type should give 404
   >     stdout = sys.stdout
   > try:
-  >     f = util.urlreq.urlopen('<a href="http://127.0.0.1:%s/?%s'">http://127.0.0.1:%s/?%s'
+  >     f = util.urlreq.urlopen('<a href="http://$LOCALIP:%s/?%s'">http://$LOCALIP:%s/?%s'
   >                     % (os.environ['HGPORT'], requeststr))
   >     stdout.write(f.read())
diff --git a/tests/test-bundle2-exchange.t b/tests/test-bundle2-exchange.t
--- a/tests/test-bundle2-exchange.t
+++ b/tests/test-bundle2-exchange.t
@@ -341,5 +341,5 @@ push over ssh
   remote: wlock: free
   remote: postclose-tip:5fddd98957c8 draft book_5fdd
-  remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:* HG_TXNNAME=serve HG_URL=remote:ssh:127.0.0.1 (glob)
+  remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:* HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP (glob)
   updating bookmark book_5fdd
   pre-close-tip:02de42196ebe draft book_02de
@@ -395,5 +395,5 @@ push over http
   remote: wlock: free
   remote: postclose-tip:32af7686d403 public book_32af
-  remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_TXNNAME=serve HG_URL=remote:http:127.0.0.1: (glob)
+  remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_TXNNAME=serve HG_URL=remote:http:*: (glob)
   updating bookmark book_32af
   pre-close-tip:02de42196ebe draft book_02de
diff --git a/tests/test-clone.t b/tests/test-clone.t
--- a/tests/test-clone.t
+++ b/tests/test-clone.t
@@ -580,9 +580,9 @@ No remote source
 
 #if windows
-  $ hg clone http://127.0.0.1:3121/a b
+  $ hg clone http://$LOCALIP:3121/a b
   abort: error: * (glob)
   [255]
 #else
-  $ hg clone http://127.0.0.1:3121/a b
+  $ hg clone http://$LOCALIP:3121/a b
   abort: error: *refused* (glob)
   [255]
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -1793,5 +1793,5 @@ Dish up an empty repo; serve it cold.
   $ cat hg.pid >> $DAEMON_PIDS
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help"
+  $ get-with-headers.py $LOCALIP:$HGPORT "help"
   200 Script output follows
   
@@ -2362,5 +2362,5 @@ Dish up an empty repo; serve it cold.
   
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help/add"
+  $ get-with-headers.py $LOCALIP:$HGPORT "help/add"
   200 Script output follows
   
@@ -2536,5 +2536,5 @@ Dish up an empty repo; serve it cold.
   
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help/remove"
+  $ get-with-headers.py $LOCALIP:$HGPORT "help/remove"
   200 Script output follows
   
@@ -2731,5 +2731,5 @@ Dish up an empty repo; serve it cold.
   
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help/dates"
+  $ get-with-headers.py $LOCALIP:$HGPORT "help/dates"
   200 Script output follows
   
@@ -2838,5 +2838,5 @@ Dish up an empty repo; serve it cold.
 Sub-topic indexes rendered properly
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help/internals"
+  $ get-with-headers.py $LOCALIP:$HGPORT "help/internals"
   200 Script output follows
   
@@ -2934,5 +2934,5 @@ Sub-topic indexes rendered properly
 Sub-topic topics rendered properly
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT "help/internals.changegroups"
+  $ get-with-headers.py $LOCALIP:$HGPORT "help/internals.changegroups"
   200 Script output follows
   
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -59,5 +59,5 @@ Set up the repo
 Logs and changes
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log/?style=atom'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log/?style=atom'
   200 Script output follows
   
@@ -245,5 +245,5 @@ Logs and changes
   
   </feed>
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log/?style=rss'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log/?style=rss'
   200 Script output follows
   
@@ -423,5 +423,5 @@ Logs and changes
     </channel>
   </rss> (no-eol)
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log/1/?style=atom'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log/1/?style=atom'
   200 Script output follows
   
@@ -523,5 +523,5 @@ Logs and changes
   
   </feed>
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log/1/?style=rss'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log/1/?style=rss'
   200 Script output follows
   
@@ -619,5 +619,5 @@ Logs and changes
     </channel>
   </rss> (no-eol)
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log/1/foo/?style=atom'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log/1/foo/?style=atom'
   200 Script output follows
   
@@ -674,5 +674,5 @@ Logs and changes
   
   </feed>
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log/1/foo/?style=rss'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log/1/foo/?style=rss'
   200 Script output follows
   
@@ -695,5 +695,5 @@ Logs and changes
     </channel>
   </rss>
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'shortlog/'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'shortlog/'
   200 Script output follows
   
@@ -835,5 +835,5 @@ Logs and changes
   </html>
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'rev/0/'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'rev/0/'
   200 Script output follows
   
@@ -966,5 +966,5 @@ Logs and changes
   </html>
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'rev/1/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'rev/1/?style=raw'
   200 Script output follows
   
@@ -983,5 +983,5 @@ Logs and changes
   +2ef0ac749a14e4f57a5a822464a0902c6f7f448f 1.0
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=base'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=base'
   200 Script output follows
   
@@ -1072,10 +1072,10 @@ Logs and changes
   </html>
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=stable&style=raw' | grep 'revision:'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=stable&style=raw' | grep 'revision:'
   revision:    2
 
 Search with revset syntax
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=tip^&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=tip^&style=raw'
   200 Script output follows
   
@@ -1094,5 +1094,5 @@ Search with revset syntax
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=last(all(),2)^&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=last(all(),2)^&style=raw'
   200 Script output follows
   
@@ -1118,5 +1118,5 @@ Search with revset syntax
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=last(all(,2)^&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=last(all(,2)^&style=raw'
   200 Script output follows
   
@@ -1128,5 +1128,5 @@ Search with revset syntax
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=last(al(),2)^&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=last(al(),2)^&style=raw'
   200 Script output follows
   
@@ -1138,5 +1138,5 @@ Search with revset syntax
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=bookmark(anotherthing)&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=bookmark(anotherthing)&style=raw'
   200 Script output follows
   
@@ -1156,5 +1156,5 @@ Search with revset syntax
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=bookmark(abc)&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=bookmark(abc)&style=raw'
   200 Script output follows
   
@@ -1166,5 +1166,5 @@ Search with revset syntax
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=deadbeef:&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=deadbeef:&style=raw'
   200 Script output follows
   
@@ -1177,5 +1177,5 @@ Search with revset syntax
   
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=user("test")&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=user("test")&style=raw'
   200 Script output follows
   
@@ -1218,5 +1218,5 @@ Search with revset syntax
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=user("re:test")&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=user("re:test")&style=raw'
   200 Script output follows
   
@@ -1231,9 +1231,9 @@ Search with revset syntax
 File-related
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file/1/foo/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file/1/foo/?style=raw'
   200 Script output follows
   
   foo
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'annotate/1/foo/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'annotate/1/foo/?style=raw'
   200 Script output follows
   
@@ -1244,5 +1244,5 @@ File-related
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file/1/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file/1/?style=raw'
   200 Script output follows
   
@@ -1260,5 +1260,5 @@ File-related
   2ef0ac749a14
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file/1/foo'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file/1/foo'
   200 Script output follows
   
@@ -1355,5 +1355,5 @@ File-related
   </html>
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'filediff/0/foo/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'filediff/0/foo/?style=raw'
   200 Script output follows
   
@@ -1369,5 +1369,5 @@ File-related
   
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'filediff/1/foo/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'filediff/1/foo/?style=raw'
   200 Script output follows
   
@@ -1385,5 +1385,5 @@ File-related
   2ef0ac749a14
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file/2/foo'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file/2/foo'
   200 Script output follows
   
@@ -1484,10 +1484,10 @@ File-related
 Overviews
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'raw-tags'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'raw-tags'
   200 Script output follows
   
   tip cad8025a2e87f88c06259790adfa15acb4080123
   1.0 2ef0ac749a14e4f57a5a822464a0902c6f7f448f
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'raw-branches'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'raw-branches'
   200 Script output follows
   
@@ -1495,10 +1495,10 @@ Overviews
   stable 1d22e65f027e5a0609357e7d8e7508cd2ba5d2fe inactive
   default a4f92ed23982be056b9852de5dfe873eaac7f0de inactive
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'raw-bookmarks'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'raw-bookmarks'
   200 Script output follows
   
   something cad8025a2e87f88c06259790adfa15acb4080123
   anotherthing 2ef0ac749a14e4f57a5a822464a0902c6f7f448f
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'summary/?style=gitweb'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'summary/?style=gitweb'
   200 Script output follows
   
@@ -1698,5 +1698,5 @@ Overviews
   </html>
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'graph/?style=gitweb'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'graph/?style=gitweb'
   200 Script output follows
   
@@ -1844,5 +1844,5 @@ Overviews
 raw graph
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'graph/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'graph/?style=raw'
   200 Script output follows
   
@@ -1894,5 +1894,5 @@ raw graph
 capabilities
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities'; echo
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities'; echo
   200 Script output follows
   
@@ -1901,5 +1901,5 @@ capabilities
 heads
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=heads'
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=heads'
   200 Script output follows
   
@@ -1908,5 +1908,5 @@ heads
 branches
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000'
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=branches&nodes=0000000000000000000000000000000000000000'
   200 Script output follows
   
@@ -1915,5 +1915,5 @@ branches
 changegroup
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000'
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=changegroup&roots=0000000000000000000000000000000000000000'
   200 Script output follows
   
@@ -1926,5 +1926,5 @@ changegroup
 stream_out
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=stream_out'
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
   200 Script output follows
   
@@ -1933,5 +1933,5 @@ stream_out
 failing unbundle, requires POST request
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=unbundle'
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=unbundle'
   405 push requires POST request
   
@@ -1942,5 +1942,5 @@ failing unbundle, requires POST request
 Static files
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'static/style.css'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'static/style.css'
   200 Script output follows
   
@@ -2078,5 +2078,5 @@ repository root. (issue4568)
   $ cat hg.pid >> $DAEMON_PIDS
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'log?rev=adds("foo")&style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'log?rev=adds("foo")&style=raw'
   200 Script output follows
   
@@ -2111,5 +2111,5 @@ commit message with Japanese Kanji 'Noh'
 Graph json escape of multibyte character
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'graph/' > out
+  $ get-with-headers.py $LOCALIP:$HGPORT 'graph/' > out
   >>> from __future__ import print_function
   >>> for line in open("out"):
@@ -2122,5 +2122,5 @@ capabilities
 (plain version to check the format)
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | dd ibs=75 count=1 2> /dev/null; echo
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | dd ibs=75 count=1 2> /dev/null; echo
   200 Script output follows
   
@@ -2129,5 +2129,5 @@ capabilities
 (spread version to check the content)
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n'; echo
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n'; echo
   200
   Script
@@ -2195,10 +2195,10 @@ Test graph paging
 Test paging
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT \
+  $ get-with-headers.py $LOCALIP:$HGPORT \
   >   'graph/?style=raw' | grep changeset
   changeset:   aed2d9c1d0e7
   changeset:   b60a39a85a01
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT \
+  $ get-with-headers.py $LOCALIP:$HGPORT \
   >   'graph/?style=raw&revcount=3' | grep changeset
   changeset:   aed2d9c1d0e7
@@ -2206,10 +2206,10 @@ Test paging
   changeset:   ada793dcc118
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT \
+  $ get-with-headers.py $LOCALIP:$HGPORT \
   >   'graph/e06180cbfb0?style=raw&revcount=3' | grep changeset
   changeset:   e06180cbfb0c
   changeset:   b4e73ffab476
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT \
+  $ get-with-headers.py $LOCALIP:$HGPORT \
   >   'graph/b4e73ffab47?style=raw&revcount=3' | grep changeset
   changeset:   b4e73ffab476
diff --git a/tests/test-hgweb-descend-empties.t b/tests/test-hgweb-descend-empties.t
--- a/tests/test-hgweb-descend-empties.t
+++ b/tests/test-hgweb-descend-empties.t
@@ -30,5 +30,5 @@ Set up the repo
 manifest with descending (paper)
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file'
   200 Script output follows
   
@@ -148,5 +148,5 @@ manifest with descending (paper)
 manifest with descending (coal)
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file?style=coal'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file?style=coal'
   200 Script output follows
   
@@ -267,5 +267,5 @@ manifest with descending (coal)
 manifest with descending (monoblue)
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file?style=monoblue'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file?style=monoblue'
   200 Script output follows
   
@@ -380,5 +380,5 @@ manifest with descending (monoblue)
 manifest with descending (gitweb)
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file?style=gitweb'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file?style=gitweb'
   200 Script output follows
   
@@ -483,5 +483,5 @@ manifest with descending (gitweb)
 manifest with descending (spartan)
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file?style=spartan'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file?style=spartan'
   200 Script output follows
   
diff --git a/tests/test-hgweb-no-path-info.t b/tests/test-hgweb-no-path-info.t
--- a/tests/test-hgweb-no-path-info.t
+++ b/tests/test-hgweb-no-path-info.t
@@ -50,5 +50,5 @@ should be used from d74fc8dec2b4 onward
   >     'PATH_INFO': '/',
   >     'SCRIPT_NAME': '',
-  >     'SERVER_NAME': '127.0.0.1',
+  >     'SERVER_NAME': '$LOCALIP',
   >     'SERVER_PORT': os.environ['HGPORT'],
   >     'SERVER_PROTOCOL': 'HTTP/1.0'
@@ -80,7 +80,7 @@ should be used from d74fc8dec2b4 onward
   <feed xmlns="http://www.w3.org/2005/Atom">
    <!-- Changelog -->
-   <id><a href="http://127.0.0.1:$HGPORT/">http://127.0.0.1:$HGPORT/</id> (glob)
-   <link rel="self" href="<a href="http://127.0.0.1:$HGPORT/atom-log">http://127.0.0.1:$HGPORT/atom-log"/> (glob)
-   <link rel="alternate" href="<a href="http://127.0.0.1:$HGPORT/">http://127.0.0.1:$HGPORT/"/> (glob)
+   <id><a href="http://$LOCALIP:$HGPORT/">http://$LOCALIP:$HGPORT/</id> (glob)
+   <link rel="self" href="<a href="http://$LOCALIP:$HGPORT/atom-log">http://$LOCALIP:$HGPORT/atom-log"/> (glob)
+   <link rel="alternate" href="<a href="http://$LOCALIP:$HGPORT/">http://$LOCALIP:$HGPORT/"/> (glob)
    <title>repo Changelog</title>
    <updated>1970-01-01T00:00:00+00:00</updated>
@@ -88,6 +88,6 @@ should be used from d74fc8dec2b4 onward
    <entry>
     <title>[default] test</title>
-    <id><a href="http://127.0.0.1:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c">http://127.0.0.1:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id> (glob)
-    <link href="<a href="http://127.0.0.1:$HGPORT/rev/61c9426e69fe">http://127.0.0.1:$HGPORT/rev/61c9426e69fe"/> (glob)
+    <id><a href="http://$LOCALIP:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c">http://$LOCALIP:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id> (glob)
+    <link href="<a href="http://$LOCALIP:$HGPORT/rev/61c9426e69fe">http://$LOCALIP:$HGPORT/rev/61c9426e69fe"/> (glob)
     <author>
      <name>test</name>
diff --git a/tests/test-hgweb-no-request-uri.t b/tests/test-hgweb-no-request-uri.t
--- a/tests/test-hgweb-no-request-uri.t
+++ b/tests/test-hgweb-no-request-uri.t
@@ -49,5 +49,5 @@ should be used from d74fc8dec2b4 onward
   >     'REQUEST_METHOD': 'GET',
   >     'SCRIPT_NAME': '',
-  >     'SERVER_NAME': '127.0.0.1',
+  >     'SERVER_NAME': '$LOCALIP',
   >     'SERVER_PORT': os.environ['HGPORT'],
   >     'SERVER_PROTOCOL': 'HTTP/1.0'
@@ -91,7 +91,7 @@ should be used from d74fc8dec2b4 onward
   <feed xmlns="http://www.w3.org/2005/Atom">
    <!-- Changelog -->
-   <id><a href="http://127.0.0.1:$HGPORT/">http://127.0.0.1:$HGPORT/</id> (glob)
-   <link rel="self" href="<a href="http://127.0.0.1:$HGPORT/atom-log">http://127.0.0.1:$HGPORT/atom-log"/> (glob)
-   <link rel="alternate" href="<a href="http://127.0.0.1:$HGPORT/">http://127.0.0.1:$HGPORT/"/> (glob)
+   <id><a href="http://$LOCALIP:$HGPORT/">http://$LOCALIP:$HGPORT/</id> (glob)
+   <link rel="self" href="<a href="http://$LOCALIP:$HGPORT/atom-log">http://$LOCALIP:$HGPORT/atom-log"/> (glob)
+   <link rel="alternate" href="<a href="http://$LOCALIP:$HGPORT/">http://$LOCALIP:$HGPORT/"/> (glob)
    <title>repo Changelog</title>
    <updated>1970-01-01T00:00:00+00:00</updated>
@@ -99,6 +99,6 @@ should be used from d74fc8dec2b4 onward
    <entry>
     <title>[default] test</title>
-    <id><a href="http://127.0.0.1:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c">http://127.0.0.1:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id> (glob)
-    <link href="<a href="http://127.0.0.1:$HGPORT/rev/61c9426e69fe">http://127.0.0.1:$HGPORT/rev/61c9426e69fe"/> (glob)
+    <id><a href="http://$LOCALIP:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c">http://$LOCALIP:$HGPORT/#changeset-61c9426e69fef294feed5e2bbfc97d39944a5b1c</id> (glob)
+    <link href="<a href="http://$LOCALIP:$HGPORT/rev/61c9426e69fe">http://$LOCALIP:$HGPORT/rev/61c9426e69fe"/> (glob)
     <author>
      <name>test</name>
diff --git a/tests/test-hgweb-non-interactive.t b/tests/test-hgweb-non-interactive.t
--- a/tests/test-hgweb-non-interactive.t
+++ b/tests/test-hgweb-non-interactive.t
@@ -61,5 +61,5 @@ by the WSGI standard and strictly implem
   >     'PATH_INFO': '',
   >     'QUERY_STRING': '',
-  >     'SERVER_NAME': '127.0.0.1',
+  >     'SERVER_NAME': '$LOCALIP',
   >     'SERVER_PORT': os.environ['HGPORT'],
   >     'SERVER_PROTOCOL': 'HTTP/1.0'
diff --git a/tests/test-hgweb-raw.t b/tests/test-hgweb-raw.t
--- a/tests/test-hgweb-raw.t
+++ b/tests/test-hgweb-raw.t
@@ -33,5 +33,5 @@ Test raw style of hgweb
   care about things like that.
   $ cat access.log error.log
-  127.0.0.1 - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
+  $LOCALIP - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
 
   $ rm access.log error.log
@@ -54,5 +54,5 @@ Test raw style of hgweb
   care about things like that.
   $ cat access.log error.log
-  127.0.0.1 - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
+  $LOCALIP - - [*] "GET /?f=bf0ff59095c9;file=sub/some%20text%25.txt;style=raw HTTP/1.1" 200 - (glob)
 
   $ cd ..
diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t
--- a/tests/test-hgweb-symrev.t
+++ b/tests/test-hgweb-symrev.t
@@ -38,5 +38,5 @@ Set up the repo
 (De)referencing symbolic revisions (paper)
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=paper' | egrep $REVLINKS
   <li><a href="/graph/tip?style=paper">graph</a></li>
   <li><a href="/rev/tip?style=paper">changeset</a></li>
@@ -53,5 +53,5 @@ Set up the repo
   | rev 2: <a href="/shortlog/43c799df6e75?style=paper">(0)</a> <a href="/shortlog/tip?style=paper">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/tip?style=paper">log</a></li>
   <li><a href="/rev/tip?style=paper">changeset</a></li>
@@ -64,5 +64,5 @@ Set up the repo
   | rev 2: <a href="/graph/43c799df6e75?style=paper">(0)</a> <a href="/graph/tip?style=paper">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/tip?style=paper">log</a></li>
   <li><a href="/graph/tip?style=paper">graph</a></li>
@@ -75,22 +75,22 @@ Set up the repo
   <a href="/file/tip/foo?style=paper">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'branches?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=paper' | egrep $REVLINKS
   <a href="/shortlog/default?style=paper" class="open">
   <a href="/shortlog/9d8c40cba617?style=paper" class="open">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'tags?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=paper' | egrep $REVLINKS
   <a href="/rev/tip?style=paper">
   <a href="/rev/9d8c40cba617?style=paper">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'bookmarks?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=paper' | egrep $REVLINKS
   <a href="/rev/xyzzy?style=paper">
   <a href="/rev/a7c1559b7bba?style=paper">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=paper&rev=all()' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=paper&rev=all()' | egrep $REVLINKS
      <a href="/rev/9d8c40cba617?style=paper">third</a>
      <a href="/rev/a7c1559b7bba?style=paper">second</a>
      <a href="/rev/43c799df6e75?style=paper">first</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=paper' | egrep $REVLINKS
    <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
    <li><a href="/graph/xyzzy?style=paper">graph</a></li>
@@ -103,5 +103,5 @@ Set up the repo
    <td class="files"><a href="/file/a7c1559b7bba/foo?style=paper">foo</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=paper' | egrep $REVLINKS
   <li><a href="/graph/xyzzy?style=paper">graph</a></li>
   <li><a href="/rev/xyzzy?style=paper">changeset</a></li>
@@ -117,5 +117,5 @@ Set up the repo
   | rev 1: <a href="/shortlog/43c799df6e75?style=paper">(0)</a> <a href="/shortlog/tip?style=paper">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
   <li><a href="/rev/xyzzy?style=paper">changeset</a></li>
@@ -128,5 +128,5 @@ Set up the repo
   | rev 1: <a href="/graph/43c799df6e75?style=paper">(0)</a> <a href="/graph/tip?style=paper">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
   <li><a href="/graph/xyzzy?style=paper">graph</a></li>
@@ -139,5 +139,5 @@ Set up the repo
   <a href="/file/xyzzy/foo?style=paper">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
   <li><a href="/graph/xyzzy?style=paper">graph</a></li>
@@ -154,5 +154,5 @@ Set up the repo
    <td class="author"><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=paper' | egrep $REVLINKS
      href="/atom-log/tip/foo" title="Atom feed for test:foo" />
      href="/rss-log/tip/foo" title="RSS feed for test:foo" />
@@ -177,5 +177,5 @@ Set up the repo
   | <a href="/log/43c799df6e75/foo?style=paper">(0)</a> <a href="/log/tip/foo?style=paper">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
   <li><a href="/graph/xyzzy?style=paper">graph</a></li>
@@ -201,5 +201,5 @@ Set up the repo
   <a href="/rev/a7c1559b7bba?style=paper">changeset</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
   <li><a href="/graph/xyzzy?style=paper">graph</a></li>
@@ -216,5 +216,5 @@ Set up the repo
    <td><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'comparison/xyzzy/foo?style=paper' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=paper' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=paper">log</a></li>
   <li><a href="/graph/xyzzy?style=paper">graph</a></li>
@@ -233,5 +233,5 @@ Set up the repo
 (De)referencing symbolic revisions (coal)
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=coal' | egrep $REVLINKS
   <li><a href="/graph/tip?style=coal">graph</a></li>
   <li><a href="/rev/tip?style=coal">changeset</a></li>
@@ -248,5 +248,5 @@ Set up the repo
   | rev 2: <a href="/shortlog/43c799df6e75?style=coal">(0)</a> <a href="/shortlog/tip?style=coal">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/tip?style=coal">log</a></li>
   <li><a href="/rev/tip?style=coal">changeset</a></li>
@@ -259,5 +259,5 @@ Set up the repo
   | rev 2: <a href="/graph/43c799df6e75?style=coal">(0)</a> <a href="/graph/tip?style=coal">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/tip?style=coal">log</a></li>
   <li><a href="/graph/tip?style=coal">graph</a></li>
@@ -270,22 +270,22 @@ Set up the repo
   <a href="/file/tip/foo?style=coal">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'branches?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=coal' | egrep $REVLINKS
   <a href="/shortlog/default?style=coal" class="open">
   <a href="/shortlog/9d8c40cba617?style=coal" class="open">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'tags?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=coal' | egrep $REVLINKS
   <a href="/rev/tip?style=coal">
   <a href="/rev/9d8c40cba617?style=coal">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'bookmarks?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=coal' | egrep $REVLINKS
   <a href="/rev/xyzzy?style=coal">
   <a href="/rev/a7c1559b7bba?style=coal">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=coal&rev=all()' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=coal&rev=all()' | egrep $REVLINKS
      <a href="/rev/9d8c40cba617?style=coal">third</a>
      <a href="/rev/a7c1559b7bba?style=coal">second</a>
      <a href="/rev/43c799df6e75?style=coal">first</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=coal' | egrep $REVLINKS
    <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
    <li><a href="/graph/xyzzy?style=coal">graph</a></li>
@@ -298,5 +298,5 @@ Set up the repo
    <td class="files"><a href="/file/a7c1559b7bba/foo?style=coal">foo</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=coal' | egrep $REVLINKS
   <li><a href="/graph/xyzzy?style=coal">graph</a></li>
   <li><a href="/rev/xyzzy?style=coal">changeset</a></li>
@@ -312,5 +312,5 @@ Set up the repo
   | rev 1: <a href="/shortlog/43c799df6e75?style=coal">(0)</a> <a href="/shortlog/tip?style=coal">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
   <li><a href="/rev/xyzzy?style=coal">changeset</a></li>
@@ -323,5 +323,5 @@ Set up the repo
   | rev 1: <a href="/graph/43c799df6e75?style=coal">(0)</a> <a href="/graph/tip?style=coal">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
   <li><a href="/graph/xyzzy?style=coal">graph</a></li>
@@ -334,5 +334,5 @@ Set up the repo
   <a href="/file/xyzzy/foo?style=coal">
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
   <li><a href="/graph/xyzzy?style=coal">graph</a></li>
@@ -349,5 +349,5 @@ Set up the repo
    <td class="author"><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=coal' | egrep $REVLINKS
      href="/atom-log/tip/foo" title="Atom feed for test:foo" />
      href="/rss-log/tip/foo" title="RSS feed for test:foo" />
@@ -372,5 +372,5 @@ Set up the repo
   | <a href="/log/43c799df6e75/foo?style=coal">(0)</a> <a href="/log/tip/foo?style=coal">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
   <li><a href="/graph/xyzzy?style=coal">graph</a></li>
@@ -396,5 +396,5 @@ Set up the repo
   <a href="/rev/a7c1559b7bba?style=coal">changeset</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
   <li><a href="/graph/xyzzy?style=coal">graph</a></li>
@@ -411,5 +411,5 @@ Set up the repo
    <td><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'comparison/xyzzy/foo?style=coal' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=coal' | egrep $REVLINKS
   <li><a href="/shortlog/xyzzy?style=coal">log</a></li>
   <li><a href="/graph/xyzzy?style=coal">graph</a></li>
@@ -428,5 +428,5 @@ Set up the repo
 (De)referencing symbolic revisions (gitweb)
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'summary?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'summary?style=gitweb' | egrep $REVLINKS
   <a href="/file?style=gitweb">files</a> | <a href="/archive/tip.zip">zip</a>  |
   <a class="list" href="/rev/9d8c40cba617?style=gitweb">
@@ -448,5 +448,5 @@ Set up the repo
   <a href="/file/9d8c40cba617?style=gitweb">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=gitweb' | egrep $REVLINKS
   <a href="/log/tip?style=gitweb">changelog</a> |
   <a href="/graph/tip?style=gitweb">graph</a> |
@@ -464,5 +464,5 @@ Set up the repo
   <a href="/shortlog/43c799df6e75?style=gitweb">(0)</a> <a href="/shortlog/tip?style=gitweb">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log?style=gitweb' | egrep $REVLINKS
   <a href="/shortlog/tip?style=gitweb">shortlog</a> |
   <a href="/graph/tip?style=gitweb">graph</a> |
@@ -477,5 +477,5 @@ Set up the repo
   <a href="/log/43c799df6e75?style=gitweb">(0)</a>  <a href="/log/tip?style=gitweb">tip</a> <br/>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=gitweb' | egrep $REVLINKS
   <a href="/shortlog/tip?style=gitweb">shortlog</a> |
   <a href="/log/tip?style=gitweb">changelog</a> |
@@ -488,5 +488,5 @@ Set up the repo
   | <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'tags?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=gitweb' | egrep $REVLINKS
   <td><a class="list" href="/rev/tip?style=gitweb"><b>tip</b></a></td>
   <a href="/rev/9d8c40cba617?style=gitweb">changeset</a> |
@@ -494,5 +494,5 @@ Set up the repo
   <a href="/file/9d8c40cba617?style=gitweb">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'bookmarks?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=gitweb' | egrep $REVLINKS
   <td><a class="list" href="/rev/xyzzy?style=gitweb"><b>xyzzy</b></a></td>
   <a href="/rev/a7c1559b7bba?style=gitweb">changeset</a> |
@@ -500,5 +500,5 @@ Set up the repo
   <a href="/file/a7c1559b7bba?style=gitweb">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'branches?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=gitweb' | egrep $REVLINKS
   <td class="open"><a class="list" href="/shortlog/default?style=gitweb"><b>default</b></a></td>
   <a href="/changeset/9d8c40cba617?style=gitweb">changeset</a> |
@@ -506,5 +506,5 @@ Set up the repo
   <a href="/file/9d8c40cba617?style=gitweb">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=gitweb' | egrep $REVLINKS
   <a href="/rev/tip?style=gitweb">changeset</a>  | <a href="/archive/tip.zip">zip</a>  |
   <td><a href="/file/tip/?style=gitweb">[up]</a></td>
@@ -517,5 +517,5 @@ Set up the repo
   <a href="/annotate/tip/foo?style=gitweb">annotate</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=gitweb&rev=all()' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=gitweb&rev=all()' | egrep $REVLINKS
   <a href="/file?style=gitweb">files</a> | <a href="/archive/tip.zip">zip</a>
   <a class="title" href="/rev/9d8c40cba617?style=gitweb"><span class="age">Thu, 01 Jan 1970 00:00:00 +0000</span>third<span class="logtags"> <span class="branchtag" title="default">default</span> <span class="tagtag" title="tip">tip</span> </span></a>
@@ -526,5 +526,5 @@ Set up the repo
   <a href="/rev/43c799df6e75?style=gitweb">changeset</a><br/>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=gitweb' | egrep $REVLINKS
   <a href="/shortlog/xyzzy?style=gitweb">shortlog</a> |
   <a href="/log/xyzzy?style=gitweb">changelog</a> |
@@ -543,5 +543,5 @@ Set up the repo
   <a href="/log/a7c1559b7bba/foo?style=gitweb">revisions</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=gitweb' | egrep $REVLINKS
   <a href="/log/xyzzy?style=gitweb">changelog</a> |
   <a href="/graph/xyzzy?style=gitweb">graph</a> |
@@ -556,5 +556,5 @@ Set up the repo
   <a href="/shortlog/43c799df6e75?style=gitweb">(0)</a> <a href="/shortlog/tip?style=gitweb">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy?style=gitweb' | egrep $REVLINKS
   <a href="/shortlog/xyzzy?style=gitweb">shortlog</a> |
   <a href="/graph/xyzzy?style=gitweb">graph</a> |
@@ -567,5 +567,5 @@ Set up the repo
   <a href="/log/43c799df6e75?style=gitweb">(0)</a>  <a href="/log/tip?style=gitweb">tip</a> <br/>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=gitweb' | egrep $REVLINKS
   <a href="/shortlog/xyzzy?style=gitweb">shortlog</a> |
   <a href="/log/xyzzy?style=gitweb">changelog</a> |
@@ -578,5 +578,5 @@ Set up the repo
   | <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=gitweb' | egrep $REVLINKS
   <a href="/rev/xyzzy?style=gitweb">changeset</a>  | <a href="/archive/xyzzy.zip">zip</a>  |
   <td><a href="/file/xyzzy/?style=gitweb">[up]</a></td>
@@ -589,5 +589,5 @@ Set up the repo
   <a href="/annotate/xyzzy/foo?style=gitweb">annotate</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=gitweb' | egrep $REVLINKS
   <a href="/file/xyzzy/?style=gitweb">files</a> |
   <a href="/rev/xyzzy?style=gitweb">changeset</a> |
@@ -602,5 +602,5 @@ Set up the repo
   <a class="list" href="/file/9d8c40cba617/foo?style=gitweb">9d8c40cba617</a></td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=gitweb' | egrep $REVLINKS
   <a href="/file/xyzzy/foo?style=gitweb">file</a> |
   <a href="/annotate/xyzzy/foo?style=gitweb">annotate</a> |
@@ -619,5 +619,5 @@ Set up the repo
   <a href="/log/43c799df6e75/foo?style=gitweb">(0)</a> <a href="/log/tip/foo?style=gitweb">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=gitweb' | egrep $REVLINKS
   <a href="/file/xyzzy/?style=gitweb">files</a> |
   <a href="/rev/xyzzy?style=gitweb">changeset</a> |
@@ -641,5 +641,5 @@ Set up the repo
   <a href="/rev/a7c1559b7bba?style=gitweb">changeset</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=gitweb' | egrep $REVLINKS
   <a href="/file/xyzzy?style=gitweb">files</a> |
   <a href="/rev/xyzzy?style=gitweb">changeset</a> |
@@ -654,5 +654,5 @@ Set up the repo
   <a class="list" href="/diff/9d8c40cba617/foo?style=gitweb">9d8c40cba617</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'comparison/xyzzy/foo?style=gitweb' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=gitweb' | egrep $REVLINKS
   <a href="/file/xyzzy?style=gitweb">files</a> |
   <a href="/rev/xyzzy?style=gitweb">changeset</a> |
@@ -669,5 +669,5 @@ Set up the repo
 (De)referencing symbolic revisions (monoblue)
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'summary?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'summary?style=monoblue' | egrep $REVLINKS
               <li><a href="/archive/tip.zip">zip</a></li>
   <a href="/rev/9d8c40cba617?style=monoblue">
@@ -689,5 +689,5 @@ Set up the repo
   <a href="/file/9d8c40cba617?style=monoblue">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/tip?style=monoblue">graph</a></li>
               <li><a href="/file/tip?style=monoblue">files</a></li>
@@ -704,5 +704,5 @@ Set up the repo
       <a href="/shortlog/43c799df6e75?style=monoblue">(0)</a> <a href="/shortlog/tip?style=monoblue">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/tip?style=monoblue">graph</a></li>
               <li><a href="/file/tip?style=monoblue">files</a></li>
@@ -713,5 +713,5 @@ Set up the repo
   <a href="/log/43c799df6e75?style=monoblue">(0)</a>  <a href="/log/tip?style=monoblue">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=monoblue' | egrep $REVLINKS
               <li><a href="/file/tip?style=monoblue">files</a></li>
           <a href="/graph/tip?revcount=30&style=monoblue">less</a>
@@ -719,5 +719,5 @@ Set up the repo
           | <a href="/graph/43c799df6e75?style=monoblue">(0)</a> <a href="/graph/tip?style=monoblue">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'tags?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=monoblue' | egrep $REVLINKS
   <td><a href="/rev/tip?style=monoblue">tip</a></td>
   <a href="/rev/9d8c40cba617?style=monoblue">changeset</a> |
@@ -725,5 +725,5 @@ Set up the repo
   <a href="/file/9d8c40cba617?style=monoblue">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'bookmarks?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'bookmarks?style=monoblue' | egrep $REVLINKS
   <td><a href="/rev/xyzzy?style=monoblue">xyzzy</a></td>
   <a href="/rev/a7c1559b7bba?style=monoblue">changeset</a> |
@@ -731,5 +731,5 @@ Set up the repo
   <a href="/file/a7c1559b7bba?style=monoblue">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'branches?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=monoblue' | egrep $REVLINKS
   <td class="open"><a href="/shortlog/default?style=monoblue">default</a></td>
   <a href="/rev/9d8c40cba617?style=monoblue">changeset</a> |
@@ -737,5 +737,5 @@ Set up the repo
   <a href="/file/9d8c40cba617?style=monoblue">files</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/tip?style=monoblue">graph</a></li>
           <li><a href="/rev/tip?style=monoblue">changeset</a></li>
@@ -750,5 +750,5 @@ Set up the repo
   <a href="/annotate/tip/foo?style=monoblue">annotate</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=monoblue&rev=all()' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=monoblue&rev=all()' | egrep $REVLINKS
               <li><a href="/archive/tip.zip">zip</a></li>
       <h3 class="changelog"><a class="title" href="/rev/9d8c40cba617?style=monoblue">third<span class="logtags"> <span class="branchtag" title="default">default</span> <span class="tagtag" title="tip">tip</span> </span></a></h3>
@@ -756,5 +756,5 @@ Set up the repo
   <h3 class="changelog"><a class="title" href="/rev/43c799df6e75?style=monoblue">first<span class="logtags"> </span></a></h3>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy?style=monoblue">files</a></li>
@@ -772,5 +772,5 @@ Set up the repo
   <a href="/log/a7c1559b7bba/foo?style=monoblue">revisions</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy?style=monoblue">files</a></li>
@@ -784,5 +784,5 @@ Set up the repo
       <a href="/shortlog/43c799df6e75?style=monoblue">(0)</a> <a href="/shortlog/tip?style=monoblue">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy?style=monoblue">files</a></li>
@@ -792,5 +792,5 @@ Set up the repo
   <a href="/log/43c799df6e75?style=monoblue">(0)</a>  <a href="/log/tip?style=monoblue">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=monoblue' | egrep $REVLINKS
               <li><a href="/file/xyzzy?style=monoblue">files</a></li>
           <a href="/graph/xyzzy?revcount=30&style=monoblue">less</a>
@@ -798,5 +798,5 @@ Set up the repo
           | <a href="/graph/43c799df6e75?style=monoblue">(0)</a> <a href="/graph/tip?style=monoblue">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
           <li><a href="/rev/xyzzy?style=monoblue">changeset</a></li>
@@ -811,5 +811,5 @@ Set up the repo
   <a href="/annotate/xyzzy/foo?style=monoblue">annotate</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy/?style=monoblue">files</a></li>
@@ -824,5 +824,5 @@ Set up the repo
   <a href="/file/9d8c40cba617/foo?style=monoblue">9d8c40cba617</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy?style=monoblue">files</a></li>
@@ -842,5 +842,5 @@ Set up the repo
       <a href="/log/43c799df6e75/foo?style=monoblue">(0)</a> <a href="/log/tip/foo?style=monoblue">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy/?style=monoblue">files</a></li>
@@ -864,5 +864,5 @@ Set up the repo
   <a href="/rev/a7c1559b7bba?style=monoblue">changeset</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy?style=monoblue">files</a></li>
@@ -877,5 +877,5 @@ Set up the repo
   <dd><a href="/diff/9d8c40cba617/foo?style=monoblue">9d8c40cba617</a></dd>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'comparison/xyzzy/foo?style=monoblue' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'comparison/xyzzy/foo?style=monoblue' | egrep $REVLINKS
               <li><a href="/graph/xyzzy?style=monoblue">graph</a></li>
               <li><a href="/file/xyzzy?style=monoblue">files</a></li>
@@ -892,5 +892,5 @@ Set up the repo
 (De)referencing symbolic revisions (spartan)
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=spartan' | egrep $REVLINKS
   <a href="/log/tip?style=spartan">changelog</a>
   <a href="/graph/tip?style=spartan">graph</a>
@@ -903,5 +903,5 @@ Set up the repo
   navigate: <small class="navigate"><a href="/shortlog/43c799df6e75?style=spartan">(0)</a> <a href="/shortlog/tip?style=spartan">tip</a> </small>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log?style=spartan' | egrep $REVLINKS
   <a href="/shortlog/tip?style=spartan">shortlog</a>
   <a href="/graph/tip?style=spartan">graph</a>
@@ -920,5 +920,5 @@ Set up the repo
   navigate: <small class="navigate"><a href="/log/43c799df6e75?style=spartan">(0)</a>  <a href="/log/tip?style=spartan">tip</a> </small>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph?style=spartan' | egrep $REVLINKS
   <a href="/log/tip?style=spartan">changelog</a>
   <a href="/shortlog/tip?style=spartan">shortlog</a>
@@ -927,11 +927,11 @@ Set up the repo
   navigate: <small class="navigate"><a href="/graph/43c799df6e75?style=spartan">(0)</a> <a href="/graph/tip?style=spartan">tip</a> </small>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'tags?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'tags?style=spartan' | egrep $REVLINKS
   <a href="/rev/9d8c40cba617?style=spartan">tip</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'branches?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'branches?style=spartan' | egrep $REVLINKS
   <a href="/shortlog/9d8c40cba617?style=spartan" class="open">default</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file?style=spartan' | egrep $REVLINKS
   <a href="/log/tip?style=spartan">changelog</a>
   <a href="/shortlog/tip?style=spartan">shortlog</a>
@@ -945,5 +945,5 @@ Set up the repo
   <td><a href="/file/tip/foo?style=spartan">foo</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog?style=spartan&rev=all()' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog?style=spartan&rev=all()' | egrep $REVLINKS
   <a href="/archive/tip.zip">zip</a>
     <td class="node"><a href="/rev/9d8c40cba617?style=spartan">9d8c40cba617</a></td>
@@ -961,5 +961,5 @@ Set up the repo
     <td class="files"><a href="/diff/43c799df6e75/dir/bar?style=spartan">dir/bar</a> <a href="/diff/43c799df6e75/foo?style=spartan">foo</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'rev/xyzzy?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'rev/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
@@ -973,5 +973,5 @@ Set up the repo
    <td class="files"><a href="/file/a7c1559b7bba/foo?style=spartan">foo</a> </td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'shortlog/xyzzy?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'shortlog/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/graph/xyzzy?style=spartan">graph</a>
@@ -983,5 +983,5 @@ Set up the repo
   navigate: <small class="navigate"><a href="/shortlog/43c799df6e75?style=spartan">(0)</a> <a href="/shortlog/tip?style=spartan">tip</a> </small>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
   <a href="/graph/xyzzy?style=spartan">graph</a>
@@ -997,5 +997,5 @@ Set up the repo
   navigate: <small class="navigate"><a href="/log/43c799df6e75?style=spartan">(0)</a>  <a href="/log/tip?style=spartan">tip</a> </small>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'graph/xyzzy?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'graph/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
@@ -1004,5 +1004,5 @@ Set up the repo
   navigate: <small class="navigate"><a href="/graph/43c799df6e75?style=spartan">(0)</a> <a href="/graph/tip?style=spartan">tip</a> </small>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
@@ -1016,5 +1016,5 @@ Set up the repo
   <td><a href="/file/xyzzy/foo?style=spartan">foo</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/xyzzy/foo?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'file/xyzzy/foo?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
@@ -1029,5 +1029,5 @@ Set up the repo
   <td><a href="/file/9d8c40cba617/foo?style=spartan">9d8c40cba617</a></td>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'log/xyzzy/foo?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'log/xyzzy/foo?style=spartan' | egrep $REVLINKS
      href="/atom-log/tip/foo" title="Atom feed for test:foo">
      href="/rss-log/tip/foo" title="RSS feed for test:foo">
@@ -1046,5 +1046,5 @@ Set up the repo
      <a href="/annotate/43c799df6e75/foo?style=spartan">(annotate)</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'annotate/xyzzy/foo?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'annotate/xyzzy/foo?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
@@ -1068,5 +1068,5 @@ Set up the repo
   <a href="/rev/a7c1559b7bba?style=spartan">changeset</a>
 
-  $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS
+  $ "$TESTDIR/get-with-headers.py" $LOCALIP:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS
   <a href="/log/xyzzy?style=spartan">changelog</a>
   <a href="/shortlog/xyzzy?style=spartan">shortlog</a>
diff --git a/tests/test-hgwebdir.t b/tests/test-hgwebdir.t
--- a/tests/test-hgwebdir.t
+++ b/tests/test-hgwebdir.t
@@ -1422,5 +1422,5 @@ test listening address/port specified by
   $ hg serve -d --pid-file=hg.pid --web-conf paths.conf \
   >     -A access-paths.log -E error-paths-9.log
-  listening at <a href="http://*:$HGPORT1/">http://*:$HGPORT1/ (bound to 127.0.0.1:$HGPORT1) (glob)
+  listening at <a href="http://*:$HGPORT1/">http://*:$HGPORT1/ (bound to *$LOCALIP*:$HGPORT1) (glob)
   $ cat hg.pid >> $DAEMON_PIDS
   $ get-with-headers.py localhost:$HGPORT1 '?style=raw'
@@ -1434,5 +1434,5 @@ test --port option overrides web.port:
   $ hg serve -p $HGPORT2 -d -v --pid-file=hg.pid --web-conf paths.conf \
   >     -A access-paths.log -E error-paths-10.log
-  listening at <a href="http://*:$HGPORT2/">http://*:$HGPORT2/ (bound to 127.0.0.1:$HGPORT2) (glob)
+  listening at <a href="http://*:$HGPORT2/">http://*:$HGPORT2/ (bound to *$LOCALIP*:$HGPORT2) (glob)
   $ cat hg.pid >> $DAEMON_PIDS
   $ get-with-headers.py localhost:$HGPORT2 '?style=raw'
diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t
--- a/tests/test-http-protocol.t
+++ b/tests/test-http-protocol.t
@@ -17,7 +17,7 @@ compression formats are advertised in co
 
 #if zstd
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zstd,zlib$' > /dev/null
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zstd,zlib$' > /dev/null
 #else
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zlib$' > /dev/null
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=zlib$' > /dev/null
 #endif
 
@@ -28,5 +28,5 @@ server.compressionengines can replace en
   $ hg --config server.compressionengines=none -R server serve -p $HGPORT -d --pid-file hg.pid
   $ cat hg.pid > $DAEMON_PIDS
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null
 
   $ killdaemons.py
@@ -36,5 +36,5 @@ Order of engines can also change
   $ hg --config server.compressionengines=none,zlib -R server serve -p $HGPORT -d --pid-file hg.pid
   $ cat hg.pid > $DAEMON_PIDS
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null
 
   $ killdaemons.py
@@ -47,5 +47,5 @@ Start a default server again
 Server should send application/mercurial-0.1 to clients if no Accept is used
 
-  $ get-with-headers.py --headeronly 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
+  $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
   200 Script output follows
   content-type: application/mercurial-0.1
@@ -56,5 +56,5 @@ Server should send application/mercurial
 Server should send application/mercurial-0.1 when client says it wants it
 
-  $ get-with-headers.py --hgproto '0.1' --headeronly 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
+  $ get-with-headers.py --hgproto '0.1' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
   200 Script output follows
   content-type: application/mercurial-0.1
@@ -65,5 +65,5 @@ Server should send application/mercurial
 Server should send application/mercurial-0.2 when client says it wants it
 
-  $ get-with-headers.py --hgproto '0.2' --headeronly 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
+  $ get-with-headers.py --hgproto '0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
   200 Script output follows
   content-type: application/mercurial-0.2
@@ -72,5 +72,5 @@ Server should send application/mercurial
   transfer-encoding: chunked
 
-  $ get-with-headers.py --hgproto '0.1 0.2' --headeronly 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
+  $ get-with-headers.py --hgproto '0.1 0.2' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
   200 Script output follows
   content-type: application/mercurial-0.2
@@ -81,5 +81,5 @@ Server should send application/mercurial
 Requesting a compression format that server doesn't support results will fall back to 0.1
 
-  $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
+  $ get-with-headers.py --hgproto '0.2 comp=aa' --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' -
   200 Script output follows
   content-type: application/mercurial-0.1
@@ -91,5 +91,5 @@ Requesting a compression format that ser
 zstd is used if available
 
-  $ get-with-headers.py --hgproto '0.2 comp=zstd' 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
+  $ get-with-headers.py --hgproto '0.2 comp=zstd' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' > resp
   $ f --size --hexdump --bytes 36 --sha1 resp
   resp: size=248, sha1=4d8d8f87fb82bd542ce52881fdc94f850748
@@ -102,5 +102,5 @@ zstd is used if available
 application/mercurial-0.2 is not yet used on non-streaming responses
 
-  $ get-with-headers.py --hgproto '0.2' 127.0.0.1:$HGPORT '?cmd=heads' -
+  $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=heads' -
   200 Script output follows
   content-length: 41
@@ -119,9 +119,9 @@ Now test protocol preference usage
 No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1
 
-  $ get-with-headers.py --headeronly 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type
+  $ get-with-headers.py --headeronly $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000' Content-Type
   200 Script output follows
   content-type: application/mercurial-0.1
 
-  $ get-with-headers.py 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
+  $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
   $ f --size --hexdump --bytes 28 --sha1 resp
   resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
@@ -131,5 +131,5 @@ No Accept will send 0.1+zlib, even thoug
 Explicit 0.1 will send zlib because "none" isn't supported on 0.1
 
-  $ get-with-headers.py --hgproto '0.1' 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
+  $ get-with-headers.py --hgproto '0.1' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
   $ f --size --hexdump --bytes 28 --sha1 resp
   resp: size=227, sha1=35a4c074da74f32f5440da3cbf04
@@ -140,5 +140,5 @@ 0.2 with no compression will get "none"
 (spec says ZL and UN are implicitly supported)
 
-  $ get-with-headers.py --hgproto '0.2' 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
+  $ get-with-headers.py --hgproto '0.2' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
   $ f --size --hexdump --bytes 32 --sha1 resp
   resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
@@ -148,5 +148,5 @@ 0.2 with no compression will get "none"
 Client receives server preference even if local order doesn't match
 
-  $ get-with-headers.py --hgproto '0.2 comp=zlib,none' 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
+  $ get-with-headers.py --hgproto '0.2 comp=zlib,none' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
   $ f --size --hexdump --bytes 32 --sha1 resp
   resp: size=432, sha1=ac931b412ec185a02e0e5bcff98dac83
@@ -156,5 +156,5 @@ Client receives server preference even i
 Client receives only supported format even if not server preferred format
 
-  $ get-with-headers.py --hgproto '0.2 comp=zlib' 127.0.0.1:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
+  $ get-with-headers.py --hgproto '0.2 comp=zlib' $LOCALIP:$HGPORT '?cmd=getbundle&heads=e93700bd72895c5addab234c56d4024b487a362f&common=0000000000000000000000000000000000000000'  > resp
   $ f --size --hexdump --bytes 33 --sha1 resp
   resp: size=232, sha1=a1c727f0c9693ca15742a75c30419bc36
diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -279,15 +279,15 @@ cacert mismatch
 
   $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
-  > <a href="https://127.0.0.1:$HGPORT/">https://127.0.0.1:$HGPORT/
-  pulling from <a href="https://127.0.0.1:$HGPORT/">https://127.0.0.1:$HGPORT/ (glob)
-  warning: connecting to 127.0.0.1 using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
-  abort: 127.0.0.1 certificate error: certificate is for localhost (glob)
-  (set hostsecurity.127.0.0.1:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely) (glob)
+  > <a href="https://$LOCALIP:$HGPORT/">https://$LOCALIP:$HGPORT/
+  pulling from <a href="https://*:$HGPORT/">https://*:$HGPORT/ (glob)
+  warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
+  abort: $LOCALIP certificate error: certificate is for localhost
+  (set hostsecurity.$LOCALIP:certfingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e config setting or use --insecure to connect insecurely)
   [255]
   $ hg -R copy-pull pull --config web.cacerts="$CERTSDIR/pub.pem" \
-  > <a href="https://127.0.0.1:$HGPORT/">https://127.0.0.1:$HGPORT/ --insecure
-  pulling from <a href="https://127.0.0.1:$HGPORT/">https://127.0.0.1:$HGPORT/ (glob)
-  warning: connecting to 127.0.0.1 using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
-  warning: connection security to 127.0.0.1 is disabled per current settings; communication is susceptible to eavesdropping and tampering (glob)
+  > <a href="https://$LOCALIP:$HGPORT/">https://$LOCALIP:$HGPORT/ --insecure
+  pulling from <a href="https://*:$HGPORT/">https://*:$HGPORT/ (glob)
+  warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
+  warning: connection security to $LOCALIP is disabled per current settings; communication is susceptible to eavesdropping and tampering
   searching for changes
   no changes found
@@ -435,6 +435,6 @@ Fingerprints
 
 - ignores that certificate doesn't match hostname
-  $ hg -R copy-pull id <a href="https://127.0.0.1:$HGPORT/">https://127.0.0.1:$HGPORT/ --config hostfingerprints.127.0.0.1=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
-  warning: connecting to 127.0.0.1 using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
+  $ hg -R copy-pull id <a href="https://$LOCALIP:$HGPORT/">https://$LOCALIP:$HGPORT/ --config hostfingerprints.$LOCALIP=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
+  warning: connecting to $LOCALIP using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
   5fed3813f7f5
 
@@ -572,7 +572,7 @@ Test https with cacert and fingerprint t
   searching for changes
   no changes found
-  $ http_proxy=<a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/ hg -R copy-pull pull <a href="https://127.0.0.1:$HGPORT/">https://127.0.0.1:$HGPORT/ --config hostfingerprints.127.0.0.1=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03
-  pulling from <a href="https://127.0.0.1:$HGPORT/">https://127.0.0.1:$HGPORT/ (glob)
-  warning: connecting to 127.0.0.1 using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
+  $ http_proxy=<a href="http://localhost:$HGPORT1/">http://localhost:$HGPORT1/ hg -R copy-pull pull <a href="https://localhost:$HGPORT/">https://localhost:$HGPORT/ --config hostfingerprints.localhost=ecd87cd6b386d04fc1b8b41c9d8f5e168eef1c03 --trace
+  pulling from <a href="https://*:$HGPORT/">https://*:$HGPORT/ (glob)
+  warning: connecting to localhost using legacy security technology (TLS 1.0); see https://mercurial-scm.org/wiki/SecureConnections for more info (?)
   searching for changes
   no changes found
diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t
--- a/tests/test-largefiles-wireproto.t
+++ b/tests/test-largefiles-wireproto.t
@@ -348,5 +348,5 @@ largefiles should batch verify remote ca
   verified existence of 2 revisions of 2 largefiles
   $ tail -1 access.log
-  127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
+  $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3D972a1a11f19934401291cc99117ec614933374ce%3Bstatlfile+sha%3Dc801c9cfe94400963fcb683246217d5db77f9a9a x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
   $ hg -R batchverifyclone update
   getting changed largefiles
@@ -385,5 +385,5 @@ available locally.
   verified existence of 3 revisions of 3 largefiles
   $ tail -1 access.log
-  127.0.0.1 - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
+  $LOCALIP - - [*] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=statlfile+sha%3Dc8559c3c9cfb42131794b7d8009230403b9b454c x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
 
   $ killdaemons.py
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -193,5 +193,5 @@ Test display of largefiles in hgweb
   $ hg serve -d -p $HGPORT --pid-file ../hg.pid
   $ cat ../hg.pid >> $DAEMON_PIDS
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw'
   200 Script output follows
   
@@ -202,5 +202,5 @@ Test display of largefiles in hgweb
   
   
-  $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
+  $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw'
   200 Script output follows
   
diff --git a/tests/test-push-http-bundle1.t b/tests/test-push-http-bundle1.t
--- a/tests/test-push-http-bundle1.t
+++ b/tests/test-push-http-bundle1.t
@@ -80,5 +80,5 @@ expect success
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   % serve errors
   $ hg rollback
@@ -96,5 +96,5 @@ expect success, server lacks the httphea
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   % serve errors
   $ hg rollback
@@ -112,5 +112,5 @@ expect success, server lacks the unbundl
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: changegroup hook: HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   % serve errors
   $ hg rollback
diff --git a/tests/test-push-http.t b/tests/test-push-http.t
--- a/tests/test-push-http.t
+++ b/tests/test-push-http.t
@@ -71,5 +71,5 @@ expect success
   remote: added 1 changesets with 1 changes to 1 files
   remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
-  remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   % serve errors
   $ hg rollback
@@ -88,5 +88,5 @@ expect success, server lacks the httphea
   remote: added 1 changesets with 1 changes to 1 files
   remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
-  remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   % serve errors
   $ hg rollback
@@ -105,5 +105,5 @@ expect success, server lacks the unbundl
   remote: added 1 changesets with 1 changes to 1 files
   remote: pushkey hook: HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_OLD=1 HG_RET=1
-  remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: changegroup hook: HG_BUNDLE2=1 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   % serve errors
   $ hg rollback
@@ -126,5 +126,5 @@ expect push success, phase change failur
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   remote: pushkey-abort: prepushkey hook exited with status 1
   remote: transaction abort!
@@ -146,5 +146,5 @@ expect phase change success
   remote: adding file changes
   remote: added 1 changesets with 1 changes to 1 files
-  remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:127.0.0.1: (glob)
+  remote: prepushkey hook: HG_BUNDLE2=1 HG_KEY=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NAMESPACE=phases HG_NEW=0 HG_NODE=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_NODE_LAST=ba677d0156c1196c1a699fa53f390dcfc3ce3872 HG_OLD=1 HG_PENDING=$TESTTMP/test HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:http:*: (glob)
   % serve errors
   $ hg rollback
diff --git a/tests/test-serve.t b/tests/test-serve.t
--- a/tests/test-serve.t
+++ b/tests/test-serve.t
@@ -35,5 +35,5 @@ With -v
 
   $ hgserve
-  listening at http://localhost/ (bound to 127.0.0.1:HGPORT1) (glob)
+  listening at http://localhost/ (bound to *$LOCALIP*:HGPORT1) (glob)
   % errors
 
@@ -41,5 +41,5 @@ With -v and -p HGPORT2
 
   $ hgserve -p "$HGPORT2"
-  listening at http://localhost/ (bound to 127.0.0.1:HGPORT2) (glob)
+  listening at http://localhost/ (bound to *$LOCALIP*:HGPORT2) (glob)
   % errors
 
@@ -58,5 +58,5 @@ With --prefix foo
 
   $ hgserve --prefix foo
-  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob)
+  listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob)
   % errors
 
@@ -64,5 +64,5 @@ With --prefix /foo
 
   $ hgserve --prefix /foo
-  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob)
+  listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob)
   % errors
 
@@ -70,5 +70,5 @@ With --prefix foo/
 
   $ hgserve --prefix foo/
-  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob)
+  listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob)
   % errors
 
@@ -76,5 +76,5 @@ With --prefix /foo/
 
   $ hgserve --prefix /foo/
-  listening at http://localhost/foo/ (bound to 127.0.0.1:HGPORT1) (glob)
+  listening at http://localhost/foo/ (bound to *$LOCALIP*:HGPORT1) (glob)
   % errors
 
diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t
--- a/tests/test-ssh-bundle1.t
+++ b/tests/test-ssh-bundle1.t
@@ -495,5 +495,5 @@ debug output
   Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
+  changegroup-in-remote hook: HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:$LOCALIP (glob)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -505,5 +505,5 @@ debug output
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
+  changegroup-in-remote hook: HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:$LOCALIP (glob)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg init 'a repo'
@@ -513,5 +513,5 @@ debug output
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
+  changegroup-in-remote hook: HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:$LOCALIP (glob)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
 
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -499,5 +499,5 @@ debug output
   Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
+  changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:$LOCALIP (glob)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
@@ -509,5 +509,5 @@ debug output
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
+  changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:$LOCALIP (glob)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
   Got arguments 1:user@dummy 2:hg init 'a repo'
@@ -517,5 +517,5 @@ debug output
   Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
-  changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:127.0.0.1 (glob)
+  changegroup-in-remote hook: HG_BUNDLE2=1 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8 HG_SOURCE=serve HG_TXNID=TXN:* HG_URL=remote:ssh:$LOCALIP (glob)
   Got arguments 1:user@dummy 2:hg -R remote serve --stdio
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1 of 8 ipv6] runtests: export HGIPV6 to hint test scripts whether to use IPv6

Danek Duvall-2
In reply to this post by Jun Wu
Jun Wu wrote:

> # HG changeset patch
> # User Jun Wu <[hidden email]>
> # Date 1487221422 28800
> #      Wed Feb 15 21:03:42 2017 -0800
> # Node ID f2743873dfbd6adedcd3aa1777b651ce5bd6f6ed
> # Parent  a70e11929c63cd9245812f3db8091a449cd1273e
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r f2743873dfbd
> runtests: export HGIPV6 to hint test scripts whether to use IPv6
>
> Previously, run-tests.py only exports HGPORT, and scripts in tests do not
> know if IPv6 should be used. And that breaks scripts like dumbhttp.py which
> always uses IPv4.
>
> This patch makes run-tests.py export HGIPV6, which can help test scripts
> like dumbhttp.py and tinyproxy.py to decide whether to use IPv6 or not.

So does this set of patches mean that if IPv6 is available on the test
machine, IPv4 won't be tested at all?

Thanks,
Danek
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1 of 8 ipv6] runtests: export HGIPV6 to hint test scripts whether to use IPv6

Jun Wu
Excerpts from Danek Duvall's message of 2017-02-16 09:51:14 -0800:

> Jun Wu wrote:
>
> > # HG changeset patch
> > # User Jun Wu <[hidden email]>
> > # Date 1487221422 28800
> > #      Wed Feb 15 21:03:42 2017 -0800
> > # Node ID f2743873dfbd6adedcd3aa1777b651ce5bd6f6ed
> > # Parent  a70e11929c63cd9245812f3db8091a449cd1273e
> > # Available At https://bitbucket.org/quark-zju/hg-draft 
> > #              hg pull https://bitbucket.org/quark-zju/hg-draft  -r f2743873dfbd
> > runtests: export HGIPV6 to hint test scripts whether to use IPv6
> >
> > Previously, run-tests.py only exports HGPORT, and scripts in tests do not
> > know if IPv6 should be used. And that breaks scripts like dumbhttp.py which
> > always uses IPv4.
> >
> > This patch makes run-tests.py export HGIPV6, which can help test scripts
> > like dumbhttp.py and tinyproxy.py to decide whether to use IPv6 or not.
>
> So does this set of patches mean that if IPv6 is available on the test
> machine, IPv4 won't be tested at all?

Yes, together with previous changes.

Before the series, it's basically impossible to test on v6.

With all the changes, it'll be easy to switch between v4 and v6 (by changing
"useipv6" in run-tests.py). I think we can add a new command line flag to
run-tests.py so people can choose whether they want to test v4 or v6.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1 of 8 ipv6] runtests: export HGIPV6 to hint test scripts whether to use IPv6

Danek Duvall-2
Jun Wu wrote:

> With all the changes, it'll be easy to switch between v4 and v6 (by changing
> "useipv6" in run-tests.py). I think we can add a new command line flag to
> run-tests.py so people can choose whether they want to test v4 or v6.

Or both?  Would it be useful consider one to be primary and the other
secondary, and to always test only a subset of networking-related tests on
the secondary if it's available?  Running the entire testsuite twice just
to make sure that nothing's broken on both IPv4 and IPv6 seems like
overkill to me.

Danek
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1 of 8 ipv6] runtests: export HGIPV6 to hint test scripts whether to use IPv6

Jun Wu
Excerpts from Danek Duvall's message of 2017-02-16 10:27:58 -0800:
> Or both?  Would it be useful consider one to be primary and the other
> secondary, and to always test only a subset of networking-related tests on
> the secondary if it's available?  Running the entire testsuite twice just
> to make sure that nothing's broken on both IPv4 and IPv6 seems like
> overkill to me.

Since hg does not have v4/v6 specific behavior, I don't think it's that
important to test both by default. People who want to be more confident
could always run a subset of tests with the override flag (which will be
provided soon(tm)).

That said, if someone writes patches, I'll be happy to review them.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 4 of 8 ipv6] runtests: set web.address to localhost

Martin von Zweigbergk via Mercurial-devel
In reply to this post by Jun Wu
On Thu, Feb 16, 2017 at 9:39 AM, Jun Wu <[hidden email]> wrote:

> # HG changeset patch
> # User Jun Wu <[hidden email]>
> # Date 1487232809 28800
> #      Thu Feb 16 00:13:29 2017 -0800
> # Node ID 91137c500c4f8761c2d70bab7438d8d87959bd15
> # Parent  72115e4deca500bd6da1929479a966b8b0eb0e1d
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 91137c500c4f
> runtests: set web.address to localhost
>
> Previously, "hg serve" will listen on "", which is not clear which interface
> it will actually listen on - it could listen on all interfaces (ex. 0.0.0.0
> on IPv4).
>
> The run-tests.py script only checks "localhost" for available ports. So
> let's make it the same for "hg serve" by explicitly setting "web.address" to
> "localhost".

But there are still tests that try connect to 127.0.0.1. Lots of tests
fail with this patch. I've queued up to 3/8. Can you resend the other
5, with this one moved after the $LOCALIP patches?

>
> This resolves some IPv6 EADDRINUSE errors.
>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -918,4 +918,6 @@ class Test(unittest.TestCase):
>          hgrc.write(b'usercache = %s\n' %
>                     (os.path.join(self._testtmp, b'.cache/largefiles')))
> +        hgrc.write(b'[web]\n')
> +        hgrc.write(b'address = localhost\n')
>
>          for opt in self._extraconfigopts:
> diff --git a/tests/test-basic.t b/tests/test-basic.t
> --- a/tests/test-basic.t
> +++ b/tests/test-basic.t
> @@ -12,4 +12,5 @@ Create a repository:
>    ui.mergemarkers=detailed
>    ui.promptecho=True
> +  web.address=localhost
>    web.ipv6=True (?)
>    $ hg init t
> diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
> --- a/tests/test-commandserver.t
> +++ b/tests/test-commandserver.t
> @@ -200,4 +200,5 @@ check that local configs for the cached
>    ui.foo=bar
>    ui.nontty=true
> +  web.address=localhost
>    web.ipv6=True (?)
>    *** runcommand init foo
> diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
> --- a/tests/test-http-bundle1.t
> +++ b/tests/test-http-bundle1.t
> @@ -29,9 +29,9 @@ Test server address cannot be reused
>  #if windows
>    $ hg serve -p $HGPORT1 2>&1
> -  abort: cannot start server at ':$HGPORT1': * (glob)
> +  abort: cannot start server at 'localhost:$HGPORT1': * (glob)
>    [255]
>  #else
>    $ hg serve -p $HGPORT1 2>&1
> -  abort: cannot start server at ':$HGPORT1': Address already in use
> +  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
>    [255]
>  #endif
> diff --git a/tests/test-http.t b/tests/test-http.t
> --- a/tests/test-http.t
> +++ b/tests/test-http.t
> @@ -24,5 +24,5 @@ Test server address cannot be reused
>  #else
>    $ hg serve -p $HGPORT1 2>&1
> -  abort: cannot start server at ':$HGPORT1': Address already in use
> +  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
>    [255]
>  #endif
> diff --git a/tests/test-https.t b/tests/test-https.t
> --- a/tests/test-https.t
> +++ b/tests/test-https.t
> @@ -37,9 +37,9 @@ Test server address cannot be reused
>  #if windows
>    $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
> -  abort: cannot start server at ':$HGPORT':
> +  abort: cannot start server at 'localhost:$HGPORT':
>    [255]
>  #else
>    $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
> -  abort: cannot start server at ':$HGPORT': Address already in use
> +  abort: cannot start server at 'localhost:$HGPORT': Address already in use
>    [255]
>  #endif
> _______________________________________________
> Mercurial-devel mailing list
> [hidden email]
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 4 of 8 ipv6] runtests: set web.address to localhost

Martin von Zweigbergk via Mercurial-devel
On Thu, Feb 16, 2017 at 10:54 PM, Martin von Zweigbergk
<[hidden email]> wrote:

> On Thu, Feb 16, 2017 at 9:39 AM, Jun Wu <[hidden email]> wrote:
>> # HG changeset patch
>> # User Jun Wu <[hidden email]>
>> # Date 1487232809 28800
>> #      Thu Feb 16 00:13:29 2017 -0800
>> # Node ID 91137c500c4f8761c2d70bab7438d8d87959bd15
>> # Parent  72115e4deca500bd6da1929479a966b8b0eb0e1d
>> # Available At https://bitbucket.org/quark-zju/hg-draft
>> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 91137c500c4f
>> runtests: set web.address to localhost
>>
>> Previously, "hg serve" will listen on "", which is not clear which interface
>> it will actually listen on - it could listen on all interfaces (ex. 0.0.0.0
>> on IPv4).
>>
>> The run-tests.py script only checks "localhost" for available ports. So
>> let's make it the same for "hg serve" by explicitly setting "web.address" to
>> "localhost".
>
> But there are still tests that try connect to 127.0.0.1. Lots of tests
> fail with this patch. I've queued up to 3/8. Can you resend the other
> 5, with this one moved after the $LOCALIP patches?

Patch 3 fails for the same reason. Sorry, I missed that before. I'll
drop the whole series for now.

>
>>
>> This resolves some IPv6 EADDRINUSE errors.
>>
>> diff --git a/tests/run-tests.py b/tests/run-tests.py
>> --- a/tests/run-tests.py
>> +++ b/tests/run-tests.py
>> @@ -918,4 +918,6 @@ class Test(unittest.TestCase):
>>          hgrc.write(b'usercache = %s\n' %
>>                     (os.path.join(self._testtmp, b'.cache/largefiles')))
>> +        hgrc.write(b'[web]\n')
>> +        hgrc.write(b'address = localhost\n')
>>
>>          for opt in self._extraconfigopts:
>> diff --git a/tests/test-basic.t b/tests/test-basic.t
>> --- a/tests/test-basic.t
>> +++ b/tests/test-basic.t
>> @@ -12,4 +12,5 @@ Create a repository:
>>    ui.mergemarkers=detailed
>>    ui.promptecho=True
>> +  web.address=localhost
>>    web.ipv6=True (?)
>>    $ hg init t
>> diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
>> --- a/tests/test-commandserver.t
>> +++ b/tests/test-commandserver.t
>> @@ -200,4 +200,5 @@ check that local configs for the cached
>>    ui.foo=bar
>>    ui.nontty=true
>> +  web.address=localhost
>>    web.ipv6=True (?)
>>    *** runcommand init foo
>> diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
>> --- a/tests/test-http-bundle1.t
>> +++ b/tests/test-http-bundle1.t
>> @@ -29,9 +29,9 @@ Test server address cannot be reused
>>  #if windows
>>    $ hg serve -p $HGPORT1 2>&1
>> -  abort: cannot start server at ':$HGPORT1': * (glob)
>> +  abort: cannot start server at 'localhost:$HGPORT1': * (glob)
>>    [255]
>>  #else
>>    $ hg serve -p $HGPORT1 2>&1
>> -  abort: cannot start server at ':$HGPORT1': Address already in use
>> +  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
>>    [255]
>>  #endif
>> diff --git a/tests/test-http.t b/tests/test-http.t
>> --- a/tests/test-http.t
>> +++ b/tests/test-http.t
>> @@ -24,5 +24,5 @@ Test server address cannot be reused
>>  #else
>>    $ hg serve -p $HGPORT1 2>&1
>> -  abort: cannot start server at ':$HGPORT1': Address already in use
>> +  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
>>    [255]
>>  #endif
>> diff --git a/tests/test-https.t b/tests/test-https.t
>> --- a/tests/test-https.t
>> +++ b/tests/test-https.t
>> @@ -37,9 +37,9 @@ Test server address cannot be reused
>>  #if windows
>>    $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
>> -  abort: cannot start server at ':$HGPORT':
>> +  abort: cannot start server at 'localhost:$HGPORT':
>>    [255]
>>  #else
>>    $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
>> -  abort: cannot start server at ':$HGPORT': Address already in use
>> +  abort: cannot start server at 'localhost:$HGPORT': Address already in use
>>    [255]
>>  #endif
>> _______________________________________________
>> Mercurial-devel mailing list
>> [hidden email]
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 4 of 8 ipv6] runtests: set web.address to localhost

Jun Wu
In reply to this post by Martin von Zweigbergk via Mercurial-devel
Excerpts from Martin von Zweigbergk's message of 2017-02-16 22:54:58 -0800:

> On Thu, Feb 16, 2017 at 9:39 AM, Jun Wu <[hidden email]> wrote:
> > # HG changeset patch
> > # User Jun Wu <[hidden email]>
> > # Date 1487232809 28800
> > #      Thu Feb 16 00:13:29 2017 -0800
> > # Node ID 91137c500c4f8761c2d70bab7438d8d87959bd15
> > # Parent  72115e4deca500bd6da1929479a966b8b0eb0e1d
> > # Available At https://bitbucket.org/quark-zju/hg-draft 
> > #              hg pull https://bitbucket.org/quark-zju/hg-draft  -r 91137c500c4f
> > runtests: set web.address to localhost
> >
> > Previously, "hg serve" will listen on "", which is not clear which interface
> > it will actually listen on - it could listen on all interfaces (ex. 0.0.0.0
> > on IPv4).
> >
> > The run-tests.py script only checks "localhost" for available ports. So
> > let's make it the same for "hg serve" by explicitly setting "web.address" to
> > "localhost".
>
> But there are still tests that try connect to 127.0.0.1. Lots of tests
> fail with this patch. I've queued up to 3/8. Can you resend the other
> 5, with this one moved after the $LOCALIP patches?

I see what you mean. I'll reorder the patch. Thanks!

> >
> > This resolves some IPv6 EADDRINUSE errors.
> >
> > diff --git a/tests/run-tests.py b/tests/run-tests.py
> > --- a/tests/run-tests.py
> > +++ b/tests/run-tests.py
> > @@ -918,4 +918,6 @@ class Test(unittest.TestCase):
> >          hgrc.write(b'usercache = %s\n' %
> >                     (os.path.join(self._testtmp, b'.cache/largefiles')))
> > +        hgrc.write(b'[web]\n')
> > +        hgrc.write(b'address = localhost\n')
> >
> >          for opt in self._extraconfigopts:
> > diff --git a/tests/test-basic.t b/tests/test-basic.t
> > --- a/tests/test-basic.t
> > +++ b/tests/test-basic.t
> > @@ -12,4 +12,5 @@ Create a repository:
> >    ui.mergemarkers=detailed
> >    ui.promptecho=True
> > +  web.address=localhost
> >    web.ipv6=True (?)
> >    $ hg init t
> > diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t
> > --- a/tests/test-commandserver.t
> > +++ b/tests/test-commandserver.t
> > @@ -200,4 +200,5 @@ check that local configs for the cached
> >    ui.foo=bar
> >    ui.nontty=true
> > +  web.address=localhost
> >    web.ipv6=True (?)
> >    *** runcommand init foo
> > diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t
> > --- a/tests/test-http-bundle1.t
> > +++ b/tests/test-http-bundle1.t
> > @@ -29,9 +29,9 @@ Test server address cannot be reused
> >  #if windows
> >    $ hg serve -p $HGPORT1 2>&1
> > -  abort: cannot start server at ':$HGPORT1': * (glob)
> > +  abort: cannot start server at 'localhost:$HGPORT1': * (glob)
> >    [255]
> >  #else
> >    $ hg serve -p $HGPORT1 2>&1
> > -  abort: cannot start server at ':$HGPORT1': Address already in use
> > +  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
> >    [255]
> >  #endif
> > diff --git a/tests/test-http.t b/tests/test-http.t
> > --- a/tests/test-http.t
> > +++ b/tests/test-http.t
> > @@ -24,5 +24,5 @@ Test server address cannot be reused
> >  #else
> >    $ hg serve -p $HGPORT1 2>&1
> > -  abort: cannot start server at ':$HGPORT1': Address already in use
> > +  abort: cannot start server at 'localhost:$HGPORT1': Address already in use
> >    [255]
> >  #endif
> > diff --git a/tests/test-https.t b/tests/test-https.t
> > --- a/tests/test-https.t
> > +++ b/tests/test-https.t
> > @@ -37,9 +37,9 @@ Test server address cannot be reused
> >  #if windows
> >    $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
> > -  abort: cannot start server at ':$HGPORT':
> > +  abort: cannot start server at 'localhost:$HGPORT':
> >    [255]
> >  #else
> >    $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
> > -  abort: cannot start server at ':$HGPORT': Address already in use
> > +  abort: cannot start server at 'localhost:$HGPORT': Address already in use
> >    [255]
> >  #endif
> > _______________________________________________
> > Mercurial-devel mailing list
> > [hidden email]
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel