aboutsummaryrefslogtreecommitdiffstats
path: root/tests/report_tests/plugin_tests/sos_extras.py
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-03-29 13:20:56 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-04-15 11:33:04 -0400
commit05b456451be1340cf94efacb37fae5130f60f5e1 (patch)
tree240f2946bbcdef4f4eab40028d36da5b40ecec8b /tests/report_tests/plugin_tests/sos_extras.py
parent14910480f1301385d7b83c8d045dc7b1699d37e0 (diff)
downloadsos-05b456451be1340cf94efacb37fae5130f60f5e1.tar.gz
[tests] Add plugin tests for basic functionality
Adds several plugin tests for plugins that can be expected to run on all distributions, in particular these tests are including mostly Stage Two tests. As such, these tests are only recommended to be run on test machines. Related: #2431 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/report_tests/plugin_tests/sos_extras.py')
-rw-r--r--tests/report_tests/plugin_tests/sos_extras.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/report_tests/plugin_tests/sos_extras.py b/tests/report_tests/plugin_tests/sos_extras.py
new file mode 100644
index 00000000..fa618ffb
--- /dev/null
+++ b/tests/report_tests/plugin_tests/sos_extras.py
@@ -0,0 +1,32 @@
+# 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 SosExtrasPluginTest(StageTwoReportTest):
+ """Ensure that the sos_extras plugin is properly executing command and
+ file collections as defined in the sos_extras config file
+
+ :avocado: tags=stagetwo
+ """
+
+ files = ['/etc/sos/extras.d/sos_testing.conf']
+ # rather than only enabling this plugin, make sure the enablement trigger
+ # is working
+ sos_cmd = '-n logs,networking,devicemapper,filesys,systemd'
+
+ def test_extras_enabled(self):
+ self.assertPluginIncluded('sos_extras')
+
+ def test_setup_message_displayed(self):
+ self.assertOutputContains('Collecting data from extras file /etc/sos/extras.d/sos_testing.conf')
+
+ def test_extras_config_parsed(self):
+ self.assertFileCollected('/etc/fstab')
+ self.assertFileCollected('sos_commands/sos_extras/sos_testing.conf/echo_sos_test')