Opened 2 years ago

Closed 4 months ago

#25611 closed defect (implemented)

Integ test for MAPADDRESS

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


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

However, it doesn't work...

FAIL: test_mapaddress
Traceback (most recent call last):
  File "/home/atagar/Desktop/stem/test/", line 58, in wrapped
    return func(self, *args, **kwargs)
  File "/home/atagar/Desktop/stem/test/", line 58, in wrapped
    return func(self, *args, **kwargs)
  File "/home/atagar/Desktop/stem/test/integ/control/", 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">
<title>403 Forbidden</title>
<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 ( to rule out a regression in tor.
  • Through tor browser visited the site this test retrieves ( 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 22 months ago by atagar

Keywords: testing added

comment:2 Changed 5 months 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 .

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

comment:3 Changed 5 months ago by nickm

Status: newneeds_review

comment:4 Changed 5 months 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 months 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 months ago by nickm

I think the only released versions this will break with are through, and maybe and should work fine when they are released.

comment:7 Changed 4 months ago by atagar

Resolution: implemented
Status: needs_reviewclosed

Merged without the version check, thanks Nick!

Note: See TracTickets for help on using tickets.