Blame SOURCES/0036-test-functions-Strip-nft-hook-and-policy-from-output.patch

136e2c
From 8dd1d1c0db69252d3092b2c08ee2c7b4b1b62e58 Mon Sep 17 00:00:00 2001
136e2c
From: Eric Garver <e@erig.me>
136e2c
Date: Fri, 21 Dec 2018 09:14:15 -0500
136e2c
Subject: [PATCH 36/73] test/functions: Strip nft hook and policy from output
136e2c
136e2c
Depending on the nft version the priority may print as "-290" or "raw +
136e2c
10". Just strip the whole hook line - we really just want to see the
136e2c
rules.
136e2c
136e2c
(cherry picked from commit 9b681605f96907f3fced59a4e6c884b68db0ffc8)
136e2c
(cherry picked from commit 3158bc0088c64bbb4ca4d368697cb22c6001c17b)
136e2c
---
136e2c
 src/tests/functions.at | 5 ++++-
136e2c
 1 file changed, 4 insertions(+), 1 deletion(-)
136e2c
136e2c
diff --git a/src/tests/functions.at b/src/tests/functions.at
136e2c
index 6af0c31c422a..102004f678b3 100644
136e2c
--- a/src/tests/functions.at
136e2c
+++ b/src/tests/functions.at
136e2c
@@ -245,7 +245,10 @@ m4_define([IP6TABLES_LIST_RULES], [
136e2c
 m4_define([NFT_LIST_RULES], [
136e2c
     dnl nftables commit 6dd848339444 change list output to show "meta mark"
136e2c
     dnl instead of just "mark".
136e2c
-    m4_define([NFT_LIST_RULES_NORMALIZE], [sed -e 's/meta mark/mark/g'])
136e2c
+    m4_define([NFT_LIST_RULES_NORMALIZE], [dnl
136e2c
+        sed -e 's/meta mark/mark/g'dnl
136e2c
+        | sed -e '/type.*hook.*priority.*policy.*/d'dnl
136e2c
+    ])
136e2c
     m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
136e2c
         NS_CHECK([nft -nn list chain $1 firewalld $2 | TRIM_WHITESPACE | NFT_LIST_RULES_NORMALIZE], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
136e2c
     ])
136e2c
-- 
136e2c
2.20.1
136e2c