From decd39b7799a0579ea085b0da0728b6eabd49b38 Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Wed, 1 Sep 2021 00:28:58 -0400 Subject: [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 --- tests/cleaner_tests/report_with_mask.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/cleaner_tests/report_with_mask.py') 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') -- cgit