Support for FreeBSD > 6 is missing from iputil.py #1098

Closed
opened 2010-06-25 08:54:29 +00:00 by francois · 6 comments
francois commented 2010-06-25 08:54:29 +00:00
Owner

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     
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 ```
tahoe-lafs added the
unknown
minor
defect
1.7.0
labels 2010-06-25 08:54:29 +00:00
tahoe-lafs added this to the 1.7.1 milestone 2010-06-25 08:54:29 +00:00
francois commented 2010-06-25 09:29:19 +00:00
Author
Owner

Attachment iputil-freebsd.diff.dpatch (47066 bytes) added

**Attachment** iputil-freebsd.diff.dpatch (47066 bytes) added
francois commented 2010-06-25 09:42:15 +00:00
Author
Owner

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?

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?
zooko commented 2010-06-26 13:34:48 +00:00
Author
Owner

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.

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.
francois commented 2010-06-28 10:07:07 +00:00
Author
Owner

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.

Replying to [zooko](/tahoe-lafs/trac-2024-07-25/issues/1098#issuecomment-119926): > 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.
davidsarah commented 2010-07-17 05:38:15 +00:00
Author
Owner

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

This seems like a very safe patch that should be applied for 1.7.1, regardless of the absence of tests.
zooko commented 2010-07-18 02:56:56 +00:00
Author
Owner

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 changeset:968edfda119cb29c. Thanks!

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 changeset:968edfda119cb29c. Thanks!
tahoe-lafs added the
fixed
label 2010-07-18 02:56:56 +00:00
zooko closed this issue 2010-07-18 02:56:56 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#1098
No description provided.