Blame SOURCES/0045-test-pass-IPTABLES-make-variables-down-to-autotest.patch

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