diff options
author | MacroFake <falke.marco@gmail.com> | 2022-10-24 16:10:10 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-10-25 13:26:36 +0200 |
commit | fa3da8307baa96ea7e51cc6ba4820aca7f93ec32 (patch) | |
tree | 3236c88ea236e6633a38ad229036a212056d6d44 /test | |
parent | fae0439486e9af428829b4604b3be5bb97b67b24 (diff) | |
download | bitcoin-fa3da8307baa96ea7e51cc6ba4820aca7f93ec32.tar.xz |
test: Check debug log as well in p2p_sendtxrcncl.py
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/p2p_sendtxrcncl.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/test/functional/p2p_sendtxrcncl.py b/test/functional/p2p_sendtxrcncl.py index d384996994..14cd815a30 100755 --- a/test/functional/p2p_sendtxrcncl.py +++ b/test/functional/p2p_sendtxrcncl.py @@ -107,29 +107,33 @@ class SendTxRcnclTest(BitcoinTestFramework): peer.send_message(create_sendtxrcncl_msg()) self.wait_until(lambda : "sendtxrcncl" in self.nodes[0].getpeerinfo()[-1]["bytesrecv_per_msg"]) self.log.info('second SENDTXRCNCL triggers a disconnect') - peer.send_message(create_sendtxrcncl_msg()) - peer.wait_for_disconnect() + with self.nodes[0].assert_debug_log(["(sendtxrcncl received from already registered peer); disconnecting"]): + peer.send_message(create_sendtxrcncl_msg()) + peer.wait_for_disconnect() self.log.info('SENDTXRCNCL with initiator=responder=0 triggers a disconnect') sendtxrcncl_no_role = create_sendtxrcncl_msg() sendtxrcncl_no_role.initiator = False sendtxrcncl_no_role.responder = False peer = self.nodes[0].add_p2p_connection(PeerNoVerack(), send_version=True, wait_for_verack=False) - peer.send_message(sendtxrcncl_no_role) - peer.wait_for_disconnect() + with self.nodes[0].assert_debug_log(["txreconciliation protocol violation"]): + peer.send_message(sendtxrcncl_no_role) + peer.wait_for_disconnect() self.log.info('SENDTXRCNCL with initiator=0 and responder=1 from inbound triggers a disconnect') sendtxrcncl_wrong_role = create_sendtxrcncl_msg(initiator=False) peer = self.nodes[0].add_p2p_connection(PeerNoVerack(), send_version=True, wait_for_verack=False) - peer.send_message(sendtxrcncl_wrong_role) - peer.wait_for_disconnect() + with self.nodes[0].assert_debug_log(["txreconciliation protocol violation"]): + peer.send_message(sendtxrcncl_wrong_role) + peer.wait_for_disconnect() self.log.info('SENDTXRCNCL with version=0 triggers a disconnect') sendtxrcncl_low_version = create_sendtxrcncl_msg() sendtxrcncl_low_version.version = 0 peer = self.nodes[0].add_p2p_connection(PeerNoVerack(), send_version=True, wait_for_verack=False) - peer.send_message(sendtxrcncl_low_version) - peer.wait_for_disconnect() + with self.nodes[0].assert_debug_log(["txreconciliation protocol violation"]): + peer.send_message(sendtxrcncl_low_version) + peer.wait_for_disconnect() self.log.info('sending SENDTXRCNCL after sending VERACK triggers a disconnect') peer = self.nodes[0].add_p2p_connection(P2PInterface()) @@ -162,8 +166,9 @@ class SendTxRcnclTest(BitcoinTestFramework): self.log.info('SENDTXRCNCL if block-relay-only triggers a disconnect') peer = self.nodes[0].add_outbound_p2p_connection( PeerNoVerack(), wait_for_verack=False, p2p_idx=3, connection_type="block-relay-only") - peer.send_message(create_sendtxrcncl_msg(initiator=False)) - peer.wait_for_disconnect() + with self.nodes[0].assert_debug_log(["we indicated no tx relay; disconnecting"]): + peer.send_message(create_sendtxrcncl_msg(initiator=False)) + peer.wait_for_disconnect() self.log.info('SENDTXRCNCL with initiator=1 and responder=0 from outbound triggers a disconnect') sendtxrcncl_wrong_role = create_sendtxrcncl_msg(initiator=True) |