[PATCH 5 of 5] tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
Matt Harbison
mharbison72 at gmail.com
Sun Dec 3 06:54:58 UTC 2017
# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1512263008 18000
# Sat Dec 02 20:03:28 2017 -0500
# Node ID e3162dd60a20e55a1ff41185583c92788071e6db
# Parent 507dc98c238c04f1a6d1cc6c71ac60676a7d24a8
tests: add a substitution for EADDRINUSE/WSAEADDRINUSE messages
I suspect some more of these are globbed out, so this is a bit of future
proofing.
diff --git a/tests/common-pattern.py b/tests/common-pattern.py
--- a/tests/common-pattern.py
+++ b/tests/common-pattern.py
@@ -61,6 +61,14 @@
# FormatMessage(WSAECONNRESET)
br'An existing connection was forcibly closed by the remote host',
),
+ br'$EADDRINUSE$': (
+ # strerror()
+ br'Address already in use',
+
+ # FormatMessage(WSAEADDRINUSE)
+ br'Only one usage of each socket address'
+ br' \(protocol/network address/port\) is normally permitted',
+ ),
}
for replace, msgs in _errors.items():
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
@@ -26,15 +26,10 @@
Test server address cannot be reused
-#if windows
$ hg serve -p $HGPORT1 2>&1
- abort: cannot start server at 'localhost:$HGPORT1': * (glob)
+ abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
[255]
-#else
- $ hg serve -p $HGPORT1 2>&1
- abort: cannot start server at 'localhost:$HGPORT1': Address already in use
- [255]
-#endif
+
$ cd ..
$ cat hg1.pid hg2.pid >> $DAEMON_PIDS
diff --git a/tests/test-http.t b/tests/test-http.t
--- a/tests/test-http.t
+++ b/tests/test-http.t
@@ -17,15 +17,10 @@
Test server address cannot be reused
-#if windows
$ hg serve -p $HGPORT1 2>&1
- abort: cannot start server at 'localhost:$HGPORT1': * (glob)
+ abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
[255]
-#else
- $ hg serve -p $HGPORT1 2>&1
- abort: cannot start server at 'localhost:$HGPORT1': Address already in use
- [255]
-#endif
+
$ cd ..
$ cat hg1.pid hg2.pid >> $DAEMON_PIDS
diff --git a/tests/test-https.t b/tests/test-https.t
--- a/tests/test-https.t
+++ b/tests/test-https.t
@@ -34,15 +34,10 @@
Test server address cannot be reused
-#if windows
$ hg serve -p $HGPORT --certificate=$PRIV 2>&1
- abort: cannot start server at 'localhost:$HGPORT': * (glob)
+ abort: cannot start server at 'localhost:$HGPORT': $EADDRINUSE$
[255]
-#else
- $ hg serve -p $HGPORT --certificate=$PRIV 2>&1
- abort: cannot start server at 'localhost:$HGPORT': Address already in use
- [255]
-#endif
+
$ cd ..
Our test cert is not signed by a trusted CA. It should fail to verify if
More information about the Mercurial-devel
mailing list