From e261c4fc222edd812aebfad1e370778da018c3a2 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 10 Jun 2019 10:55:23 +0200 Subject: [PATCH] Test against WARNING and ERROR messages in tests Signed-off-by: DL6ER --- test/test_suite.bats | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/test_suite.bats b/test/test_suite.bats index 16c5a02b..50272924 100644 --- a/test/test_suite.bats +++ b/test/test_suite.bats @@ -262,6 +262,18 @@ [[ ${lines[3]} == "Available arguments:" ]] } +@test "No WARNING messages in pihole-FTL.log (besides known capability issues)" { + run bash -c 'grep "WARNING" /var/log/pihole-FTL.log' | grep -c -v -E "CAP_NET_ADMIN|CAP_NET_RAW" + printf "%s\n" "${lines[@]}" + [[ ${lines[0]} == "0" ]] +} + +@test "No ERROR messages in pihole-FTL.log" { + run bash -c 'grep -c "ERROR" /var/log/pihole-FTL.log' + printf "%s\n" "${lines[@]}" + [[ ${lines[0]} == "0" ]] +} + @test "No FATAL messages in pihole-FTL.log" { run bash -c 'grep -c "FATAL" /var/log/pihole-FTL.log' printf "%s\n" "${lines[@]}"