aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cleaner_tests.py
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-02-04 11:15:14 -0500
committerJake Hunsaker <jhunsake@redhat.com>2021-02-17 14:58:27 -0500
commitbf622ae28b9a759161cbe6dda9c425d72408feaa (patch)
tree46fc7a899e6c12d0911eaf74a3136079449f8a9d /tests/cleaner_tests.py
parent196605b3d12d0ecdeb114276013d16ede3d15313 (diff)
downloadsos-bf622ae28b9a759161cbe6dda9c425d72408feaa.tar.gz
[clean] Fix hostnames not being obfuscated when host plugin wasn't run
It was discovered that if a report was generated without the host plugin being run, then the hostname parser would not obfuscate the localhost hostname or domain at all. This was due to the fact that while the default_mapping values were being read into the parser's map's dataset correctly, they weren't being loaded into the 'intermediary' dicts that the parser uses to separate short names from domain names. Fix this by reading the contents of the map's dataset dict (which is populated by the map file) into those intermediary dicts that the parser uses. Additionally, safeguard against overloading domain and host obfuscation numbers when loading this way by setting the respective counts to the next-highest number after the map loading is complete. Resolves: #2406 Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/cleaner_tests.py')
-rw-r--r--tests/cleaner_tests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/cleaner_tests.py b/tests/cleaner_tests.py
index 43545126..5510dd80 100644
--- a/tests/cleaner_tests.py
+++ b/tests/cleaner_tests.py
@@ -24,7 +24,8 @@ class CleanerMapTests(unittest.TestCase):
def setUp(self):
self.mac_map = SoSMacMap()
self.ip_map = SoSIPMap()
- self.host_map = SoSHostnameMap(['redhat.com'])
+ self.host_map = SoSHostnameMap()
+ self.host_map.load_domains_from_options(['redhat.com'])
self.kw_map = SoSKeywordMap()
def test_mac_map_obfuscate_valid_v4(self):