|
|
699691 |
From 7d3b14e91962df42a48f40f8ca5787f914413793 Mon Sep 17 00:00:00 2001
|
|
|
699691 |
From: Eric Garver <eric@garver.life>
|
|
|
699691 |
Date: Wed, 26 Aug 2020 14:28:45 -0400
|
|
|
699691 |
Subject: [PATCH 158/158] test(zone): rich rule parsing bottleneck
|
|
|
699691 |
|
|
|
699691 |
Coverage for rhbz 1871298.
|
|
|
699691 |
Verify we can parse a large amount of rich rules in a reasonable time.
|
|
|
699691 |
|
|
|
699691 |
This test took 3m before the fix and now takes 18s after the fix.
|
|
|
699691 |
Considering it "failed" after 45s should give us plenty of headroom.
|
|
|
699691 |
|
|
|
699691 |
(cherry picked from commit ece30971412eedb9032b0d87233ca21ef9154830)
|
|
|
699691 |
(cherry picked from commit 10960dba93f8dfe607010655cbaeaa7f535bfa96)
|
|
|
699691 |
---
|
|
|
699691 |
src/tests/regression/regression.at | 1 +
|
|
|
699691 |
src/tests/regression/rhbz1871298.at | 18 ++++++++++++++++++
|
|
|
699691 |
2 files changed, 19 insertions(+)
|
|
|
699691 |
create mode 100644 src/tests/regression/rhbz1871298.at
|
|
|
699691 |
|
|
|
699691 |
diff --git a/src/tests/regression/regression.at b/src/tests/regression/regression.at
|
|
|
699691 |
index 42f299f16f1a..6e4dc21384d3 100644
|
|
|
699691 |
--- a/src/tests/regression/regression.at
|
|
|
699691 |
+++ b/src/tests/regression/regression.at
|
|
|
699691 |
@@ -28,3 +28,4 @@ m4_include([regression/gh567.at])
|
|
|
699691 |
m4_include([regression/rhbz1779835.at])
|
|
|
699691 |
m4_include([regression/gh599.at])
|
|
|
699691 |
m4_include([regression/rhbz1839781.at])
|
|
|
699691 |
+m4_include([regression/rhbz1871298.at])
|
|
|
699691 |
diff --git a/src/tests/regression/rhbz1871298.at b/src/tests/regression/rhbz1871298.at
|
|
|
699691 |
new file mode 100644
|
|
|
699691 |
index 000000000000..0689399d85ec
|
|
|
699691 |
--- /dev/null
|
|
|
699691 |
+++ b/src/tests/regression/rhbz1871298.at
|
|
|
699691 |
@@ -0,0 +1,18 @@
|
|
|
699691 |
+FWD_START_TEST([rich rule parsing bottleneck])
|
|
|
699691 |
+AT_KEYWORDS(rich offline rhbz1871298)
|
|
|
699691 |
+
|
|
|
699691 |
+AT_SKIP_IF([! NS_CMD([which timeout >/dev/null 2>&1])])
|
|
|
699691 |
+
|
|
|
699691 |
+NS_CHECK([mkdir -p ./zones])
|
|
|
699691 |
+NS_CHECK([echo '' > ./zones/foobar.xml])
|
|
|
699691 |
+NS_CHECK([echo "<zone>" >> ./zones/foobar.xml])
|
|
|
699691 |
+NS_CHECK([echo "<short>foobar</short>" >> ./zones/foobar.xml])
|
|
|
699691 |
+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'])
|
|
|
699691 |
+NS_CHECK([echo "</zone>" >> ./zones/foobar.xml])
|
|
|
699691 |
+
|
|
|
699691 |
+if test "x${FIREWALLD_DEFAULT_CONFIG}" != x ; then
|
|
|
699691 |
+ FIREWALL_OFFLINE_CMD_ARGS+=" --default-config ${FIREWALLD_DEFAULT_CONFIG}"
|
|
|
699691 |
+fi
|
|
|
699691 |
+NS_CHECK([timeout 45 firewall-offline-cmd --system-config ./ $FIREWALL_OFFLINE_CMD_ARGS --check-config], 0, [ignore])
|
|
|
699691 |
+
|
|
|
699691 |
+FWD_END_TEST
|
|
|
699691 |
--
|
|
|
699691 |
2.27.0
|
|
|
699691 |
|