|
|
00d018 |
From ed42b8048e97040802da727f77cad4a1bb5ff42b Mon Sep 17 00:00:00 2001
|
|
|
00d018 |
From: Eric Garver <eric@garver.life>
|
|
|
00d018 |
Date: Wed, 26 Aug 2020 14:28:45 -0400
|
|
|
00d018 |
Subject: [PATCH 58/62] test(zone): rich rule parsing bottleneck
|
|
|
00d018 |
|
|
|
00d018 |
Coverage for rhbz 1871298.
|
|
|
00d018 |
Verify we can parse a large amount of rich rules in a reasonable time.
|
|
|
00d018 |
|
|
|
00d018 |
This test took 3m before the fix and now takes 18s after the fix.
|
|
|
00d018 |
Considering it "failed" after 45s should give us plenty of headroom.
|
|
|
00d018 |
|
|
|
00d018 |
(cherry picked from commit ece30971412eedb9032b0d87233ca21ef9154830)
|
|
|
00d018 |
(cherry picked from commit b21f071851ffec6d3a382b6e60eb88dcda7df467)
|
|
|
00d018 |
---
|
|
|
00d018 |
src/tests/regression/regression.at | 1 +
|
|
|
00d018 |
src/tests/regression/rhbz1871298.at | 18 ++++++++++++++++++
|
|
|
00d018 |
2 files changed, 19 insertions(+)
|
|
|
00d018 |
create mode 100644 src/tests/regression/rhbz1871298.at
|
|
|
00d018 |
|
|
|
00d018 |
diff --git a/src/tests/regression/regression.at b/src/tests/regression/regression.at
|
|
|
00d018 |
index d7b4d56239d1..65540840f50e 100644
|
|
|
00d018 |
--- a/src/tests/regression/regression.at
|
|
|
00d018 |
+++ b/src/tests/regression/regression.at
|
|
|
00d018 |
@@ -34,3 +34,4 @@ m4_include([regression/rhbz1689429.at])
|
|
|
00d018 |
m4_include([regression/rhbz1483921.at])
|
|
|
00d018 |
m4_include([regression/rhbz1541077.at])
|
|
|
00d018 |
m4_include([regression/rhbz1855140.at])
|
|
|
00d018 |
+m4_include([regression/rhbz1871298.at])
|
|
|
00d018 |
diff --git a/src/tests/regression/rhbz1871298.at b/src/tests/regression/rhbz1871298.at
|
|
|
00d018 |
new file mode 100644
|
|
|
00d018 |
index 000000000000..0689399d85ec
|
|
|
00d018 |
--- /dev/null
|
|
|
00d018 |
+++ b/src/tests/regression/rhbz1871298.at
|
|
|
00d018 |
@@ -0,0 +1,18 @@
|
|
|
00d018 |
+FWD_START_TEST([rich rule parsing bottleneck])
|
|
|
00d018 |
+AT_KEYWORDS(rich offline rhbz1871298)
|
|
|
00d018 |
+
|
|
|
00d018 |
+AT_SKIP_IF([! NS_CMD([which timeout >/dev/null 2>&1])])
|
|
|
00d018 |
+
|
|
|
00d018 |
+NS_CHECK([mkdir -p ./zones])
|
|
|
00d018 |
+NS_CHECK([echo '' > ./zones/foobar.xml])
|
|
|
00d018 |
+NS_CHECK([echo "<zone>" >> ./zones/foobar.xml])
|
|
|
00d018 |
+NS_CHECK([echo "<short>foobar</short>" >> ./zones/foobar.xml])
|
|
|
00d018 |
+NS_CHECK([sh -c 'for I in $(seq 10000); do echo "<rule family=\"ipv4\"><port protocol=\"tcp\" port=\"$I\" /><accept/></rule>" >> ./zones/foobar.xml; done'])
|
|
|
00d018 |
+NS_CHECK([echo "</zone>" >> ./zones/foobar.xml])
|
|
|
00d018 |
+
|
|
|
00d018 |
+if test "x${FIREWALLD_DEFAULT_CONFIG}" != x ; then
|
|
|
00d018 |
+ FIREWALL_OFFLINE_CMD_ARGS+=" --default-config ${FIREWALLD_DEFAULT_CONFIG}"
|
|
|
00d018 |
+fi
|
|
|
00d018 |
+NS_CHECK([timeout 45 firewall-offline-cmd --system-config ./ $FIREWALL_OFFLINE_CMD_ARGS --check-config], 0, [ignore])
|
|
|
00d018 |
+
|
|
|
00d018 |
+FWD_END_TEST
|
|
|
00d018 |
--
|
|
|
00d018 |
2.28.0
|
|
|
00d018 |
|