From ba20c6cb0a516545404e5e02cddf3b1d01fac79b Mon Sep 17 00:00:00 2001 From: Eric Garver Date: Tue, 5 Jul 2022 15:43:19 -0400 Subject: [PATCH 2/3] test(functions): commonize iptables output normalization Share rule normalization between iptables and ip6tables. (cherry picked from commit 54e761a0fe2d19dfc4c0c898540f718c837778a9) --- src/tests/functions.at | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tests/functions.at b/src/tests/functions.at index 557acf0257e4..481c94017f15 100644 --- a/src/tests/functions.at +++ b/src/tests/functions.at @@ -393,11 +393,15 @@ m4_define([EBTABLES_LIST_RULES], [ ]) ]) -m4_define([IPTABLES_LIST_RULES_NORMALIZE], [dnl +m4_define([IPXTABLES_LIST_RULES_NORMALIZE], [dnl TRIM_WHITESPACE | dnl tail -n +3 dnl ]) +m4_define([IPTABLES_LIST_RULES_NORMALIZE], [dnl + IPXTABLES_LIST_RULES_NORMALIZE() dnl +]) + m4_define([IPTABLES_LIST_RULES_ALWAYS], [ m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [ NS_CHECK([PIPESTATUS0([$IPTABLES -w -n -t $1 -L $2], [IPTABLES_LIST_RULES_NORMALIZE])], @@ -412,8 +416,7 @@ m4_define([IPTABLES_LIST_RULES], [ ]) m4_define([IP6TABLES_LIST_RULES_NORMALIZE], [dnl - TRIM_WHITESPACE | dnl - tail -n +3 dnl + IPXTABLES_LIST_RULES_NORMALIZE() dnl ]) m4_define([IP6TABLES_LIST_RULES_ALWAYS], [ -- 2.31.1