Skip to content

Commit

Permalink
Config test sd-whonix: check for multiple includes
Browse files Browse the repository at this point in the history
The specific problem of multiple includes causing recursion in imports
for the tor config broke v2 onion services for the workstation (and
whonix-gw overall). Let's monitor for regressions on that specific
config state.
  • Loading branch information
Conor Schaefer authored and emkll committed Mar 11, 2020
1 parent 617b490 commit d5c9839
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_sd_whonix.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ def test_logging_configured(self):
def test_sd_whonix_verify_tor_config(self):
self._run("tor --verify-config")

def test_whonix_torrc(self):
"""
Ensure Whonix-maintained torrc files don't contain duplicate entries.
"""
torrc_contents = self._get_file_contents("/etc/tor/torrc")
duplicate_includes = """%include /etc/torrc.d/
%include /etc/torrc.d/95_whonix.conf"""
self.assertFalse(duplicate_includes in torrc_contents,
"Whonix GW torrc contains duplicate %include lines")


def load_tests(loader, tests, pattern):
suite = unittest.TestLoader().loadTestsFromTestCase(SD_Whonix_Tests)
return suite

0 comments on commit d5c9839

Please sign in to comment.