diff options
Diffstat (limited to 'tests/report_tests')
-rw-r--r-- | tests/report_tests/options_tests/options_tests.py (renamed from tests/report_tests/options_tests.py) | 2 | ||||
-rw-r--r-- | tests/report_tests/options_tests/options_tests_sos.conf | 18 | ||||
-rw-r--r-- | tests/report_tests/plugin_tests/plugin_environment/default_env_test.py | 28 | ||||
-rw-r--r-- | tests/report_tests/plugin_tests/plugin_environment/plugin_environment.py (renamed from tests/report_tests/plugin_tests/plugin_environment.py) | 2 | ||||
-rw-r--r-- | tests/report_tests/plugin_tests/sos_extras/sos_extras.py (renamed from tests/report_tests/plugin_tests/sos_extras.py) | 2 | ||||
-rw-r--r-- | tests/report_tests/plugin_tests/sos_extras/sos_testing.conf | 4 | ||||
-rw-r--r-- | tests/report_tests/plugin_tests/sudo/sudo-ldap.conf | 6 | ||||
-rw-r--r-- | tests/report_tests/plugin_tests/sudo/sudo.py (renamed from tests/report_tests/plugin_tests/sudo.py) | 2 | ||||
-rw-r--r-- | tests/report_tests/timeout/timeout_test.py | 22 | ||||
-rw-r--r-- | tests/report_tests/timeout/timeout_tests.py (renamed from tests/report_tests/timeout_tests.py) | 0 |
10 files changed, 82 insertions, 4 deletions
diff --git a/tests/report_tests/options_tests.py b/tests/report_tests/options_tests/options_tests.py index 17948795..f8e1ee60 100644 --- a/tests/report_tests/options_tests.py +++ b/tests/report_tests/options_tests/options_tests.py @@ -16,7 +16,7 @@ class OptionsFromConfigTest(StageTwoReportTest): :avocado: tags=stagetwo """ - files = [('/etc/sos/options_tests_sos.conf', '/etc/sos/sos.conf')] + files = [('options_tests_sos.conf', '/etc/sos/sos.conf')] sos_cmd = '-v ' def test_case_id_from_config(self): diff --git a/tests/report_tests/options_tests/options_tests_sos.conf b/tests/report_tests/options_tests/options_tests_sos.conf new file mode 100644 index 00000000..c0f641d9 --- /dev/null +++ b/tests/report_tests/options_tests/options_tests_sos.conf @@ -0,0 +1,18 @@ +[global] +#verbose = 3 + +[report] +skip-plugins = networking,logs +case-id = 8675309 + +[collect] +#primary = myhost.example.com + +[clean] +#no-update = true + +[plugin_options] +#rpm.rpmva = off +kernel.with-timer = on +kernel.trace = yes +networking.traceroute = yes diff --git a/tests/report_tests/plugin_tests/plugin_environment/default_env_test.py b/tests/report_tests/plugin_tests/plugin_environment/default_env_test.py new file mode 100644 index 00000000..d1d1fb78 --- /dev/null +++ b/tests/report_tests/plugin_tests/plugin_environment/default_env_test.py @@ -0,0 +1,28 @@ +# 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.report.plugins import Plugin, IndependentPlugin + + +class DefaultEnv(Plugin, IndependentPlugin): + + plugin_name = 'default_env_test' + short_desc = 'Fake plugin to test default env var handling' + + def setup(self): + self.set_default_cmd_environment({ + 'TORVALDS': 'Linus', + 'GREATESTSPORT': 'hockey' + }) + + self.add_cmd_output( + "sh -c 'echo Does '$TORVALDS' play '$GREATESTSPORT'?'", + suggest_filename='env_var_test' + ) + + self.add_env_var(['TORVALDS', 'GREATESTSPORT']) diff --git a/tests/report_tests/plugin_tests/plugin_environment.py b/tests/report_tests/plugin_tests/plugin_environment/plugin_environment.py index 3158437a..d7d36069 100644 --- a/tests/report_tests/plugin_tests/plugin_environment.py +++ b/tests/report_tests/plugin_tests/plugin_environment/plugin_environment.py @@ -16,7 +16,7 @@ class PluginDefaultEnvironmentTest(StageTwoReportTest): Ensure that being able to set a default set of environment variables is working correctly and does not leave a lingering env var on the system - :avocado: tags=stageone + :avocado: tags=stagetwo """ install_plugins = ['default_env_test'] diff --git a/tests/report_tests/plugin_tests/sos_extras.py b/tests/report_tests/plugin_tests/sos_extras/sos_extras.py index fa618ffb..ae5c347a 100644 --- a/tests/report_tests/plugin_tests/sos_extras.py +++ b/tests/report_tests/plugin_tests/sos_extras/sos_extras.py @@ -16,7 +16,7 @@ class SosExtrasPluginTest(StageTwoReportTest): :avocado: tags=stagetwo """ - files = ['/etc/sos/extras.d/sos_testing.conf'] + 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' 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 diff --git a/tests/report_tests/plugin_tests/sudo/sudo-ldap.conf b/tests/report_tests/plugin_tests/sudo/sudo-ldap.conf new file mode 100644 index 00000000..76300658 --- /dev/null +++ b/tests/report_tests/plugin_tests/sudo/sudo-ldap.conf @@ -0,0 +1,6 @@ +# This is a fake sudo-ldap.conf +# +# Nothing important is here +uri ldaps://ldap.example.com +binddn cn=sudo,dc=example,dc=com +bindpw sostestpassword diff --git a/tests/report_tests/plugin_tests/sudo.py b/tests/report_tests/plugin_tests/sudo/sudo.py index ad766b4f..e04a73a7 100644 --- a/tests/report_tests/plugin_tests/sudo.py +++ b/tests/report_tests/plugin_tests/sudo/sudo.py @@ -29,7 +29,7 @@ class SudoLdapScrubbedTest(StageTwoReportTest): """ sos_cmd = '-o sudo' - files = ['/etc/sudo-ldap.conf'] + files = [('sudo-ldap.conf', '/etc/sudo-ldap.conf')] def test_bindpw_scrubbed(self): self.assertFileNotHasContent('/etc/sudo-ldap.conf', 'sostestpassword') diff --git a/tests/report_tests/timeout/timeout_test.py b/tests/report_tests/timeout/timeout_test.py new file mode 100644 index 00000000..cfb148d7 --- /dev/null +++ b/tests/report_tests/timeout/timeout_test.py @@ -0,0 +1,22 @@ +# 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.report.plugins import Plugin, IndependentPlugin + + +class TimeoutTest(Plugin, IndependentPlugin): + + plugin_name = 'timeout_test' + short_desc = 'Tests timeout functionality in test suite' + plugin_timeout = 100 + + + def setup(self): + self.add_cmd_output('sleep 15') + self.add_cmd_output('echo I slept great', suggest_filename='echo_good') + self.add_cmd_output('sleep 30', timeout=10) diff --git a/tests/report_tests/timeout_tests.py b/tests/report_tests/timeout/timeout_tests.py index ffce9231..ffce9231 100644 --- a/tests/report_tests/timeout_tests.py +++ b/tests/report_tests/timeout/timeout_tests.py |