aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cleaner_tests/report_with_mask.py
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-09-01 00:28:58 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-09-13 10:47:04 -0400
commitdecd39b7799a0579ea085b0da0728b6eabd49b38 (patch)
treefdb55757592367a0f9ac61d2eef9d3f66ab84d22 /tests/cleaner_tests/report_with_mask.py
parent9f739f98114633ae2f2813f348eef3cd599aa516 (diff)
downloadsos-decd39b7799a0579ea085b0da0728b6eabd49b38.tar.gz
[clean] Provide archive abstractions to obfuscate more than sos archives
This commit removes the restriction imposed on `sos clean` since its introduction in sos-4.0 to only work against known sos report archives or build directories. This is because there has been interest in using the obfuscation bits of sos in other data-collector projects. The `SoSObfuscationArchive()` class has been revamped to now be an abstraction for different types of archives, and the cleaner logic has been updated to leverage this new abstraction rather than assuming we're working on an sos archive. Abstractions are added for our own native use cases - that being `sos report` and `sos collect` for at-runtime obfuscation, as well as standalone archives previously generated. Further generic abstractions are available for plain directories and tarballs however these will not provide the same level of coverage as fully supported archive types, as is noted in the manpage for sos-clean. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/cleaner_tests/report_with_mask.py')
-rw-r--r--tests/cleaner_tests/report_with_mask.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/cleaner_tests/report_with_mask.py b/tests/cleaner_tests/report_with_mask.py
index 4f94ba33..08e873d4 100644
--- a/tests/cleaner_tests/report_with_mask.py
+++ b/tests/cleaner_tests/report_with_mask.py
@@ -31,6 +31,9 @@ class ReportWithMask(StageOneReportTest):
def test_tarball_named_obfuscated(self):
self.assertTrue('obfuscated' in self.archive)
+ def test_archive_type_correct(self):
+ self.assertSosLogContains('Loaded .* as type sos report directory')
+
def test_localhost_was_obfuscated(self):
self.assertFileHasContent('/etc/hostname', 'host0')