I noticed that test_ipv6_local() always returns False on macOS or FreeBSD, even though IPv6 is working perfectly fine. This causes test/functional/rpc_bind.py --ipv6 and test/functional/feature_proxy.py to skip their run.
Apparently, there's a check if the port number is 0 (see here or here), while Linux has no problem with this.
This is fixed by specifying any other port number than 0, e.g. 1. Still, because of SOCK_DGRAM, no actual connection is made.
test: Fix IPv6 check on BSD systems #22103
pull n-thumann wants to merge 1 commits into bitcoin:master from n-thumann:fix_test_bsd_port_0 changing 1 files +1 −1-
n-thumann commented at 9:48 PM on May 30, 2021: contributor
-
test: Fix IPv6 check on BSD systems 2be3572506
- DrahtBot added the label Tests on May 30, 2021
- theStack approved
-
theStack commented at 10:31 PM on May 30, 2021: member
Nice find, thanks for improving the test framework for *BSD users!
I can confirm that the fix also works on OpenBSD 6.9. :rocket:
master branch:
$ python3 Python 3.8.8 (default, Apr 19 2021, 10:23:47) [Clang 10.0.1 ] on openbsd6 Type "help", "copyright", "credits" or "license" for more information. >>> from test.functional.test_framework.netutil import test_ipv6_local >>> test_ipv6_local() False >>>PR branch:
$ python3 Python 3.8.8 (default, Apr 19 2021, 10:23:47) [Clang 10.0.1 ] on openbsd6 Type "help", "copyright", "credits" or "license" for more information. >>> from test.functional.test_framework.netutil import test_ipv6_local >>> test_ipv6_local() True >>>ACK 2be35725069fd4c589497b93e09e1c6db6946372
-
fanquake commented at 2:21 AM on May 31, 2021: member
ACK 2be35725069fd4c589497b93e09e1c6db6946372 - nice improvement. I checked that with this change ipv6 related tests in
feature_proxy.pyare being run.This causes test/functional/rpc_bind.py --ipv6 and test/functional/feature_proxy.py to skip their run.
Note that
rpc_bind.py --ipv6is still going to be skipped on anything other than Linux due to: - MarcoFalke merged this on May 31, 2021
- MarcoFalke closed this on May 31, 2021
- sidhujag referenced this in commit e0c757c68a on Jun 1, 2021
- PastaPastaPasta referenced this in commit 8c939aa0aa on Jun 27, 2021
- PastaPastaPasta referenced this in commit 9eaa36c57e on Jun 28, 2021
- PastaPastaPasta referenced this in commit d25d1055d3 on Jun 29, 2021
- PastaPastaPasta referenced this in commit 6c3cfaaf50 on Jul 1, 2021
- PastaPastaPasta referenced this in commit ae0b6f277a on Jul 1, 2021
- PastaPastaPasta referenced this in commit 106e69f979 on Jul 15, 2021
- gwillen referenced this in commit ec674d3ecb on Jun 1, 2022
- DrahtBot locked this on Aug 18, 2022