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

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