qa: Improve functional test support on illumos and *BSD #35216

pull hebasto wants to merge 7 commits into bitcoin:master from hebasto:260505-illumos-bind changing 6 files +23 −7
  1. hebasto commented at 6:37 PM on May 5, 2026: member

    This PR is a follow-up to #34256. It extends functional test support to illumos-based OSes and fixes several related issues on the *BSDs.

    Changes:

    • Make lsof an optional functional test dependency via a new skip_if_no_lsof helper, consistent with other optional test deps.
    • Strip the CIDR prefix length from NetBSD ifconfig output (no-op on other platforms).
    • Suppress spurious lsof warnings on NetBSD.
    • Drop OpenBSD from the platforms supported by get_bind_addrs.
    • Document the lsof Test Suite Dependency for FreeBSD and NetBSD.
    • Add support for get_bind_addrs and feature_bind_extra on illumos.

    CI runs: https://github.com/hebasto/bitcoin-core-nightly/pull/280.

    Addresses #34256 (comment).

  2. hebasto added the label Tests on May 5, 2026
  3. DrahtBot commented at 6:37 PM on May 5, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35216.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK l0rinc
    Concept ACK fanquake

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #35395 (doc: Improve test suite dependencies documentation by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. hebasto marked this as a draft on May 5, 2026
  5. l0rinc commented at 9:41 AM on May 6, 2026: contributor

    code review ACK 9b7788b94d09fc368258b9b047a1842bc3dea8ed

  6. l0rinc commented at 12:45 PM on May 6, 2026: contributor
  7. fanquake commented at 10:20 AM on May 26, 2026: member

    Concept ACK - seems fine given such a small diff. Why is it a draft?

    Do we also need to trim the CIDR suffix, see https://github.com/hebasto/bitcoin-core-nightly/actions/runs/25427210121/job/74583785372#step:9:501?

    Seems like the NetBSD tests were also broken; should include those changes here?

  8. hebasto commented at 10:25 AM on May 26, 2026: member

    Why is it a draft?

    Seems like the NetBSD tests were also broken; should include those changes here?

    There are a few points to do:

    1. Check the fixed tests on NetBSD locally.
    2. Update the build documentation to mention the lsof package where needed.
  9. hebasto force-pushed on Jun 26, 2026
  10. in test/functional/test_framework/test_framework.py:1032 in b3a71f577f outdated
    1026 | @@ -1027,6 +1027,11 @@ def skip_if_platform_not_linux(self):
    1027 |          if platform.system() != "Linux":
    1028 |              raise SkipTest("not on a Linux system")
    1029 |  
    1030 | +    def skip_if_no_lsof(self):
    1031 | +        """Skip the running test if the lsof utility is not available on non-Linux platforms."""
    1032 | +        if sys.platform != "linux" and shutil.which("lsof") is None:
    


    l0rinc commented at 5:08 PM on June 26, 2026:

    b3a71f5 qa: Add skip_if_no_lsof helper and use it where needed:

    nit: the sys.platform != "linux" part indicates the name should probably be adjusted.

  11. l0rinc approved
  12. l0rinc commented at 6:25 PM on June 26, 2026: contributor

    The OpenIndiana logs show IPv6 bind failing (so it's likely not finished yet), but the change still makes sense, thanks for continuing the work on this.

    approach ACK, reviewed 943b232cf0912597bf8252f518489930166fa27b

  13. hebasto renamed this:
    qa: Support `get_bind_addrs` and `feature_bind_extra` on illumos
    qa: Improve functional test support on illumos and *BSD
    on Jun 27, 2026
  14. hebasto force-pushed on Jun 27, 2026
  15. hebasto marked this as ready for review on Jun 27, 2026
  16. qa: Add `skip_if_no_lsof_on_nonlinux` helper and use it where needed
    Some functional tests on non-Linux platforms rely on the `lsof` utility.
    However, we treat all other functional test dependencies, such as
    additional Python modules, as optional, and skip dependent tests if
    those are unavailable.
    
    This change makes `lsof` optional as well.
    8a982eea85
  17. qa: Drop OpenBSD from supported platforms in `get_bind_addrs` function 4cb7f39c2c
  18. doc: Add `lsof` to Test Suite Dependencies on FreeBSD 1c1735567e
  19. qa: Strip prefix length from NetBSD `ifconfig` output
    Modern NetBSD `ifconfig` prints interface addresses in CIDR notation
    (e.g. `inet 127.0.0.1/8`), unlike the other supported platforms which
    print the netmask as a separate field. The trailing prefix length breaks
    functional tests that expect a plain IP address.
    
    This change is a no-op on other platforms.
    70352fda03
  20. qa: Ignore `lsof` warnings on NetBSD
    On NetBSD, `lsof` can produce the following warnings:
    1. "created device cache file: ..." - usually happens in a CI
    environment.
    2. "compiled for NetBSD release 10.0; this is 10.1." or similar - when
    the `lsof` binary package is installed on a point release.
    
    This change suppresses both warnings printed to stderr and fixes the
    affected tests.
    5d01aa4772
  21. doc: Add `lsof` to Test Suite Dependencies on NetBSD 5e96a8fd5a
  22. qa: Support `get_bind_addrs` and `feature_bind_extra` on illumos
    This extends support for `get_bind_addrs` and `feature_bind_extra` to
    illumos-based OSes.
    f4a6d079c4
  23. hebasto force-pushed on Jun 29, 2026
  24. sedited commented at 9:02 PM on July 23, 2026: contributor

    @l0rinc can you give this another look?

  25. in test/functional/test_framework/netutil.py:99 in 4cb7f39c2c
      94 | @@ -95,7 +95,8 @@ def get_bind_addrs(pid):
      95 |              if conn[3] == STATE_LISTEN and conn[4] in inodes:
      96 |                  bind_addrs.append(conn[1])
      97 |          return bind_addrs
      98 | -    elif sys.platform.startswith(("darwin", "freebsd", "netbsd", "openbsd")):
      99 | +    # OpenBSD is not included, as it does not ship the lsof utility.
     100 | +    elif sys.platform.startswith(("darwin", "freebsd", "netbsd")):
    


    l0rinc commented at 9:29 PM on July 23, 2026:

    4cb7f39 qa: Drop OpenBSD from supported platforms in get_bind_addrs function:

    Is this still needed? Since skip_if_no_lsof_on_nonlinux() already handles missing lsof, should we keep openbsd here?


    hebasto commented at 11:01 AM on July 24, 2026:

    The following branch is dead code on OpenBSD. It might be better to make it explicit that this isn't executed there.


    l0rinc commented at 5:37 PM on July 24, 2026:

    The following branch is dead code on OpenBSD

    It doesn't have to be, it could have lsof installed, in which case the test would run successfully and only this line prevents it - or do I misunderstand something?


    hebasto commented at 6:09 PM on July 24, 2026:

    Do you believe that after the lsof package was removed from ports back in 2016, supported OpenBSD installations would build it from source?


    l0rinc commented at 6:11 PM on July 24, 2026:

    I'm not a BSD user myself so I don't know, but my understanding is that it's still possible to install it manually and those users might want to see this test passing instead of being skipped. But it's just a nit from me regardless, I'm fine with merging as-is.

  26. l0rinc approved
  27. l0rinc commented at 9:30 PM on July 23, 2026: contributor

    Lightly tested code review ACK f4a6d079c42bb921dd753fab44ec7c819a9f2307

  28. DrahtBot requested review from fanquake on Jul 23, 2026

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-08-01 17:51 UTC

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