Blob Blame History Raw
From fd61eebac7618b1f9051497904d4392ac9b6f53b Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Thu, 3 Jun 2021 12:12:03 -0400
Subject: [PATCH 32/36] test(functions): improve checking firewalld.log for
 errors

Don't delete the errors/warnings from the log. Use sed/grep in a pipe
instead.

(cherry picked from commit 23dc028083dbdbd291f022ab60bad0462e23d48e)
(cherry picked from commit 1bafb54763926f49f930038fb6ecd9ab3e05c796)
---
 src/tests/functions.at | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/tests/functions.at b/src/tests/functions.at
index 4b298644d7e4..03795bc3c132 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -255,14 +255,11 @@ m4_define([FWD_START_TEST], [
 
 m4_define([FWD_END_TEST], [
     m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
-        IF_HOST_SUPPORTS_IP6TABLES([], [
-            sed -i "/WARNING: ip6tables not usable, disabling IPv6 firewall/d" ./firewalld.log
-        ])
         if test x"$1" != x"ignore"; then
-            if test -n "$1"; then
-                sed -i $1 ./firewalld.log
-            fi
-            AT_FAIL_IF([[grep '^[0-9-]*[ ]\+[0-9:]*[ ]\+\(ERROR\|WARNING\)' ./firewalld.log]])
+            AT_FAIL_IF([cat ./firewalld.log | dnl
+                       sed "/WARNING: ip6tables not usable, disabling IPv6 firewall/d" | dnl
+                       m4_ifnblank([$1], [sed $1 |]) dnl
+                       [grep '^[0-9-]*[ ]\+[0-9:]*[ ]\+\(ERROR\|WARNING\)']])
         fi
         m4_undefine([CURRENT_DBUS_ADDRESS])
         m4_undefine([CURRENT_TEST_NS])
-- 
2.27.0