Blob Blame History Raw
From 32e94d98bb52ea5c1c8d2d43beea9381b9f629b8 Mon Sep 17 00:00:00 2001
From: Eric Garver <e@erig.me>
Date: Fri, 7 Dec 2018 09:34:27 -0500
Subject: [PATCH 35/73] tests/functions: normalize nft list rule output

nftables commit 6dd848339444 ("src: meta: always prefix 'meta' for
almost all tokens") made the "mark" output always be prefixd by "meta".
To be compatible with old nft version, strip the meta keyword.

Fix test cases as well.

(cherry picked from commit 3e56d69f5702bbf326dd6701e329aa1e98071b7a)
(cherry picked from commit 0e3cc0f0417774c80bd1cffd9a1249bf434bfd67)
---
 src/tests/functions.at | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/tests/functions.at b/src/tests/functions.at
index cb23b109a105..6af0c31c422a 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -243,9 +243,13 @@ 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_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
-        NS_CHECK([nft -nn list chain $1 firewalld $2 | TRIM_WHITESPACE], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
+        NS_CHECK([nft -nn list chain $1 firewalld $2 | TRIM_WHITESPACE | NFT_LIST_RULES_NORMALIZE], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
     ])
+    m4_undefine([NFT_LIST_RULES_NORMALIZE])
 ])
 
 m4_define([IPSET_LIST_SET], [
-- 
2.20.1