Blame SOURCES/0034-test-zone-verify-overlapping-ports-don-t-halt-zone-l.patch

63f414
From 7c1e62b4933f2b110dcedc411b4381c00abe799f Mon Sep 17 00:00:00 2001
63f414
From: Eric Garver <eric@garver.life>
63f414
Date: Thu, 3 Jun 2021 11:27:11 -0400
63f414
Subject: [PATCH 34/36] test(zone): verify overlapping ports don't halt zone
63f414
 loading
63f414
63f414
We can warn about the overlapping ports, but don't completely error out.
63f414
63f414
Coverage: rhbz 1914935
63f414
(cherry picked from commit 012a87a343673c7699f48fa6af973c890be08671)
63f414
(cherry picked from commit 50e4c979283eee83bf0c707184cd0ca9bf112e85)
63f414
---
63f414
 src/tests/regression/regression.at  |  1 +
63f414
 src/tests/regression/rhbz1914935.at | 64 +++++++++++++++++++++++++++++
63f414
 2 files changed, 65 insertions(+)
63f414
 create mode 100644 src/tests/regression/rhbz1914935.at
63f414
63f414
diff --git a/src/tests/regression/regression.at b/src/tests/regression/regression.at
63f414
index 2a5ad9ef995a..aadd948a459f 100644
63f414
--- a/src/tests/regression/regression.at
63f414
+++ b/src/tests/regression/regression.at
63f414
@@ -41,3 +41,4 @@ m4_include([regression/gh703.at])
63f414
 m4_include([regression/ipset_netmask_allowed.at])
63f414
 m4_include([regression/rhbz1940928.at])
63f414
 m4_include([regression/rhbz1936896.at])
63f414
+m4_include([regression/rhbz1914935.at])
63f414
diff --git a/src/tests/regression/rhbz1914935.at b/src/tests/regression/rhbz1914935.at
63f414
new file mode 100644
63f414
index 000000000000..5b110ea4cf4d
63f414
--- /dev/null
63f414
+++ b/src/tests/regression/rhbz1914935.at
63f414
@@ -0,0 +1,64 @@
63f414
+FWD_START_TEST([zone overlapping ports])
63f414
+AT_KEYWORDS(zone port rhbz1914935)
63f414
+
63f414
+AT_CHECK([mkdir -p ./zones])
63f414
+
63f414
+AT_DATA([./zones/foobar.xml], [dnl
63f414
+
63f414
+<zone>
63f414
+<port port="1024-65535" protocol="tcp" />
63f414
+<port port="1234" protocol="tcp" />
63f414
+<port port="2000-3000" protocol="tcp" />
63f414
+</zone>
63f414
+])
63f414
+FWD_RELOAD
63f414
+FWD_GREP_LOG([WARNING: ALREADY_ENABLED: '1234:tcp' already in 'foobar'])
63f414
+FWD_GREP_LOG([WARNING: ALREADY_ENABLED: '2000-3000:tcp' already in 'foobar'])
63f414
+FWD_CHECK([--zone foobar --list-ports], 0, [dnl
63f414
+1024-65535/tcp
63f414
+])
63f414
+
63f414
+AT_DATA([./zones/foobar.xml], [dnl
63f414
+
63f414
+<zone>
63f414
+<source-port port="1024-65535" protocol="tcp" />
63f414
+<source-port port="1234" protocol="tcp" />
63f414
+<source-port port="2000-3000" protocol="tcp" />
63f414
+</zone>
63f414
+])
63f414
+FWD_RELOAD
63f414
+FWD_GREP_LOG([WARNING: ALREADY_ENABLED: '1234:tcp' already in 'foobar'])
63f414
+FWD_GREP_LOG([WARNING: ALREADY_ENABLED: '2000-3000:tcp' already in 'foobar'])
63f414
+FWD_CHECK([--zone foobar --list-source-ports], 0, [dnl
63f414
+1024-65535/tcp
63f414
+])
63f414
+
63f414
+dnl this one partially overlaps so it should not throw a warning.
63f414
+AT_DATA([./zones/foobar.xml], [dnl
63f414
+
63f414
+<zone>
63f414
+<port port="1024-2000" protocol="tcp" />
63f414
+<port port="1500-2500" protocol="tcp" />
63f414
+</zone>
63f414
+])
63f414
+FWD_RELOAD
63f414
+FWD_GREP_LOG([WARNING: ALREADY_ENABLED: '1500-2500:tcp' already in 'foobar'], 1)
63f414
+FWD_CHECK([--zone foobar --list-ports], 0, [dnl
63f414
+1024-2500/tcp
63f414
+])
63f414
+
63f414
+dnl this one partially overlaps so it should not throw a warning.
63f414
+AT_DATA([./zones/foobar.xml], [dnl
63f414
+
63f414
+<zone>
63f414
+<source-port port="1024-2000" protocol="tcp" />
63f414
+<source-port port="1500-2500" protocol="tcp" />
63f414
+</zone>
63f414
+])
63f414
+FWD_RELOAD
63f414
+FWD_GREP_LOG([WARNING: ALREADY_ENABLED: '1500-2500:tcp' already in 'foobar'], 1)
63f414
+FWD_CHECK([--zone foobar --list-source-ports], 0, [dnl
63f414
+1024-2500/tcp
63f414
+])
63f414
+
63f414
+FWD_END_TEST([-e '/WARNING: ALREADY_ENABLED:/d'])
63f414
-- 
63f414
2.27.0
63f414