Blob Blame History Raw
From 5d1ee5889bacf65a0d386a56a7b75f49a44e9bf7 Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Wed, 1 May 2019 14:41:33 -0400
Subject: [PATCH 39/73] fix: tests nftables: constant set compat between
 releases

For newer versions (>0.9.0) of nftables, matches against sets of
constants are output using the set notation. To be compatible with older
releases we need some sed magic.

(cherry picked from commit b7656e99ccf7c64961416e81b11ab5dbc1869694)
(cherry picked from commit f6b417f9786f81701d2c63b234f7029e528b0ab2)
---
 src/tests/functions.at | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/tests/functions.at b/src/tests/functions.at
index ca9224476a56..729bfc0dfc6a 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -247,7 +247,9 @@ m4_define([NFT_LIST_RULES], [
     dnl instead of just "mark".
     m4_define([NFT_LIST_RULES_NORMALIZE], [dnl
         sed -e 's/meta mark/mark/g'dnl
-        | sed -e '/type.*hook.*priority.*policy.*/d'dnl
+            -e '/type.*hook.*priority.*policy.*/d'dnl
+            dnl tranform ct state { established,related } to ct state established,related
+            -e '/ct \(state\|status\)/{s/\(ct \(state\|status\)\) {/\1/g; s/ }//; s/\(@<:@a-z@:>@*\), /\1,/g;}' dnl
     ])
 
     m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
-- 
2.20.1