diff options
Diffstat (limited to 'tests/report_tests/plugin_tests/sos_extras')
-rw-r--r-- | tests/report_tests/plugin_tests/sos_extras/sos_extras.py | 32 | ||||
-rw-r--r-- | tests/report_tests/plugin_tests/sos_extras/sos_testing.conf | 4 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/report_tests/plugin_tests/sos_extras/sos_extras.py b/tests/report_tests/plugin_tests/sos_extras/sos_extras.py new file mode 100644 index 00000000..ae5c347a --- /dev/null +++ b/tests/report_tests/plugin_tests/sos_extras/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 = [('sos_testing.conf', '/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') diff --git a/tests/report_tests/plugin_tests/sos_extras/sos_testing.conf b/tests/report_tests/plugin_tests/sos_extras/sos_testing.conf new file mode 100644 index 00000000..40651f4d --- /dev/null +++ b/tests/report_tests/plugin_tests/sos_extras/sos_testing.conf @@ -0,0 +1,4 @@ +# this is a fake sos_extras config file +# +echo sos test +:/etc/fstab |