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