Skip to content

Commit fd0bde2

Browse files
committed
test: fix addnode functional test failure on OpenBSD
This is the functional test counterpart of PR bitcoin#28891 / commit 007d6f0.
1 parent 3e69125 commit fd0bde2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/functional/rpc_net.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from decimal import Decimal
1111
from itertools import product
12+
import platform
1213
import time
1314

1415
import test_framework.messages
@@ -220,8 +221,10 @@ def test_addnode_getaddednodeinfo(self):
220221
ip_port = "127.0.0.1:{}".format(p2p_port(2))
221222
self.nodes[0].addnode(node=ip_port, command='add')
222223
# try to add an equivalent ip
223-
ip_port2 = "127.1:{}".format(p2p_port(2))
224-
assert_raises_rpc_error(-23, "Node already added", self.nodes[0].addnode, node=ip_port2, command='add')
224+
# (note that OpenBSD doesn't support the IPv4 shorthand notation with omitted zero-bytes)
225+
if platform.system() != "OpenBSD":
226+
ip_port2 = "127.1:{}".format(p2p_port(2))
227+
assert_raises_rpc_error(-23, "Node already added", self.nodes[0].addnode, node=ip_port2, command='add')
225228
# check that the node has indeed been added
226229
added_nodes = self.nodes[0].getaddednodeinfo()
227230
assert_equal(len(added_nodes), 1)

0 commit comments

Comments
 (0)