Skip to content

Commit

Permalink
[tests] Scrub tests
Browse files Browse the repository at this point in the history
Adding stageone and stagetwo tests for [system] plugin.

Also adding tag scrub for only testing scrub of sensitive data.

And updating README with how to call scrub and stagetwo tests.

Signed-off-by: Jan Jansky <[email protected]>
  • Loading branch information
jjansky1 committed Oct 3, 2024
1 parent ff005cb commit 94e16ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# See the LICENSE file in the source distribution for further information.

from sos_tests import StageOneReportTest, StageTwoReportTest
from os import remove
import shutil


class SystemPluginTest(StageOneReportTest):
Expand Down Expand Up @@ -46,11 +48,11 @@ class SystemScrubTest(StageTwoReportTest):
"""
sos_cmd = '-o system'
files = [
('test_case', '/etc/environment'),
('test_case', '/etc/default/proxy'),
('test_case', '/etc/default/proxy1'),
('test_case', '/etc/sysconfig/proxy'),
('test_case', '/etc/sysconfig/proxy1'),
('../../../tests/test_data/system_test_data', '/etc/environment'),
('../../../tests/test_data/system_test_data', '/etc/default/proxy'),
('../../../tests/test_data/system_test_data', '/etc/default/proxy1'),
('../../../tests/test_data/system_test_data', '/etc/sysconfig/proxy'),
('../../../tests/test_data/system_test_data', '/etc/sysconfig/proxy1'),
]
secrets_list = [
'foouser',
Expand All @@ -65,5 +67,6 @@ def test_system_scrub(self):
for file in self.files:
for secret in self.secrets_list:
self.assertFileNotHasContent(file[1], secret)
self.end_of_test_case = True

# vim: set et ts=4 sw=4 :
File renamed without changes.

0 comments on commit 94e16ab

Please sign in to comment.