aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2023-03-07 17:55:19 +0100
committerJake Hunsaker <jhunsake@redhat.com>2023-03-08 09:27:09 -0500
commit622a26ee2faff91df03532892ca386c39e36a5fe (patch)
treee7f053cbb6c3d5829a7f412cabb45cc723eceb5c /tests
parentd4d4d5509fe4f0e29260b33a1c51bf62297ef0b9 (diff)
downloadsos-622a26ee2faff91df03532892ca386c39e36a5fe.tar.gz
[tests] add a test covering #3160
Run the cleaner tests with obfuscating (also) "tmp" to cover files handling under sys_tmp. Related to: #3160 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/cleaner_tests/existing_archive.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/cleaner_tests/existing_archive.py b/tests/cleaner_tests/existing_archive.py
index e13d1cae..7f31f88e 100644
--- a/tests/cleaner_tests/existing_archive.py
+++ b/tests/cleaner_tests/existing_archive.py
@@ -89,3 +89,22 @@ class ExistingArchiveCleanTest(StageTwoReportTest):
"""Ensure that the 'testuser1' user created at install is obfuscated
"""
self.assertFileNotHasContent('var/log/anaconda/journal.log', 'testuser1')
+
+class ExistingArchiveCleanTmpTest(StageTwoReportTest):
+ """Continuation of above tests which requires cleaning var / tmp keywords
+
+ Note that this copies heavily from the full_report_run test.
+
+ :avocado: tags=stagetwo
+ """
+
+ sos_cmd = '-v --keywords var,tmp,avocado --disable-parsers ip,ipv6,mac,username \
+ --no-update tests/test_data/%s.tar.xz' % ARCHIVE
+ sos_component = 'clean'
+
+ def test_sys_tmp_not_obfuscated(self):
+ """ Ensure that keywords var, tmp and avocado remains in the final archive
+ path despite they are parts of the --tmp-dir
+ """
+ self.assertTrue(self.archive.startswith(os.getenv('AVOCADO_TESTS_COMMON_TMPDIR')))
+