mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
test: fix addnode
functional test failure on OpenBSD
This is the functional test counterpart of PR #28891 /
commit 007d6f0e85
.
This commit is contained in:
parent
3e691258d8
commit
fd0bde2793
1 changed files with 5 additions and 2 deletions
|
@ -9,6 +9,7 @@ Tests correspond to code in rpc/net.cpp.
|
||||||
|
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from itertools import product
|
from itertools import product
|
||||||
|
import platform
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import test_framework.messages
|
import test_framework.messages
|
||||||
|
@ -220,6 +221,8 @@ class NetTest(BitcoinTestFramework):
|
||||||
ip_port = "127.0.0.1:{}".format(p2p_port(2))
|
ip_port = "127.0.0.1:{}".format(p2p_port(2))
|
||||||
self.nodes[0].addnode(node=ip_port, command='add')
|
self.nodes[0].addnode(node=ip_port, command='add')
|
||||||
# try to add an equivalent ip
|
# try to add an equivalent ip
|
||||||
|
# (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))
|
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')
|
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
|
# check that the node has indeed been added
|
||||||
|
|
Loading…
Add table
Reference in a new issue