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
  1. n-thumann commented at 9:48 PM on May 30, 2021: contributor

    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.

  2. test: Fix IPv6 check on BSD systems 2be3572506
  3. DrahtBot added the label Tests on May 30, 2021
  4. theStack approved
  5. 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

  6. 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.py are 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 --ipv6 is still going to be skipped on anything other than Linux due to:

    https://github.com/bitcoin/bitcoin/blob/619e930aa1860d92f8eebef3bc1bed8b37c606b8/test/functional/rpc_bind.py#L68-L70

  7. MarcoFalke merged this on May 31, 2021
  8. MarcoFalke closed this on May 31, 2021

  9. sidhujag referenced this in commit e0c757c68a on Jun 1, 2021
  10. PastaPastaPasta referenced this in commit 8c939aa0aa on Jun 27, 2021
  11. PastaPastaPasta referenced this in commit 9eaa36c57e on Jun 28, 2021
  12. PastaPastaPasta referenced this in commit d25d1055d3 on Jun 29, 2021
  13. PastaPastaPasta referenced this in commit 6c3cfaaf50 on Jul 1, 2021
  14. PastaPastaPasta referenced this in commit ae0b6f277a on Jul 1, 2021
  15. PastaPastaPasta referenced this in commit 106e69f979 on Jul 15, 2021
  16. gwillen referenced this in commit ec674d3ecb on Jun 1, 2022
  17. DrahtBot locked this on Aug 18, 2022
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me