|
|
1dfe16 |
From 71e90d92c71d48f130e803f9b4de5224f774d84c Mon Sep 17 00:00:00 2001
|
|
|
1dfe16 |
From: Eric Garver <eric@garver.life>
|
|
|
1dfe16 |
Date: Tue, 14 May 2019 08:58:37 -0400
|
|
|
1dfe16 |
Subject: [PATCH 33/37] test: pass IPTABLES make variables down to autotest
|
|
|
1dfe16 |
|
|
|
1dfe16 |
(cherry picked from commit 8533c488a30de680769d61a08bc5f404716b04ee)
|
|
|
1dfe16 |
(cherry picked from commit 9de0a22a6046a162389617fd775a8c4a79ea6afa)
|
|
|
1dfe16 |
---
|
|
|
1dfe16 |
src/tests/Makefile.am | 7 ++++++-
|
|
|
1dfe16 |
src/tests/functions.at | 4 ++--
|
|
|
1dfe16 |
src/tests/regression/icmp_block_in_forward_chain.at | 4 ++--
|
|
|
1dfe16 |
src/tests/regression/rhbz1514043.at | 2 +-
|
|
|
1dfe16 |
4 files changed, 11 insertions(+), 6 deletions(-)
|
|
|
1dfe16 |
|
|
|
1dfe16 |
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
|
|
|
1dfe16 |
index a30ce4d5d607..2a5645ba81d8 100644
|
|
|
1dfe16 |
--- a/src/tests/Makefile.am
|
|
|
1dfe16 |
+++ b/src/tests/Makefile.am
|
|
|
1dfe16 |
@@ -15,7 +15,11 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac $(top_srcdir)/firewalld.spec
|
|
|
1dfe16 |
echo 'm4_define([AT_PACKAGE_VERSION],[$(PACKAGE_VERSION)])' && \
|
|
|
1dfe16 |
echo 'm4_define([AT_PACKAGE_STRING],[$(PACKAGE_STRING)])' && \
|
|
|
1dfe16 |
echo 'm4_define([AT_PACKAGE_URL],[http://firewalld.org/])' && \
|
|
|
1dfe16 |
- echo 'm4_define([AT_PACKAGE_BUGREPORT],[https://github.com/firewalld/firewalld])'; \
|
|
|
1dfe16 |
+ echo 'm4_define([AT_PACKAGE_BUGREPORT],[https://github.com/firewalld/firewalld])' && \
|
|
|
1dfe16 |
+ echo 'm4_define([IPTABLES],[$(IPTABLES)])' && \
|
|
|
1dfe16 |
+ echo 'm4_define([IPTABLES_RESTORE],[$(IPTABLES_RESTORE)])' && \
|
|
|
1dfe16 |
+ echo 'm4_define([IP6TABLES],[$(IP6TABLES)])' && \
|
|
|
1dfe16 |
+ echo 'm4_define([IP6TABLES_RESTORE],[$(IP6TABLES_RESTORE)])' ; \
|
|
|
1dfe16 |
} > "$@"
|
|
|
1dfe16 |
|
|
|
1dfe16 |
check-local: atconfig $(TESTSUITE)
|
|
|
1dfe16 |
@@ -31,6 +35,7 @@ installcheck-local: atconfig $(TESTSUITE)
|
|
|
1dfe16 |
|
|
|
1dfe16 |
clean-local:
|
|
|
1dfe16 |
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean
|
|
|
1dfe16 |
+ -rm $(srcdir)/package.m4
|
|
|
1dfe16 |
|
|
|
1dfe16 |
AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te
|
|
|
1dfe16 |
AUTOTEST = $(AUTOM4TE) --language=autotest
|
|
|
1dfe16 |
diff --git a/src/tests/functions.at b/src/tests/functions.at
|
|
|
1dfe16 |
index cf72e8f69ec4..70d5ec66590d 100644
|
|
|
1dfe16 |
--- a/src/tests/functions.at
|
|
|
1dfe16 |
+++ b/src/tests/functions.at
|
|
|
1dfe16 |
@@ -232,13 +232,13 @@ m4_define([EBTABLES_LIST_RULES], [
|
|
|
1dfe16 |
|
|
|
1dfe16 |
m4_define([IPTABLES_LIST_RULES], [
|
|
|
1dfe16 |
m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
1dfe16 |
- NS_CHECK([iptables -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
1dfe16 |
+ NS_CHECK([IPTABLES -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
1dfe16 |
])
|
|
|
1dfe16 |
])
|
|
|
1dfe16 |
|
|
|
1dfe16 |
m4_define([IP6TABLES_LIST_RULES], [
|
|
|
1dfe16 |
m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
|
|
|
1dfe16 |
- NS_CHECK([ip6tables -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
1dfe16 |
+ NS_CHECK([IP6TABLES -w -n -t $1 -L $2 | TRIM_WHITESPACE | tail -n +3], [$3], [m4_strip([$4])], [m4_strip([$5])], [$6], [$7])
|
|
|
1dfe16 |
])
|
|
|
1dfe16 |
])
|
|
|
1dfe16 |
|
|
|
1dfe16 |
diff --git a/src/tests/regression/icmp_block_in_forward_chain.at b/src/tests/regression/icmp_block_in_forward_chain.at
|
|
|
1dfe16 |
index 77f3f274bc5a..3c8766a2b23b 100644
|
|
|
1dfe16 |
--- a/src/tests/regression/icmp_block_in_forward_chain.at
|
|
|
1dfe16 |
+++ b/src/tests/regression/icmp_block_in_forward_chain.at
|
|
|
1dfe16 |
@@ -2,8 +2,8 @@ FWD_START_TEST([ICMP block present FORWARD chain])
|
|
|
1dfe16 |
|
|
|
1dfe16 |
FWD_CHECK([-q --zone=public --add-icmp-block=host-prohibited])
|
|
|
1dfe16 |
m4_if(iptables, FIREWALL_BACKEND, [
|
|
|
1dfe16 |
- NS_CHECK([iptables -L IN_public_deny | grep "host-prohibited"], 0, ignore)
|
|
|
1dfe16 |
- NS_CHECK([iptables -L FWDI_public_deny | grep "host-prohibited"], 0, ignore)
|
|
|
1dfe16 |
+ NS_CHECK([IPTABLES -L IN_public_deny | grep "host-prohibited"], 0, ignore)
|
|
|
1dfe16 |
+ NS_CHECK([IPTABLES -L FWDI_public_deny | grep "host-prohibited"], 0, ignore)
|
|
|
1dfe16 |
], [
|
|
|
1dfe16 |
NS_CHECK([nft list chain inet firewalld filter_IN_public_deny | grep "destination-unreachable" |grep "\(code 10\|host-prohibited\)"], 0, ignore)
|
|
|
1dfe16 |
NS_CHECK([nft list chain inet firewalld filter_FWDI_public_deny | grep "destination-unreachable" |grep "\(code 10\|host-prohibited\)"], 0, ignore)
|
|
|
1dfe16 |
diff --git a/src/tests/regression/rhbz1514043.at b/src/tests/regression/rhbz1514043.at
|
|
|
1dfe16 |
index a7368dbd9eeb..a9750a584898 100644
|
|
|
1dfe16 |
--- a/src/tests/regression/rhbz1514043.at
|
|
|
1dfe16 |
+++ b/src/tests/regression/rhbz1514043.at
|
|
|
1dfe16 |
@@ -7,7 +7,7 @@ services: dhcpv6-client samba ssh
|
|
|
1dfe16 |
])
|
|
|
1dfe16 |
dnl check that log denied actually took effect
|
|
|
1dfe16 |
m4_if(iptables, FIREWALL_BACKEND, [
|
|
|
1dfe16 |
- NS_CHECK([iptables -t filter -L | grep "FINAL_REJECT:"], 0, ignore)
|
|
|
1dfe16 |
+ NS_CHECK([IPTABLES -t filter -L | grep "FINAL_REJECT:"], 0, ignore)
|
|
|
1dfe16 |
], [
|
|
|
1dfe16 |
NS_CHECK([nft list chain inet firewalld filter_INPUT | grep "FINAL_REJECT"], 0, ignore)
|
|
|
1dfe16 |
NS_CHECK([nft list chain inet firewalld filter_FORWARD | grep "FINAL_REJECT"], 0, ignore)
|
|
|
1dfe16 |
--
|
|
|
1dfe16 |
2.20.1
|
|
|
1dfe16 |
|