Issue 22901: test.test_uuid.test_find_mac fails because of ifconfig deprecation (original) (raw)

Created on 2014-11-19 15:00 by bru, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_uuid_find_mac_test.patch bru,2014-11-19 15:00 Patch for the test review
Messages (7)
msg231380 - (view) Author: Bruno Cauet (bru) * Date: 2014-11-19 15:00
`test.test_uuid.test_find_mac` relies on `ifconfig` binary presence, which is on its way out. This makes the test fail on more and more Linux installations. Using `env` (for example) is more reliable. `ip` could also be used since it's the replacement to `ifconfig`, but an always-present binary such as `env` makes it work in all cases. This is what the (trivial) patch does. The same reasoning applies to `uuid.getnode`: if 'Unix dll' source is not available it will try to get a MAC address 'ifconfig' which will fail, and the fallback will be `_random_getnode` (but that's another issue).
msg231381 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-11-19 15:09
It would be nice to switch to "ip link". The ip command became the new standard on Linux. I don't know if the ip command is available on other operating systems.
msg231383 - (view) Author: Bruno Cauet (bru) * Date: 2014-11-19 15:18
According to http://en.wikipedia.org/wiki/Iproute2 "ip" is Linux-only. I opened an issue with a patch that brings "ip link list" to "uuid.getnode()": http://bugs.python.org/issue22902
msg231385 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-11-19 15:23
(Only Python 2.7, 3.4 and 3.5 accepted bug fixes; other versions only accept security fixes.)
msg231387 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-19 16:11
How the test fail? Could you provide test output?
msg231393 - (view) Author: Bruno Cauet (bru) * Date: 2014-11-19 16:41
I realize that I was not working against the tip... The patch I offered does not apply since revision 88068, which fixes the test by skipping it when "ifconfig" isn't available. Therefore this issue is invalid. However I think that "test_find_mac" should always should not be skipped but use any other binary instead. (Context: I'm trying to start contributing by fixing tests/'easy' bugs; I should have updated by cpython repo beforehand...)
msg231708 - (view) Author: Bruno Cauet (bru) * Date: 2014-11-26 13:34
Closed the issue since it's already been fixed.
History
Date User Action Args
2022-04-11 14:58:10 admin set github: 67090
2014-11-26 13:34:48 bru set status: open -> closedresolution: out of datemessages: +
2014-11-19 16:41:08 bru set messages: +
2014-11-19 16:11:16 serhiy.storchaka set messages: +
2014-11-19 15:23:11 vstinner set messages: + versions: - Python 3.2, Python 3.3, Python 3.6
2014-11-19 15🔞29 bru set messages: +
2014-11-19 15:09:06 vstinner set messages: +
2014-11-19 15:08:09 vstinner set nosy: + vstinner, serhiy.storchaka
2014-11-19 15:00:25 bru create