Blame SOURCES/0016-tests-functions-normalize-ebtables-inversion-output.patch

24f428
From ff1a2d948e75c0cabafdc34db8326e05c2cc61fa Mon Sep 17 00:00:00 2001
24f428
From: Eric Garver <e@erig.me>
24f428
Date: Mon, 17 Dec 2018 14:03:09 -0500
24f428
Subject: [PATCH 16/23] tests/functions: normalize ebtables inversion output
24f428
24f428
It changed in xtables commit 5f508b76a0ce ("ebtables: use
24f428
extrapositioned negation consistently")
24f428
24f428
(cherry picked from commit 6ec2195e544dda2a923a0393bf463bf83593c322)
24f428
---
24f428
 src/tests/firewall-cmd.at | 4 ++--
24f428
 src/tests/functions.at    | 5 ++++-
24f428
 2 files changed, 6 insertions(+), 3 deletions(-)
24f428
24f428
diff --git a/src/tests/firewall-cmd.at b/src/tests/firewall-cmd.at
24f428
index bdd0287ebb01..bcbfe9639ef1 100644
24f428
--- a/src/tests/firewall-cmd.at
24f428
+++ b/src/tests/firewall-cmd.at
24f428
@@ -761,12 +761,12 @@ FWD_START_TEST([direct ebtables])
24f428
     FWD_CHECK([--direct --add-rule eb filter mychain 999 -p IPv6 --ip6-protocol UDP --ip6-source-port ! 12345 -j DROP], 0, ignore)
24f428
     EBTABLES_LIST_RULES([filter], [mychain], 0, [dnl
24f428
         -p IPv6 -j DROP
24f428
-        -p IPv6 --ip6-proto udp --ip6-sport ! 12345 -j DROP
24f428
+        -p IPv6 --ip6-proto udp ! --ip6-sport 12345 -j DROP
24f428
         -j RETURN
24f428
     ])
24f428
     FWD_CHECK([--direct --remove-rule eb filter mychain 1 -p 0x86dd -j DROP], 0, ignore)
24f428
     EBTABLES_LIST_RULES([filter], [mychain], 0, [dnl
24f428
-        -p IPv6 --ip6-proto udp --ip6-sport ! 12345 -j DROP
24f428
+        -p IPv6 --ip6-proto udp ! --ip6-sport 12345 -j DROP
24f428
         -j RETURN
24f428
     ])
24f428
 
24f428
diff --git a/src/tests/functions.at b/src/tests/functions.at
24f428
index d8757c5708e9..cf72e8f69ec4 100644
24f428
--- a/src/tests/functions.at
24f428
+++ b/src/tests/functions.at
24f428
@@ -222,9 +222,12 @@ m4_define([NS_CHECK], [
24f428
 ])
24f428
 
24f428
 m4_define([EBTABLES_LIST_RULES], [
24f428
+    dnl ebtables commit 5f508b76a0ce change list output for inversion.
24f428
+    m4_define([EBTABLES_LIST_RULES_NORMALIZE], [[sed -e 's/\([-][-][-a-zA-Z0-9]\+\)[ ]\+[!]/! \1/g']])
24f428
     m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
24f428
-        NS_CHECK([ebtables --concurrent -t $1 -L $2 | TRIM_WHITESPACE | grep -v "^Bridge"], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
24f428
+        NS_CHECK([ebtables --concurrent -t $1 -L $2 | TRIM_WHITESPACE | grep -v "^Bridge" | EBTABLES_LIST_RULES_NORMALIZE], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
24f428
     ])
24f428
+    m4_undefine([EBTABLES_LIST_RULES_NORMALIZE])
24f428
 ])
24f428
 
24f428
 m4_define([IPTABLES_LIST_RULES], [
24f428
-- 
24f428
2.20.1
24f428