Files
bitcoin/test/functional/rpc_bind.py
merge-script f4903dddc9 Merge bitcoin/bitcoin#33433: Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found
79b4c276e7 Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found (Luke Dashjr)

Pull request description:

  Without this, I get:

  ```
  2025-09-19T03:14:05.157000Z TestFramework (INFO): PRNG seed is: 3218602557639511064
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin-test/a
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Check for ipv6
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Check for non-loopback interface
  2025-09-19T03:14:05.158000Z TestFramework (INFO): Bind test for []
  2025-09-19T03:14:05.516000Z TestFramework (INFO): Bind test for []
  2025-09-19T03:14:05.871000Z TestFramework (INFO): Bind test for ['[::1]']
  2025-09-19T03:14:06.227000Z TestFramework (INFO): Bind test for ['127.0.0.1', '[::1]']
  2025-09-19T03:14:06.583000Z TestFramework (INFO): Using interface None for testing
  2025-09-19T03:14:06.583000Z TestFramework (INFO): Bind test for [None]
  2025-09-19T03:14:06.583000Z TestFramework (ERROR): Unexpected exception
  Traceback (most recent call last):
    File "/Bitcoin/bitcoin/workingtree/test/functional/test_framework/test_framework.py", line 135, in main
      self.run_test()
      ~~~~~~~~~~~~~^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/rpc_bind.py", line 126, in run_test
      self._run_nonloopback_tests()
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/rpc_bind.py", line 157, in _run_nonloopback_tests
      self.run_bind_test([self.non_loopback_ip], self.non_loopback_ip, [self.non_loopback_ip],
      ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          [(self.non_loopback_ip, self.defaultport)])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/rpc_bind.py", line 38, in run_bind_test
      expected = [(addr_to_hex(addr), port) for (addr, port) in expected]
                   ~~~~~~~~~~~^^^^^^
    File "/Bitcoin/bitcoin/workingtree/test/functional/test_framework/netutil.py", line 132, in addr_to_hex
      if '.' in addr: # IPv4
         ^^^^^^^^^^^
  TypeError: argument of type 'NoneType' is not iterable
  ```

ACKs for top commit:
  maflcko:
    review ACK 79b4c276e7 🏑
  theStack:
    Tested ACK 79b4c276e7

Tree-SHA512: 2a723d9bc5d1d50a8321a4f8a8cac3da3125d373ea71e6cc9d03de07307008f58970e361490d4c34530a6a976cb078b62d0ef09b7fb321ca1cfb9249a70d99a5
2025-11-10 14:52:19 +00:00

8.4 KiB
Executable File