From 7b7edfbde62c95ef23febceaf889b05333c8f365 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 7 Apr 2020 19:11:29 +0200 Subject: [PATCH 1/2] fundingmanager: fix log --- fundingmanager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fundingmanager.go b/fundingmanager.go index 95e6464ea..6fb39a26a 100644 --- a/fundingmanager.go +++ b/fundingmanager.go @@ -2725,8 +2725,9 @@ func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) { if err := fmsg.peer.AddNewChannel(channel, f.quit); err != nil { fndgLog.Errorf("Unable to add new channel %v with peer %x: %v", + channel.FundingOutpoint, fmsg.peer.IdentityKey().SerializeCompressed(), - channel.FundingOutpoint, err) + err) } } From 1307a96624b601178c732121ca4fbe4b6f43d551 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 7 Apr 2020 17:22:26 +0200 Subject: [PATCH 2/2] itest: check for new errors in logs --- Makefile | 1 + lntest/itest/log_check_errors.sh | 12 ++ lntest/itest/log_error_whitelist.txt | 158 +++++++++++++++++++++++++++ lntest/itest/log_substitutions.txt | 19 ++++ 4 files changed, 190 insertions(+) create mode 100755 lntest/itest/log_check_errors.sh create mode 100644 lntest/itest/log_error_whitelist.txt create mode 100644 lntest/itest/log_substitutions.txt diff --git a/Makefile b/Makefile index 5df705078..54c9e7fe0 100644 --- a/Makefile +++ b/Makefile @@ -130,6 +130,7 @@ check: unit itest itest-only: @$(call print, "Running integration tests with ${backend} backend.") $(ITEST) + lntest/itest/log_check_errors.sh itest: btcd build-itest itest-only diff --git a/lntest/itest/log_check_errors.sh b/lntest/itest/log_check_errors.sh new file mode 100755 index 000000000..80d6a07d3 --- /dev/null +++ b/lntest/itest/log_check_errors.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +BASEDIR=$(dirname "$0") + +# Filter all log files for errors, substitute variable data and match against whitelist. +cat $BASEDIR/*.log | grep "\[ERR\]" | \ +sed -r -f $BASEDIR/log_substitutions.txt | \ +sort | uniq | \ +grep -Fv -f $BASEDIR/log_error_whitelist.txt + +# If something shows up (not on whitelist) exit with error code 1. +test $? -eq 1 diff --git a/lntest/itest/log_error_whitelist.txt b/lntest/itest/log_error_whitelist.txt new file mode 100644 index 000000000..171560008 --- /dev/null +++ b/lntest/itest/log_error_whitelist.txt @@ -0,0 +1,158 @@ +