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

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