Skip to content

Commit 49bcc94

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
tests: Fix test_emergencyrecover to check for ChannelReestablish
Make sure we are sending bogus channel reestablish after recovering from emergency.recover file and peer storage backup. Key Changes: - Add wait_for_log() with appropriate debug statements
1 parent 39a2893 commit 49bcc94

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_misc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,6 +2979,7 @@ def test_emergencyrecoverpenaltytxn(node_factory, bitcoind):
29792979
stubs = l1.rpc.emergencyrecover()["stubs"]
29802980
assert len(stubs) == 1
29812981
assert stubs[0] == _["channel_id"]
2982+
l1.daemon.wait_for_log('Sending a bogus channel_reestablish message to make the peer unilaterally close the channel.')
29822983
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
29832984

29842985
# Restarting so that L1
@@ -3026,7 +3027,10 @@ def test_emergencyrecover(node_factory, bitcoind):
30263027
listfunds = l1.rpc.listfunds()["channels"][0]
30273028
assert listfunds["short_channel_id"] == "1x1x1"
30283029

3030+
l1.daemon.wait_for_log('Sending a bogus channel_reestablish message to make the peer unilaterally close the channel.')
30293031
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
3032+
3033+
l2.daemon.wait_for_log('bad reestablish commitment_number: 0')
30303034
l2.daemon.wait_for_log('State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL')
30313035

30323036
bitcoind.generate_block(5, wait_for_mempool=1)
@@ -3147,7 +3151,9 @@ def test_restorefrompeer(node_factory, bitcoind):
31473151

31483152
assert l1.rpc.restorefrompeer()['stubs'][0] == _['channel_id']
31493153

3154+
l1.daemon.wait_for_log('Sending a bogus channel_reestablish message to make the peer unilaterally close the channel.')
31503155
l1.daemon.wait_for_log('peer_out WIRE_ERROR')
3156+
31513157
l2.daemon.wait_for_log('State changed from CHANNELD_NORMAL to AWAITING_UNILATERAL')
31523158

31533159
bitcoind.generate_block(5, wait_for_mempool=1)

0 commit comments

Comments
 (0)