aboutsummaryrefslogtreecommitdiffstats
path: root/tests/report_tests
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-04-22 15:08:07 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-04-28 10:16:55 -0400
commit1d0729a9dcfe3f3cebb961114c9bc05136cf8cfb (patch)
tree926b134838a770dc246888bd46dbe5cb19fff0b7 /tests/report_tests
parent652d11827fd26fd276b78ba0e77b6fcd9581d5b6 (diff)
downloadsos-1d0729a9dcfe3f3cebb961114c9bc05136cf8cfb.tar.gz
[logging] Fix archive debug logging, adjust verbosity levels
Fixes an issue where archive debug logging was controlled by the use of `--debug` rather than `--verbose`. Removes a superfluous log in `FileCacheArchive.add_link()`. Also, adjusts the different verbosity levels to be more meaninful. Now, the use of `-v` will enable debug logging but will not print those messages to console, `-vv` will print debug logging to console, while `-vvv` will enable archive debug logging which is expected to be significant due to most file operations being logging at some point with archive debug logging. Resolves: #2507 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/report_tests')
-rw-r--r--tests/report_tests/basic_report_tests.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/report_tests/basic_report_tests.py b/tests/report_tests/basic_report_tests.py
index 0cf5bd4e..4a5e0001 100644
--- a/tests/report_tests/basic_report_tests.py
+++ b/tests/report_tests/basic_report_tests.py
@@ -15,11 +15,15 @@ class NormalSoSReport(StageOneReportTest):
:avocado: tags=stageone
"""
- sos_cmd = '-vvv --label thisismylabel'
+ sos_cmd = '-v --label thisismylabel'
def test_debug_in_logs_verbose(self):
self.assertSosLogContains('DEBUG')
+ def test_debug_not_printed_to_console(self):
+ self.assertOutputNotContains('added cmd output')
+ self.assertOutputNotContains('\[archive:.*\]')
+
def test_postproc_called(self):
self.assertSosLogContains('substituting scrpath')
@@ -30,6 +34,21 @@ class NormalSoSReport(StageOneReportTest):
self.assertFileCollected('free')
+class LogLevelTest(StageOneReportTest):
+ """
+ :avocado: tags=stageone
+ """
+
+ sos_cmd = '-vvv'
+
+ def test_archive_logging_enabled(self):
+ self.assertSosLogContains('DEBUG: \[archive:.*\]')
+ self.assertSosLogContains('Making leading paths for')
+
+ def test_debug_printed_to_console(self):
+ self.assertOutputContains('\[plugin:.*\]')
+
+
class RestrictedSoSReport(StageOneReportTest):
"""
:avocado: tags=stageone