This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test.test_uuid.test_find_mac fails because of `ifconfig` deprecation
Type: Stage:
Components: Tests Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: bru, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

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:10adminsetgithub: 67090
2014-11-26 13:34:48brusetstatus: open -> closed
resolution: out of date
messages: + msg231708
2014-11-19 16:41:08brusetmessages: + msg231393
2014-11-19 16:11:16serhiy.storchakasetmessages: + msg231387
2014-11-19 15:23:11vstinnersetmessages: + msg231385
versions: - Python 3.2, Python 3.3, Python 3.6
2014-11-19 15:18:29brusetmessages: + msg231383
2014-11-19 15:09:06vstinnersetmessages: + msg231381
2014-11-19 15:08:09vstinnersetnosy: + vstinner, serhiy.storchaka
2014-11-19 15:00:25brucreate