Blame SOURCES/0078-test-regression-rhbz1734765-add-coverage-for-rhbz-17.patch

c8bceb
From 8baba36ffff504e6c107448b002a553a2c072850 Mon Sep 17 00:00:00 2001
c8bceb
From: Eric Garver <eric@garver.life>
c8bceb
Date: Wed, 7 Aug 2019 08:41:11 -0400
c8bceb
Subject: [PATCH 78/79] test: regression/rhbz1734765: add coverage for rhbz
c8bceb
 1738545
c8bceb
c8bceb
(cherry picked from commit 20cd5c7d29c586fa55e76d6f21adfee6a7ca34bb)
c8bceb
(cherry picked from commit cea43b784a092a8b155190b9988927daeeb0a0a4)
c8bceb
---
c8bceb
 src/tests/regression/rhbz1734765.at | 46 +++++++++++++++++++++++++----
c8bceb
 1 file changed, 41 insertions(+), 5 deletions(-)
c8bceb
c8bceb
diff --git a/src/tests/regression/rhbz1734765.at b/src/tests/regression/rhbz1734765.at
c8bceb
index 5145d716e576..de8e1ab40598 100644
c8bceb
--- a/src/tests/regression/rhbz1734765.at
c8bceb
+++ b/src/tests/regression/rhbz1734765.at
c8bceb
@@ -1,5 +1,5 @@
c8bceb
 FWD_START_TEST([zone sources ordered by name])
c8bceb
-AT_KEYWORDS(zone rhbz1734765 rhbz1421222 gh166)
c8bceb
+AT_KEYWORDS(zone rhbz1734765 rhbz1421222 gh166 rhbz1738545)
c8bceb
 dnl
c8bceb
 dnl Users depend on firewalld ordering source-based zone dispatch by zone name.
c8bceb
 dnl
c8bceb
@@ -11,20 +11,28 @@ FWD_CHECK([-q --permanent --new-zone=foobar_03])
c8bceb
 FWD_CHECK([-q --permanent --new-zone=foobar_01])
c8bceb
 FWD_CHECK([-q --permanent --new-zone=foobar_04])
c8bceb
 FWD_CHECK([-q --permanent --new-zone=foobar_010])
c8bceb
+FWD_CHECK([-q --permanent --new-zone=foobar_011])
c8bceb
+FWD_CHECK([-q --permanent --new-zone=foobar_012])
c8bceb
 
c8bceb
-FWD_CHECK([-q --permanent --zone=foobar_00 --add-source="10.1.1.1"])
c8bceb
+FWD_CHECK([-q --permanent --new-ipset 'ipsetv4' --type hash:ip])
c8bceb
+FWD_CHECK([-q --permanent --new-ipset 'ipsetv6' --type hash:ip --family=inet6])
c8bceb
+FWD_CHECK([-q --permanent --ipset ipsetv4 --add-entry '192.0.2.12'])
c8bceb
+FWD_CHECK([-q --permanent --ipset ipsetv6 --add-entry '::2'])
c8bceb
+
c8bceb
+FWD_CHECK([-q --permanent --zone=foobar_011 --add-source ipset:ipsetv4])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_01 --add-source="10.1.1.0/24"])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_02 --add-source="10.1.0.0/16"])
c8bceb
-FWD_CHECK([-q --permanent --zone=foobar_03 --add-source="10.2.2.0/24"])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_04 --add-source="10.2.0.0/16"])
c8bceb
+FWD_CHECK([-q --permanent --zone=foobar_00 --add-source="10.1.1.1"])
c8bceb
+FWD_CHECK([-q --permanent --zone=foobar_03 --add-source="10.2.2.0/24"])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_05 --add-source="10.0.0.0/8"])
c8bceb
 IF_IPV6_SUPPORTED([
c8bceb
-FWD_CHECK([-q --permanent --zone=foobar_00 --add-source="1234:5678::1:1:1"])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_01 --add-source="1234:5678::1:1:0/112"])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_02 --add-source="1234:5678::1:0:0/96"])
c8bceb
-FWD_CHECK([-q --permanent --zone=foobar_03 --add-source="1234:5678::2:2:0/112"])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_04 --add-source="1234:5678::2:0:0/96"])
c8bceb
+FWD_CHECK([-q --permanent --zone=foobar_03 --add-source="1234:5678::2:2:0/112"])
c8bceb
 FWD_CHECK([-q --permanent --zone=foobar_05 --add-source="1234:5678::0:0:0/80"])
