aboutsummaryrefslogtreecommitdiffstats
path: root/tests/report_tests/timeout
diff options
context:
space:
mode:
authorArif Ali <arif.ali@canonical.com>2024-01-15 18:51:04 -0800
committerJake Hunsaker <jacob.r.hunsaker@gmail.com>2024-04-12 11:50:48 -0400
commit93bcf51257ec4ce2b97c942e51e56546ce8cd0cd (patch)
treedb1e835f5de49918553281726d86f4660731313e /tests/report_tests/timeout
parent4069af4bca5d20662389200f0d426d2d31f054e8 (diff)
downloadsos-93bcf51257ec4ce2b97c942e51e56546ce8cd0cd.tar.gz
[testing] Add most testing via tox.ini
Consolidate testing, so that things can be run from CLI, CI and various other means in a consistent way by using tox. * Updated all the flake8 tests in the tests folder. * Added pylint as a neutral test so that we can work on this in stages and have some collaboration on what we test and don't * The tox tests for unit, stageone, stagetwo testing makes is easier for users to know how to run tests, and not have to do things manually * Using tox for CI doesn't make sense, as that will create virtual envs and will disregard system/snap based python modules so may not work Signed-off-by: Arif Ali <arif.ali@canonical.com>
Diffstat (limited to 'tests/report_tests/timeout')
-rw-r--r--tests/report_tests/timeout/timeout_test.py1
-rw-r--r--tests/report_tests/timeout/timeout_tests.py8
2 files changed, 6 insertions, 3 deletions
diff --git a/tests/report_tests/timeout/timeout_test.py b/tests/report_tests/timeout/timeout_test.py
index cfb148d7..8bc5ae61 100644
--- a/tests/report_tests/timeout/timeout_test.py
+++ b/tests/report_tests/timeout/timeout_test.py
@@ -15,7 +15,6 @@ class TimeoutTest(Plugin, IndependentPlugin):
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')
diff --git a/tests/report_tests/timeout/timeout_tests.py b/tests/report_tests/timeout/timeout_tests.py
index 94117e8e..f18b7b38 100644
--- a/tests/report_tests/timeout/timeout_tests.py
+++ b/tests/report_tests/timeout/timeout_tests.py
@@ -50,9 +50,12 @@ class NativeCmdTimeoutTest(StageTwoReportTest):
self.assertFileCollected('sos_commands/timeout_test/echo_good')
def test_command_timed_out(self):
- self.assertSosLogContains(r"\[plugin:timeout_test\] command 'sleep 30' timed out after 10s")
+ self.assertSosLogContains(
+ r"\[plugin:timeout_test\] command 'sleep 30' timed out after 10s"
+ )
self.assertFileCollected('sos_commands/timeout_test/sleep_30')
+
class MultipleTimeoutValues(NativeCmdTimeoutTest):
"""Test that our plugin timeout option priority is functioning correctly
@@ -60,7 +63,8 @@ class MultipleTimeoutValues(NativeCmdTimeoutTest):
"""
install_plugins = ['timeout_test']
- sos_cmd = '-o timeout_test,host --plugin-timeout=30 -k timeout_test.timeout=60'
+ sos_cmd = ('-o timeout_test,host --plugin-timeout=30 -k '
+ 'timeout_test.timeout=60')
def test_correct_plugin_timeout(self):
man = self.get_plugin_manifest('timeout_test')