aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-12-08 18:23:01 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2023-12-08 18:27:15 +0100
commitfd0bde2793239bd6d60a2435fa28df915cedd7e6 (patch)
tree2c50019ed495bc098c2594817b8ff5ee3eb815a0
parent3e691258d8789a4a89cce42e7e71b130491594d7 (diff)
test: fix `addnode` functional test failure on OpenBSD
This is the functional test counterpart of PR #28891 / commit 007d6f0e85bc329040bb405ef6016339518caa66.
-rwxr-xr-xtest/functional/rpc_net.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/functional/rpc_net.py b/test/functional/rpc_net.py
index b193ffd462..83dd8bc5cd 100755
--- a/test/functional/rpc_net.py
+++ b/test/functional/rpc_net.py
@@ -9,6 +9,7 @@ Tests correspond to code in rpc/net.cpp.
from decimal import Decimal
from itertools import product
+import platform
import time
import test_framework.messages
@@ -220,8 +221,10 @@ class NetTest(BitcoinTestFramework):
ip_port = "127.0.0.1:{}".format(p2p_port(2))
self.nodes[0].addnode(node=ip_port, command='add')
# try to add an equivalent ip
- ip_port2 = "127.1:{}".format(p2p_port(2))
- assert_raises_rpc_error(-23, "Node already added", self.nodes[0].addnode, node=ip_port2, command='add')
+ # (note that OpenBSD doesn't support the IPv4 shorthand notation with omitted zero-bytes)
+ if platform.system() != "OpenBSD":
+ ip_port2 = "127.1:{}".format(p2p_port(2))
+ assert_raises_rpc_error(-23, "Node already added", self.nodes[0].addnode, node=ip_port2, command='add')
# check that the node has indeed been added
added_nodes = self.nodes[0].getaddednodeinfo()
assert_equal(len(added_nodes), 1)