aboutsummaryrefslogtreecommitdiffstats
path: root/tests/report_tests/plugin_tests/sos_extras/sos_extras.py
blob: ae5c347a4b57f10043246aedfccebf4ff8ec9f1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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')