From 5915c23835a7b3a8249aea10130fff5d1cff0b38 Mon Sep 17 00:00:00 2001
From: Eric Garver <eric@garver.life>
Date: Thu, 31 Oct 2019 13:06:53 -0400
Subject: [PATCH 122/122] chore: tests: rename IF_IPV6_SUPPORTED to
IF_HOST_SUPPORTS_IPV6_RULES
It more accurately describes what it's checking for.
(cherry picked from commit ba594ac365acc86fc6bbe398883f51fbf3d85df0)
(cherry picked from commit b239f28c73f2701182b1fa13f0667cb9d686a379)
---
src/tests/firewall-cmd.at | 20 ++++++++++----------
src/tests/functions.at | 4 ++--
src/tests/regression/gh258.at | 2 +-
src/tests/regression/gh335.at | 6 +++---
src/tests/regression/rhbz1734765.at | 4 ++--
5 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/tests/firewall-cmd.at b/src/tests/firewall-cmd.at
index e9d5b6d1abc0..21ba2e5aec45 100644
--- a/src/tests/firewall-cmd.at
+++ b/src/tests/firewall-cmd.at
@@ -199,7 +199,7 @@ sources: $1
check_zone_source([1.2.3.4])
check_zone_source([192.168.1.0/24])
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
check_zone_source([3ffe:501:ffff::/64])
check_zone_source([dead:beef::babe])
])
@@ -294,7 +294,7 @@ FWD_START_TEST([user services])
FWD_CHECK([--permanent --service=foobar --set-destination=ipv4:foo], 105, ignore, ignore) dnl bad address
FWD_CHECK([--permanent --service=foobar --set-destination=ipv4:1.2.3.4], 0, ignore)
FWD_CHECK([--permanent --service=foobar --remove-destination=ipv4], 0, ignore)
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([--permanent --service=foobar --set-destination=ipv6:fd00:dead:beef:ff0::/64], 0, ignore)
FWD_CHECK([--permanent --service=foobar --query-destination=ipv6:fd00:dead:beef:ff0::/64], 0, ignore)
FWD_CHECK([--permanent --service=foobar --remove-destination=ipv6], 0, ignore)
@@ -520,7 +520,7 @@ FWD_START_TEST([forward ports])
FWD_CHECK([--query-forward-port port=66:proto=sctp:toport=66:toaddr=7.7.7.7 --zone=public], 0, ignore)
FWD_CHECK([--remove-forward-port=port=66:proto=sctp:toport=66:toaddr=7.7.7.7], 0, ignore)
FWD_CHECK([--query-forward-port=port=66:proto=sctp:toport=66:toaddr=7.7.7.7], 1, ignore)
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([--add-forward-port=port=66:proto=sctp:toport=66:toaddr=fd00:dead:beef:ff0::], 0, ignore)
dnl this should only affect IPv6, so verify that.
NFT_LIST_RULES([ip], [nat_PRE_public_allow], 0, [dnl
@@ -567,7 +567,7 @@ FWD_START_TEST([forward ports])
FWD_CHECK([--permanent --query-forward-port port=66:proto=sctp:toport=66:toaddr=7.7.7.7 --zone=public], 0, ignore)
FWD_CHECK([--permanent --remove-forward-port=port=66:proto=sctp:toport=66:toaddr=7.7.7.7], 0, ignore)
FWD_CHECK([--permanent --query-forward-port=port=66:proto=sctp:toport=66:toaddr=7.7.7.7], 1, ignore)
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([--permanent --add-forward-port=port=66:proto=sctp:toport=66:toaddr=fd00:dead:beef:ff0::], 0, ignore)
FWD_CHECK([--permanent --query-forward-port port=66:proto=sctp:toport=66:toaddr=fd00:dead:beef:ff0:: --zone=public], 0, ignore)
FWD_CHECK([--permanent --remove-forward-port=port=66:proto=sctp:toport=66:toaddr=fd00:dead:beef:ff0::], 0, ignore)
@@ -688,7 +688,7 @@ FWD_START_TEST([ipset])
FWD_CHECK([--permanent --delete-ipset=foobar], 0, ignore)
FWD_RELOAD
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([--permanent --new-ipset=foobar --type=hash:mac], 0, ignore)
FWD_CHECK([--permanent --ipset=foobar --add-entry=12:34:56:78:90:ab], 0, ignore)
FWD_RELOAD
@@ -968,7 +968,7 @@ FWD_START_TEST([rich rules good])
rich_rule_test([rule protocol value="sctp" log])
rich_rule_test([rule family="ipv4" source address="192.168.0.0/24" service name="tftp" log prefix="tftp: " level="info" limit value="1/m" accept])
rich_rule_test([rule family="ipv4" source not address="192.168.0.0/24" service name="dns" log prefix="dns: " level="info" limit value="2/m" drop])
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
rich_rule_test([rule family="ipv6" source address="1:2:3:4:6::" service name="radius" log prefix="dns -- " level="info" limit value="3/m" reject type="icmp6-addr-unreachable" limit value="20/m"])
rich_rule_test([rule family="ipv6" source address="1:2:3:4:6::" port port="4011" protocol="tcp" log prefix="port 4011: " level="info" limit value="4/m" drop])
rich_rule_test([rule family="ipv6" source address="1:2:3:4:6::" forward-port port="4011" protocol="tcp" to-port="4012" to-addr="1::2:3:4:7"])
@@ -983,7 +983,7 @@ FWD_START_TEST([rich rules good])
rich_rule_test([rule family="ipv4" destination address="192.168.1.0/24" masquerade])
rich_rule_test([rule forward-port port="2222" to-port="22" to-addr="192.168.100.2" protocol="tcp" family="ipv4" source address="192.168.2.100"])
rich_rule_test([rule forward-port port="66" to-port="666" to-addr="192.168.100.2" protocol="sctp" family="ipv4" source address="192.168.2.100"])
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
rich_rule_test([rule forward-port port="99" to-port="999" to-addr="1::2:3:4:7" protocol="dccp" family="ipv6" source address="1:2:3:4:6::"])
rich_rule_test([rule forward-port port="99" to-port="10999" to-addr="1::2:3:4:7" protocol="dccp" family="ipv6" source address="1:2:3:4:6::"])
])
@@ -1014,7 +1014,7 @@ FWD_START_TEST([rich rules bad])
rich_rule_test([rule service name="radius" port port="4011" reject], 122) dnl service && port
rich_rule_test([rule service bad_attribute="dns"], 122) dnl bad attribute
rich_rule_test([rule protocol value="igmp" log level="eror"], 125) dnl bad log level
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
rich_rule_test([family="ipv6" accept], 122) dnl no rule
rich_rule_test([rule source address="1:2:3:4:6::" icmp-block name="redirect" log level="info" limit value="1/2m"], 207) dnl missing family
rich_rule_test([rule family="ipv6" source address="1:2:3:4:6::" icmp-block name="redirect" log level="info" limit value="1/2m"], 123) dnl bad limit
@@ -1135,7 +1135,7 @@ WARNING: INVALID_ENTRY: invalid mac address '12:34:56:78:90' in '12:34:56:78:90'
])
FWD_CHECK([--check-config], 111, ignore, ignore)
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
AT_DATA([./helpers/foobar.xml], [dnl
<?xml version="1.0" encoding="utf-8"?>
<helper family="ipv6" module="nf_conntrack_ftp">
@@ -1386,7 +1386,7 @@ WARNING: Invalid rule: Invalid log level
])
FWD_CHECK([--check-config], 28, ignore, ignore)
- IF_IPV6_SUPPORTED([
+ IF_HOST_SUPPORTS_IPV6_RULES([
AT_DATA([./zones/foobar.xml], [dnl
<?xml version="1.0" encoding="utf-8"?>
<zone>
diff --git a/src/tests/functions.at b/src/tests/functions.at
index a84a22c3da4b..d663716cb138 100644
--- a/src/tests/functions.at
+++ b/src/tests/functions.at
@@ -140,7 +140,7 @@ m4_define([FWD_START_TEST], [
m4_define([FWD_END_TEST], [
m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [], [
- IF_IPV6_SUPPORTED([], [
+ IF_HOST_SUPPORTS_IP6TABLES([], [
sed -i "/WARNING: ip6tables not usable, disabling IPv6 firewall/d" ./firewalld.log
])
sed -i "/modprobe: ERROR:/d" ./firewalld.log
@@ -442,7 +442,7 @@ m4_define([IF_HOST_SUPPORTS_IPV6], [
fi
])
-m4_define([IF_IPV6_SUPPORTED], [
+m4_define([IF_HOST_SUPPORTS_IPV6_RULES], [
m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [$1], [
m4_if(nftables, FIREWALL_BACKEND, [$1], [
IF_HOST_SUPPORTS_IP6TABLES([$1], [$2])
diff --git a/src/tests/regression/gh258.at b/src/tests/regression/gh258.at
index a4b86e8a006f..5671c37ba432 100644
--- a/src/tests/regression/gh258.at
+++ b/src/tests/regression/gh258.at
@@ -2,7 +2,7 @@ FWD_START_TEST([zone dispatch layout])
AT_KEYWORDS(zone gh258 gh441 rhbz1713823)
FWD_CHECK([--zone=work --add-source="1.2.3.0/24"], 0, ignore)
-IF_IPV6_SUPPORTED([
+IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([--zone=public --add-source="dead:beef::/54"], 0, ignore)
])
FWD_CHECK([--zone=work --add-interface=dummy0], 0, ignore)
diff --git a/src/tests/regression/gh335.at b/src/tests/regression/gh335.at
index d3c2b225a2df..c5ed4919b015 100644
--- a/src/tests/regression/gh335.at
+++ b/src/tests/regression/gh335.at
@@ -9,7 +9,7 @@ NS_CHECK([[sysctl -a |grep "net.ipv4.conf.all.forwarding[ ]*=[ ]*1"]], 0, [ignor
NS_CHECK([[sysctl -a |grep "net.ipv6.conf.all.forwarding[ ]*=[ ]*1"]], 1, [ignore], [ignore])
FWD_RELOAD
-IF_IPV6_SUPPORTED([
+IF_HOST_SUPPORTS_IPV6_RULES([
NS_CHECK([sysctl -w net.ipv4.conf.all.forwarding=0], 0, [ignore], [ignore])
IF_HOST_SUPPORTS_IPV6([
NS_CHECK([sysctl -w net.ipv6.conf.all.forwarding=0], 0, [ignore], [ignore])
@@ -31,7 +31,7 @@ NS_CHECK([[sysctl -a |grep "net.ipv4.conf.all.forwarding[ ]*=[ ]*1"]], 0, [ignor
NS_CHECK([[sysctl -a |grep "net.ipv6.conf.all.forwarding[ ]*=[ ]*1"]], 1, [ignore], [ignore])
FWD_RELOAD
-IF_IPV6_SUPPORTED([
+IF_HOST_SUPPORTS_IPV6_RULES([
NS_CHECK([sysctl -w net.ipv4.conf.all.forwarding=0], 0, [ignore], [ignore])
IF_HOST_SUPPORTS_IPV6([
NS_CHECK([sysctl -w net.ipv6.conf.all.forwarding=0], 0, [ignore], [ignore])
@@ -58,7 +58,7 @@ FWD_CHECK([-q --add-rich-rule='rule family=ipv4 forward-port port="12345" protoc
NS_CHECK([[sysctl -a |grep "net.ipv4.conf.all.forwarding[ ]*=[ ]*1"]], 1, [ignore], [ignore])
NS_CHECK([[sysctl -a |grep "net.ipv6.conf.all.forwarding[ ]*=[ ]*1"]], 1, [ignore], [ignore])
-IF_IPV6_SUPPORTED([
+IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([-q --add-rich-rule='rule family=ipv6 forward-port port="12345" protocol="tcp" to-port="54321"'])
NS_CHECK([[sysctl -a |grep "net.ipv4.conf.all.forwarding[ ]*=[ ]*1"]], 1, [ignore], [ignore])
NS_CHECK([[sysctl -a |grep "net.ipv6.conf.all.forwarding[ ]*=[ ]*1"]], 1, [ignore], [ignore])
diff --git a/src/tests/regression/rhbz1734765.at b/src/tests/regression/rhbz1734765.at
index de8e1ab40598..276c1e433025 100644
--- a/src/tests/regression/rhbz1734765.at
+++ b/src/tests/regression/rhbz1734765.at
@@ -26,7 +26,7 @@ FWD_CHECK([-q --permanent --zone=foobar_04 --add-source="10.2.0.0/16"])
FWD_CHECK([-q --permanent --zone=foobar_00 --add-source="10.1.1.1"])
FWD_CHECK([-q --permanent --zone=foobar_03 --add-source="10.2.2.0/24"])
FWD_CHECK([-q --permanent --zone=foobar_05 --add-source="10.0.0.0/8"])
-IF_IPV6_SUPPORTED([
+IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([-q --permanent --zone=foobar_01 --add-source="1234:5678::1:1:0/112"])
FWD_CHECK([-q --permanent --zone=foobar_02 --add-source="1234:5678::1:0:0/96"])
FWD_CHECK([-q --permanent --zone=foobar_04 --add-source="1234:5678::2:0:0/96"])
@@ -61,7 +61,7 @@ NFT_LIST_SET([ipsetv6], 0, [dnl
FWD_CHECK([-q --zone=foobar_010 --add-source="10.10.10.10"])
FWD_CHECK([-q --zone=public --add-source="20.20.20.20"])
-IF_IPV6_SUPPORTED([
+IF_HOST_SUPPORTS_IPV6_RULES([
FWD_CHECK([-q --zone=foobar_010 --add-source="1234:5678::10:10:10"])
FWD_CHECK([-q --zone=public --add-source="1234:5678::20:20:20"])
FWD_CHECK([-q --zone=foobar_012 --add-source ipset:ipsetv6])
--
2.23.0