runtests: catch EPROTONOSUPPORT in checkportisavailable
authorJun Wu <quark@fb.com>
Fri, 10 Feb 2017 04:09:06 -0800
changeset 30896 b9116befa784
parent 30895 c32454d69b85
child 30897 253d5c0f3a2f
runtests: catch EPROTONOSUPPORT in checkportisavailable This is a follow-up of "runtests: check ports on IPv6 address". On some platforms, "socket.AF_INET6" exists while that does not necessarily mean the platform support IPv6 - when initializing a socket using "socket.socket", it could fail with EPROTONOSUPPORT. So treat that as "Port unavailable".
tests/run-tests.py
--- a/tests/run-tests.py	Tue Feb 07 23:24:47 2017 -0800
+++ b/tests/run-tests.py	Fri Feb 10 04:09:06 2017 -0800
@@ -124,7 +124,8 @@
             s.close()
             return True
         except socket.error as exc:
-            if exc.errno not in (errno.EADDRINUSE, errno.EADDRNOTAVAIL):
+            if exc.errno not in (errno.EADDRINUSE, errno.EADDRNOTAVAIL,
+                                 errno.EPROTONOSUPPORT):
                 raise
     return False