From 681a6ee9ac5b82e883c312273384fa9bbbd86681 Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Mon, 24 May 2021 16:02:04 -0400 Subject: [tests] Improve failed command reporting in test output Improves error reporting for failed sos commands by logging stderr (or stdout if stderr is not populated) to the console, which was previously being truncated by the builtin error handling of avocado. Printed output is limited to the last 8k to avoid dumping several MBs at a time for scenarios such as timeouts where command failure may generate significant logging prior to failing. Included with this are 2 minor changes to existing tests. First, remove verbose output from the expected plugins test to reduce otherwise irrelevant output for command failures. Second limit the number of plugins run for the LogLevelTest, both to reduce overall run time for a test where we aren't testing specific plugins and to improve readability of failures for such a test. Resolves: #2556 Signed-off-by: Jake Hunsaker --- tests/report_tests/basic_report_tests.py | 2 +- tests/report_tests/smoke_tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/report_tests') diff --git a/tests/report_tests/basic_report_tests.py b/tests/report_tests/basic_report_tests.py index 4a5e0001..2d2a6c30 100644 --- a/tests/report_tests/basic_report_tests.py +++ b/tests/report_tests/basic_report_tests.py @@ -39,7 +39,7 @@ class LogLevelTest(StageOneReportTest): :avocado: tags=stageone """ - sos_cmd = '-vvv' + sos_cmd = '-vvv -o kernel,host,boot,filesys' def test_archive_logging_enabled(self): self.assertSosLogContains('DEBUG: \[archive:.*\]') diff --git a/tests/report_tests/smoke_tests.py b/tests/report_tests/smoke_tests.py index cf79a076..a313405e 100644 --- a/tests/report_tests/smoke_tests.py +++ b/tests/report_tests/smoke_tests.py @@ -64,7 +64,7 @@ class ExpectedDefaultPluginsTest(StageOneReportTest): :avocado: tags=stageone """ - sos_cmd = '-v ' + sos_cmd = ' ' def test_default_plugins_enabled(self): """These plugins should run on all supported hosts by default everytime -- cgit