brizental pushed to branch tor-browser-149.0a1-16.0-2 at The Tor Project / Applications / Tor Browser Commits: 6e0af488 by Beatriz Rizental at 2026-04-01T11:42:51-03:00 fixup! TB 43817: Add tests for Tor Browser Bug 44800: Use our own ip checker service on the stream isolation test - - - - - 1 changed file: - testing/tor/test_circuit_isolation.py Changes: ===================================== testing/tor/test_circuit_isolation.py ===================================== @@ -47,12 +47,30 @@ class TestCircuitIsolation(MarionetteTestCase, TorBrowserMixin): ).strip() ) + def extract_from_header(self, url): + # Navigate to the page to bypass CORS. + self.marionette.navigate(url) + # The IP checker service provided by TPA, return the caller IP address + # on the head of the response, inside the `X-Your-IP-Address` header. + return ip_address( + self.marionette.execute_async_script( + """ + const [url, resolve] = arguments; + + fetch(url).then(response => + resolve(response.headers.get("X-Your-IP-Address")) + ); + """, + script_args=[url], + ) + ) + def test_circuit_isolation(self): self.bootstrap() ips = [ self.extract_from_check_tpo(), self.extract_generic("https://am.i.mullvad.net/ip"), - self.extract_generic("https://v4.ident.me"), + self.extract_from_header("https://test.torproject.org"), ] self.logger.info(f"Found the following IP addresses: {ips}") unique_ips = set(ips) @@ -63,11 +81,16 @@ class TestCircuitIsolation(MarionetteTestCase, TorBrowserMixin): "Some of the IP addresses we got are not unique.", ) - # TODO: Renable the duplicate check once - # https://gitlab.torproject.org/tpo/tpa/team/-/issues/42547 is resolved. - # duplicate = self.extract_generic("https://test2.ifconfig.me/ip") - # self.assertEqual( - # ips[-1], - # duplicate, - # "Two IPs that were expected to be equal are different, we might be over isolating!", - # ) + duplicates = set( + self.extract_from_header("https://test-01.torproject.org"), + self.extract_from_header("https://test-02.torproject.org"), + self.extract_from_header("https://test.torproject.org"), + ) + self.logger.info( + f"Found the following IP addresses, when checking for duplicates: {duplicates}" + ) + self.assertEqual( + len(duplicates), + 1, + "IPs that were expected to be equal are different, we might be over isolating!", + ) View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/6e0af488... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/6e0af488... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
brizental (@brizental)