|
|
24f428 |
From 28c8d45fcb0cd6190623e11de664b4577f0ce032 Mon Sep 17 00:00:00 2001
|
|
|
24f428 |
From: Eric Garver <e@erig.me>
|
|
|
24f428 |
Date: Wed, 5 Dec 2018 09:32:10 -0500
|
|
|
24f428 |
Subject: [PATCH 12/23] tests/functions: for list macros skip if testing
|
|
|
24f428 |
firewall-offline-cmd
|
|
|
24f428 |
|
|
|
24f428 |
Otherwise all the tests have to wrap the list macros in something like
|
|
|
24f428 |
|
|
|
24f428 |
m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
24f428 |
...
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
so lets just do that inside the macros themselves.
|
|
|
24f428 |
|
|
|
24f428 |
(cherry picked from commit 544404c428ea6a117a7d21f10a46d1640804d357)
|
|
|
24f428 |
---
|
|
|
24f428 |
src/tests/functions.at | 30 +++++++++++++++++++++---------
|
|
|
24f428 |
1 file changed, 21 insertions(+), 9 deletions(-)
|
|
|
24f428 |
|
|
|
24f428 |
diff --git a/src/tests/functions.at b/src/tests/functions.at
|
|
|
24f428 |
index 7cb8ea1a01e4..d8757c5708e9 100644
|
|
|
24f428 |
--- a/src/tests/functions.at
|
|
|
24f428 |
+++ b/src/tests/functions.at
|
|
|
24f428 |
@@ -222,30 +222,42 @@ m4_define([NS_CHECK], [
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
m4_define([EBTABLES_LIST_RULES], [
|
|
|
24f428 |
- NS_CHECK([ebtables --concurrent -t $1 -L $2 | TRIM_WHITESPACE | grep -v "^Bridge"], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
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 |
+ ])
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
m4_define([IPTABLES_LIST_RULES], [
|
|
|
24f428 |
- NS_CHECK([iptables -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
24f428 |
+ m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
24f428 |
+ NS_CHECK([iptables -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
24f428 |
+ ])
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
m4_define([IP6TABLES_LIST_RULES], [
|
|
|
24f428 |
- NS_CHECK([ip6tables -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
24f428 |
+ m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
24f428 |
+ NS_CHECK([ip6tables -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
24f428 |
+ ])
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
m4_define([NFT_LIST_RULES], [
|
|
|
24f428 |
- NS_CHECK([nft -nn list chain $1 firewalld $2 | TRIM_WHITESPACE], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
24f428 |
+ m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
24f428 |
+ NS_CHECK([nft -nn list chain $1 firewalld $2 | TRIM_WHITESPACE], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
24f428 |
+ ])
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
m4_define([IPSET_LIST_SET], [
|
|
|
24f428 |
- NS_CHECK([ipset list $1 | TRIM_WHITESPACE |dnl
|
|
|
24f428 |
- grep -v "^\(Revision\|Header\|Size\|References\|Number\)" |dnl
|
|
|
24f428 |
- awk 'NR <= 3; NR > 3 {print | "sort"}'],
|
|
|
24f428 |
- [$2], [m4_strip([$3])], [m4_strip([$4])], [$5], [$6])
|
|
|
24f428 |
+ m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
24f428 |
+ NS_CHECK([ipset list $1 | TRIM_WHITESPACE |dnl
|
|
|
24f428 |
+ grep -v "^\(Revision\|Header\|Size\|References\|Number\)" |dnl
|
|
|
24f428 |
+ awk 'NR <= 3; NR > 3 {print | "sort"}'],
|
|
|
24f428 |
+ [$2], [m4_strip([$3])], [m4_strip([$4])], [$5], [$6])
|
|
|
24f428 |
+ ])
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
m4_define([NFT_LIST_SET], [
|
|
|
24f428 |
- NS_CHECK([nft -nn list set inet firewalld $1 | TRIM_WHITESPACE], [$2], [m4_strip([$3])], [m4_strip([$4])], [$5], [$6])
|
|
|
24f428 |
+ m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
24f428 |
+ NS_CHECK([nft -nn list set inet firewalld $1 | TRIM_WHITESPACE], [$2], [m4_strip([$3])], [m4_strip([$4])], [$5], [$6])
|
|
|
24f428 |
+ ])
|
|
|
24f428 |
])
|
|
|
24f428 |
|
|
|
24f428 |
m4_define([DBUS_CHECK], [
|
|
|
24f428 |
--
|
|
|
24f428 |
2.20.1
|
|
|
24f428 |
|