From 1307a96624b601178c732121ca4fbe4b6f43d551 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Tue, 7 Apr 2020 17:22:26 +0200 Subject: [PATCH] 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 @@ +