aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-11-03 11:02:54 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-11-03 19:11:45 -0400
commit3fea9a564c4112d04f6324df0d8b212e78feb5b3 (patch)
tree0fd9e6047967cf2c0bc0b0b628686866c802a07c /tests
parenta93e118a9c88df52fd2c701d2276185f877d565c (diff)
downloadsos-3fea9a564c4112d04f6324df0d8b212e78feb5b3.tar.gz
[Plugin] Ensure specific plugin timeouts are only set for that plugin
It was discovered that setting a specific plugin timeout via the `-k $plugin.timeout` option could influence the timeout setting for other plugins that are not also having their timeout explicitly set. Fix this by moving the default plugin opts into `Plugin.__init__()` so that each plugin is ensured a private copy of these default plugin options. Additionally, add more timeout data to plugin manifest entries to allow for better tracking of this setting. Adds a test case for this scenario. Closes: #2744 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/vendor_tests/redhat/rhbz2018033.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/vendor_tests/redhat/rhbz2018033.py b/tests/vendor_tests/redhat/rhbz2018033.py
new file mode 100644
index 00000000..25b9090c
--- /dev/null
+++ b/tests/vendor_tests/redhat/rhbz2018033.py
@@ -0,0 +1,35 @@
+# This file is part of the sos project: https://github.com/sosreport/sos
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# version 2 of the GNU General Public License.
+#
+# See the LICENSE file in the source distribution for further information.
+
+from sos_tests import StageTwoReportTest
+
+
+class rhbz2018033(StageTwoReportTest):
+ """Test that control of plugin timeouts is independent of other plugin
+ timeouts. See #2744.
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=2018033
+
+ :avocado: tags=stagetwo
+ """
+
+ install_plugins = ['timeout_test']
+ sos_cmd = '-vvv -o timeout_test,networking -k timeout_test.timeout=1 --plugin-timeout=123'
+
+ def test_timeouts_separate(self):
+ self.assertSosUILogContains('Plugin timeout_test timed out')
+ self.assertSosUILogNotContains('Plugin networking timed out')
+
+ def test_timeout_manifest_recorded(self):
+ testm = self.get_plugin_manifest('timeout_test')
+ self.assertTrue(testm['timeout_hit'])
+ self.assertTrue(testm['timeout'] == 1)
+
+ netm = self.get_plugin_manifest('networking')
+ self.assertFalse(netm['timeout_hit'])
+ self.assertTrue(netm['timeout'] == 123)