Skip to content

Commit f4903dd

Browse files
committed
Merge bitcoin/bitcoin#33433: Bugfix: QA: rpc_bind: Skip nonloopback test if no such address is found
79b4c27 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 79b4c27 🏑 theStack: Tested ACK 79b4c27 Tree-SHA512: 2a723d9bc5d1d50a8321a4f8a8cac3da3125d373ea71e6cc9d03de07307008f58970e361490d4c34530a6a976cb078b62d0ef09b7fb321ca1cfb9249a70d99a5
2 parents 06e9458 + 79b4c27 commit f4903dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/functional/rpc_bind.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ def run_test(self):
123123
self.run_invalid_bind_test(['[::1]'], ['[::1]:notaport', '[::1]:-18443', '[::1]:0', '[::1]:65536'])
124124
self.run_invalid_allowip_test()
125125
if not self.options.run_ipv4 and not self.options.run_ipv6:
126-
self._run_nonloopback_tests()
126+
if self.non_loopback_ip:
127+
self._run_nonloopback_tests()
128+
else:
129+
self.log.info('Non-loopback IP address not found, skipping non-loopback tests')
127130

128131
def _run_loopback_tests(self):
129132
if self.options.run_ipv4:

0 commit comments

Comments
 (0)