From ed7ce3fc8aaa1e2671c114f71bae75de775974d9 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Tue, 1 Oct 2024 23:17:33 -0300 Subject: [PATCH] itest: test channel.backup changes upon shutdown --- itest/lnd_channel_backup_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/itest/lnd_channel_backup_test.go b/itest/lnd_channel_backup_test.go index 37b7e9faf6..b620557cb2 100644 --- a/itest/lnd_channel_backup_test.go +++ b/itest/lnd_channel_backup_test.go @@ -786,8 +786,15 @@ func runChanRestoreScenarioForceClose(ht *lntest.HarnessTest, zeroConf bool) { ht.AssertNumTxsInMempool(1) // Now that we're able to make our restored now, we'll shutdown the old - // Dave node as we'll be storing it shortly below. - ht.Shutdown(dave) + // Dave node as we'll be storing it shortly below. Use SuspendNode, not + // Shutdown to keep its directory including channel.backup file. + ht.SuspendNode(dave) + + // Read Dave's channel.backup file again to make sure it was updated + // upon Dave's shutdown. + multi2, err := os.ReadFile(backupFilePath) + require.NoError(ht, err) + require.NotEqual(ht, multi, multi2) // Mine a block to confirm the closing tx from Dave. ht.MineBlocksAndAssertNumTxes(1, 1)