#1098 closed defect (fixed)

Support for FreeBSD > 6 is missing from iputil.py

Reported by: francois Owned by: francois
Priority: minor Milestone: 1.7.1
Component: unknown Version: 1.7.0
Keywords: freebsd install test-needed Cc:
Launchpad Bug:

Description

On tahoe-dev, Randy Bush reported the following error when running a Tahoe node under FreeBSD 8.0.

2010-06-25 06:43:15+0000 [-] Unhandled Error
        Traceback (most recent call last):
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/support/lib/python2.5/site-packages/foolscap-0.5.1-py2.5.egg/foolscap/eventual.py", line 26, in _turn
            cb(*args, **kwargs)
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/src/allmydata/node.py", line 259, in _startService
            d.addCallback(lambda res: iputil.get_local_addresses_async())
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/Twisted-10.0.0-py2.5-freebsd-8.0-STABLE-amd64.egg/twisted/internet/defer.py", line 224, in addCallback
            callbackKeywords=kw)
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/Twisted-10.0.0-py2.5-freebsd-8.0-STABLE-amd64.egg/twisted/internet/defer.py", line 213, in addCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/Twisted-10.0.0-py2.5-freebsd-8.0-STABLE-amd64.egg/twisted/internet/defer.py", line 371, in _runCallbacks
            self.result = callback(self.result, *args, **kw)
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/src/allmydata/node.py", line 259, in <lambda>
            d.addCallback(lambda res: iputil.get_local_addresses_async())
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/src/allmydata/util/iputil.py", line 94, in get_local_addresses_async
            d = _find_addresses_via_config()
          File "/usr/local/src/net/allmydata-tahoe-1.7.0/src/allmydata/util/iputil.py", line 242, in _find_addresses_via_config
            raise UnsupportedPlatformError(sys.platform)
        allmydata.util.iputil.UnsupportedPlatformError: freebsd8     

Attachments (1)

iputil-freebsd.diff.dpatch (46.0 KB) - added by francois at 2010-06-25T09:29:19Z.

Download all attachments as: .zip

Change History (10)

Changed at 2010-06-25T09:29:19Z by francois

comment:1 Changed at 2010-06-25T09:42:15Z by francois

  • Keywords freebsd install review-needed added

I don't see any easy way to implement meaningful tests for this change. It's probably better to have a new buildbot running a recent FreeBSD version.

What do you think?

comment:2 follow-up: Changed at 2010-06-26T13:34:48Z by zooko

I would be willing to apply this based on Randy Bush's FreeBSD 8 buildbot.

It would be even cooler to do a "mock out the underlying platform" hack like the way you, François, wrote portable unit tests of your unicode work. The unit tests could make sys.platform say "FreeBSD10" or something and then when iputil.py calls getProcessOutput() the test could patch out getProcessOutput() to return a sensible thing that looks like the output of "ifconfig -a" on FreeBSD 10.

comment:3 in reply to: ↑ 2 Changed at 2010-06-28T10:07:07Z by francois

  • Owner changed from nobody to francois

Replying to zooko:

It would be even cooler to do a "mock out the underlying platform" hack like the way you, François, wrote portable unit tests of your unicode work. The unit tests could make sys.platform say "FreeBSD10" or something and then when iputil.py calls getProcessOutput() the test could patch out getProcessOutput() to return a sensible thing that looks like the output of "ifconfig -a" on FreeBSD 10.

Zooko, I knew you'd be saying that ;)

I'll have a look into that.

comment:4 Changed at 2010-06-28T10:07:12Z by francois

  • Status changed from new to assigned

comment:5 Changed at 2010-07-08T15:08:45Z by zooko

  • Keywords review-needed removed

comment:6 Changed at 2010-07-10T18:55:45Z by zooko

  • Keywords tests-needed added

comment:7 Changed at 2010-07-10T18:58:39Z by zooko

  • Keywords test-needed added; tests-needed removed

comment:8 Changed at 2010-07-17T05:38:15Z by davidsarah

This seems like a very safe patch that should be applied for 1.7.1, regardless of the absence of tests.

comment:9 Changed at 2010-07-18T02:56:56Z by zooko

  • Resolution set to fixed
  • Status changed from assigned to closed

Oh all right. For the record, I still want a deterministic mockery-based unit test and I still want Randy's FreeBSD buildslave to go green:

http://tahoe-lafs.org/buildbot/waterfall?show=Randy%20FreeBSD-amd64

But I guess this patch is extremely unlikely to cause a regression. :-)

applied in 968edfda119cb29c. Thanks!

Note: See TracTickets for help on using tickets.