c8bceb
+FWD_CHECK([-q --permanent --zone=foobar_00 --add-source="1234:5678::1:1:1"])
c8bceb
 ])
c8bceb
 
c8bceb
 FWD_CHECK([-q --permanent --zone=internal --add-interface=foobar0])
c8bceb
@@ -32,11 +40,31 @@ FWD_CHECK([-q --permanent --zone=trusted --add-interface=foobar1])
c8bceb
 
c8bceb
 FWD_RELOAD
c8bceb
 
c8bceb
+NFT_LIST_SET([ipsetv4], 0, [dnl
c8bceb
+	table inet firewalld {
c8bceb
+		set ipsetv4 {
c8bceb
+			type ipv4_addr
c8bceb
+			flags interval
c8bceb
+			elements = { 192.0.2.12 }
c8bceb
+		}
c8bceb
+	}
c8bceb
+])
c8bceb
+NFT_LIST_SET([ipsetv6], 0, [dnl
c8bceb
+	table inet firewalld {
c8bceb
+		set ipsetv6 {
c8bceb
+			type ipv6_addr
c8bceb
+			flags interval
c8bceb
+			elements = { ::2 }
c8bceb
+		}
c8bceb
+	}
c8bceb
+])
c8bceb
+
c8bceb
 FWD_CHECK([-q --zone=foobar_010 --add-source="10.10.10.10"])
c8bceb
 FWD_CHECK([-q --zone=public --add-source="20.20.20.20"])
c8bceb
 IF_IPV6_SUPPORTED([
c8bceb
 FWD_CHECK([-q --zone=foobar_010 --add-source="1234:5678::10:10:10"])
c8bceb
 FWD_CHECK([-q --zone=public --add-source="1234:5678::20:20:20"])
c8bceb
+FWD_CHECK([-q --zone=foobar_012 --add-source ipset:ipsetv6])
c8bceb
 ])
c8bceb
 FWD_CHECK([-q --zone=foobar_010 --add-interface=foobar2])
c8bceb
 
