Opened 19 months ago

Closed 2 weeks ago

#25611 closed defect (implemented)

Integ test for MAPADDRESS

Reported by: atagar Owned by: atagar
Priority: Low Milestone:
Component: Core Tor/Stem Version:
Severity: Minor Keywords: testing
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Stem had an integration test for tor's MAPADDRESS command...

https://gitweb.torproject.org/stem.git/tree/test/integ/control/controller.py#n1120

However, it doesn't work...

======================================================================
FAIL: test_mapaddress
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/atagar/Desktop/stem/test/require.py", line 58, in wrapped
    return func(self, *args, **kwargs)
  File "/home/atagar/Desktop/stem/test/require.py", line 58, in wrapped
    return func(self, *args, **kwargs)
  File "/home/atagar/Desktop/stem/test/integ/control/controller.py", line 1154, in test_mapaddress
    self.assertTrue(stem.util.connection.is_valid_ipv4_address(stem.util.str_tools._to_unicode(ip_addr)), "'%s' isn't an address" % ip_addr)
AssertionError: '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /ip
on this server.</p>
</body></html>' isn't an address

After several hours of fiddling with it I'm disabling the failing test for now. Things I checked were...

  • Tested with both the current stem codebase and last release tag (1.6.0) to rule out a recent regression in stem.
  • Tested with both the current tor git codebase and an older version (0.2.7.6) to rule out a regression in tor.
  • Through tor browser visited the site this test retrieves (http://ifconfig.me/ip) in case they're blocking tor. No dice.

Open questions are 'why did this test start failing?' and get integ coverage for MAPADDRESS. Happy to outright replace this test with something else that exercises it.

Child Tickets

Change History (7)

comment:1 Changed 18 months ago by atagar

Keywords: testing added

comment:2 Changed 5 weeks ago by nickm

I have written an offline integration test for mapaddress; I don't know if it will do everything you want here, but it should be sufficient to prevent another occurrence of #31772. The branch is called test_mapaddress_offline and the PR is at https://github.com/torproject/stem/pull/22 .

Please let me know if you'd like me to open a separate ticket for this.

comment:3 Changed 5 weeks ago by nickm

Status: newneeds_review

comment:4 Changed 5 weeks ago by nickm

FYI, this test will fail with Tor 0.4.1 and 0.4.2, until #31772 is fixed. It should work fine with 0.4.0 and earlier.

comment:5 Changed 5 weeks ago by atagar

Great! Thanks Nick. When I merge this I'll include a version check so we skip the test with version 0.4.1 and 0.4.2 (ie. only run for 0.4.0 and earlier, or 0.4.3 and later).

comment:6 Changed 5 weeks ago by nickm

I think the only released versions this will break with are 0.4.1.1-alpha through 0.4.1.5, and maybe 0.4.2.1-alpha. 0.4.1.6 and 0.4.2.2-alpha should work fine when they are released.

comment:7 Changed 2 weeks ago by atagar

Resolution: implemented
Status: needs_reviewclosed

Merged without the version check, thanks Nick!

Note: See TracTickets for help on using tickets.