commit a3aceae0e638429119130366be5773f85f8d7522 Author: Damian Johnson atagar@torproject.org Date: Wed Oct 11 19:31:56 2017 +0200
Integ failure for HiddenServiceNonAnonymousMode with older tor versions
Tor's HiddenServiceNonAnonymousMode option is rather new. Nice that we have an integ test for it, but we should account for versions without it too...
====================================================================== FAIL: test_unanonymous_hidden_service_config_must_match ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/atagar/Desktop/stem/stem/util/test_tools.py", line 150, in <lambda> self.method = lambda test: self.result(test) # method that can be mixed into TestCases File "/home/atagar/Desktop/stem/stem/util/test_tools.py", line 212, in result test.fail(self._result.msg) AssertionError: Expected 'Process terminated: HiddenServiceNonAnonymousMode does not provide any server anonymity. It must be used with HiddenServiceSingleHopMode set to 1.' but was 'Process terminated: Unknown option 'HiddenServiceNonAnonymousMode'. Failing.' --- test/integ/process.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/test/integ/process.py b/test/integ/process.py index 59299f81..72cba38b 100644 --- a/test/integ/process.py +++ b/test/integ/process.py @@ -364,7 +364,10 @@ class TestProcess(unittest.TestCase):
raise AssertionError("Tor shouldn't start with 'HiddenServiceNonAnonymousMode' set but not 'HiddenServiceSingleHopMode'") except OSError as exc: - assert_equal('Process terminated: HiddenServiceNonAnonymousMode does not provide any server anonymity. It must be used with HiddenServiceSingleHopMode set to 1.', str(exc)) + if test.tor_version() >= stem.version.Requirement.ADD_ONION_NON_ANONYMOUS: + assert_equal('Process terminated: HiddenServiceNonAnonymousMode does not provide any server anonymity. It must be used with HiddenServiceSingleHopMode set to 1.', str(exc)) + else: + assert_equal("Process terminated: Unknown option 'HiddenServiceNonAnonymousMode'. Failing.", str(exc))
try: stem.process.launch_tor_with_config( @@ -374,7 +377,10 @@ class TestProcess(unittest.TestCase):
raise AssertionError("Tor shouldn't start with 'HiddenServiceSingleHopMode' set but not 'HiddenServiceNonAnonymousMode'") except OSError as exc: - assert_equal('Process terminated: HiddenServiceSingleHopMode does not provide any server anonymity. It must be used with HiddenServiceNonAnonymousMode set to 1.', str(exc)) + if test.tor_version() >= stem.version.Requirement.ADD_ONION_NON_ANONYMOUS: + assert_equal('Process terminated: HiddenServiceSingleHopMode does not provide any server anonymity. It must be used with HiddenServiceNonAnonymousMode set to 1.', str(exc)) + else: + assert_equal("Process terminated: Unknown option 'HiddenServiceSingleHopMode'. Failing.", str(exc))
@asynchronous def test_can_run_multithreaded(tor_cmd):
tor-commits@lists.torproject.org