c8bceb
@@ -50,6 +78,8 @@ NFT_LIST_RULES([inet], [filter_INPUT_ZONES], 0, [dnl
c8bceb
             ip6 saddr 1234:5678::1:1:0/112 goto filter_IN_foobar_01
c8bceb
             ip saddr 10.10.10.10 goto filter_IN_foobar_010
c8bceb
             ip6 saddr 1234:5678::10:10:10 goto filter_IN_foobar_010
c8bceb
+            ip saddr @ipsetv4 goto filter_IN_foobar_011
c8bceb
+            ip6 saddr @ipsetv6 goto filter_IN_foobar_012
c8bceb
             ip saddr 10.1.0.0/16 goto filter_IN_foobar_02
c8bceb
             ip6 saddr 1234:5678::1:0:0/96 goto filter_IN_foobar_02
c8bceb
             ip saddr 10.2.2.0/24 goto filter_IN_foobar_03
c8bceb
@@ -73,6 +103,7 @@ NFT_LIST_RULES([ip], [nat_POSTROUTING_ZONES], 0, [dnl
c8bceb
             ip daddr 10.1.1.1 goto nat_POST_foobar_00
c8bceb
             ip daddr 10.1.1.0/24 goto nat_POST_foobar_01
c8bceb
             ip daddr 10.10.10.10 goto nat_POST_foobar_010
c8bceb
+            ip daddr @ipsetv4 goto nat_POST_foobar_011
c8bceb
             ip daddr 10.1.0.0/16 goto nat_POST_foobar_02
c8bceb
             ip daddr 10.2.2.0/24 goto nat_POST_foobar_03
c8bceb
             ip daddr 10.2.0.0/16 goto nat_POST_foobar_04
c8bceb
@@ -91,6 +122,7 @@ NFT_LIST_RULES([ip6], [nat_POSTROUTING_ZONES], 0, [dnl
c8bceb
             ip6 daddr 1234:5678::1:1:1 goto nat_POST_foobar_00
c8bceb
             ip6 daddr 1234:5678::1:1:0/112 goto nat_POST_foobar_01
c8bceb
             ip6 daddr 1234:5678::10:10:10 goto nat_POST_foobar_010
c8bceb
+            ip6 daddr @ipsetv6 goto nat_POST_foobar_012
c8bceb
             ip6 daddr 1234:5678::1:0:0/96 goto nat_POST_foobar_02
c8bceb
             ip6 daddr 1234:5678::2:2:0/112 goto nat_POST_foobar_03
c8bceb
             ip6 daddr 1234:5678::2:0:0/96 goto nat_POST_foobar_04
c8bceb
@@ -109,6 +141,7 @@ IPTABLES_LIST_RULES([filter], [INPUT_ZONES], 0,
c8bceb
   [[IN_foobar_00 all -- 10.1.1.1 0.0.0.0/0 [goto]
c8bceb
     IN_foobar_01 all -- 10.1.1.0/24 0.0.0.0/0 [goto]
c8bceb
     IN_foobar_010 all -- 10.10.10.10 0.0.0.0/0 [goto]
c8bceb
+    IN_foobar_011 all -- 0.0.0.0/0 0.0.0.0/0 [goto] match-set ipsetv4 src
c8bceb
     IN_foobar_02 all -- 10.1.0.0/16 0.0.0.0/0 [goto]
c8bceb
     IN_foobar_03 all -- 10.2.2.0/24 0.0.0.0/0 [goto]
c8bceb
     IN_foobar_04 all -- 10.2.0.0/16 0.0.0.0/0 [goto]
c8bceb
@@ -123,6 +156,7 @@ IP6TABLES_LIST_RULES([filter], [INPUT_ZONES], 0,
c8bceb
   [[IN_foobar_00 all 1234:5678::1:1:1 ::/0 [goto]
c8bceb
     IN_foobar_01 all 1234:5678::1:1:0/112 ::/0 [goto]
c8bceb
     IN_foobar_010 all 1234:5678::10:10:10 ::/0 [goto]
c8bceb
+    IN_foobar_012 all ::/0 ::/0 [goto] match-set ipsetv6 src
c8bceb
     IN_foobar_02 all 1234:5678::1:0:0/96 ::/0 [goto]
c8bceb
     IN_foobar_03 all 1234:5678::2:2:0/112 ::/0 [goto]
c8bceb
     IN_foobar_04 all 1234:5678::2:0:0/96 ::/0 [goto]
c8bceb
@@ -137,6 +171,7 @@ IPTABLES_LIST_RULES([nat], [POSTROUTING_ZONES], 0,
c8bceb
   [[POST_foobar_00 all -- 0.0.0.0/0 10.1.1.1 [goto]
c8bceb
     POST_foobar_01 all -- 0.0.0.0/0 10.1.1.0/24 [goto]
c8bceb
     POST_foobar_010 all -- 0.0.0.0/0 10.10.10.10 [goto]
c8bceb
+    POST_foobar_011 all -- 0.0.0.0/0 0.0.0.0/0 [goto] match-set ipsetv4 dst
c8bceb
     POST_foobar_02 all -- 0.0.0.0/0 10.1.0.0/16 [goto]
c8bceb
     POST_foobar_03 all -- 0.0.0.0/0 10.2.2.0/24 [goto]
c8bceb
     POST_foobar_04 all -- 0.0.0.0/0 10.2.0.0/16 [goto]
c8bceb
@@ -151,6 +186,7 @@ IP6TABLES_LIST_RULES([nat], [POSTROUTING_ZONES], 0,
c8bceb
   [[POST_foobar_00 all ::/0 1234:5678::1:1:1 [goto]
c8bceb
     POST_foobar_01 all ::/0 1234:5678::1:1:0/112 [goto]
c8bceb
     POST_foobar_010 all ::/0 1234:5678::10:10:10 [goto]
c8bceb
+    POST_foobar_012 all ::/0 ::/0 [goto] match-set ipsetv6 dst
c8bceb
     POST_foobar_02 all ::/0 1234:5678::1:0:0/96 [goto]
c8bceb
     POST_foobar_03 all ::/0 1234:5678::2:2:0/112 [goto]
c8bceb
     POST_foobar_04 all ::/0 1234:5678::2:0:0/96 [goto]
c8bceb
-- 
c8bceb
2.20.1
c8bceb