classification
Title: test_uuid.TestUUID.test_find_mac() fails
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: Arfrever, bkabrda, python-dev, serhiy.storchaka, tim.peters
Priority: normal Keywords:

Created on 2013-11-27 02:59 by tim.peters, last changed 2014-01-15 15:08 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
usr-sbin-contents bkabrda, 2014-01-10 10:29
Messages (16)
msg204548 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2013-11-27 02:59
Using current default branch:

FAIL: test_find_mac (test.test_uuid.TestUUID)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Code\Python\lib\test\test_uuid.py", line 378, in test_find_mac
    self.assertEqual(mac, 0x1234567890ab)
AssertionError: None != 20015998341291
msg204549 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2013-11-27 03:04
Seeing the same failure on a buildbot:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/3474/steps/test/logs/stdio
msg204554 - (view) Author: Roundup Robot (python-dev) Date: 2013-11-27 06:58
New changeset e5b7f140ae30 by Serhiy Storchaka in branch '2.7':
Skip test_find_mac on Windows (issue #19804).
http://hg.python.org/cpython/rev/e5b7f140ae30

New changeset dfadce7635ce by Serhiy Storchaka in branch '3.3':
Skip test_find_mac on Windows (issue #19804).
http://hg.python.org/cpython/rev/dfadce7635ce

New changeset 4d5c3cb08170 by Serhiy Storchaka in branch 'default':
Skip test_find_mac on Windows (issue #19804).
http://hg.python.org/cpython/rev/4d5c3cb08170
msg204556 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-11-27 07:01
Thank you Tim for your report.
msg204881 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2013-12-01 05:06
I see the same failure of this test on my system (Gentoo Linux, amd64, ifconfig available) on all branches (2.7, 3.3, default).
msg204910 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-01 11:10
Where ifconfig is located?
msg204921 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2013-12-01 14:24
/bin/ifconfig
(/bin is in ${PATH}.)
msg204924 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2013-12-01 14:32
This test passes (on all branches) after adding "/bin" to hardcoded list in uuid._find_mac().

Minimal solution: Add "/bin" and "/usr/bin" to that list.
Better solution: Search ${PATH}+['/sbin/', '/usr/sbin'] for "ifconfig". In >=3.2 os.get_exec_path() can be used.
msg204934 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-01 15:16
This is different issue. See issue19855.
msg204935 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2013-12-01 15:21
The test currently uses:
@unittest.skipUnless(os.name == 'posix', 'requires Posix')

Maybe this test should be skipped also on posix systems with ifconfig not available at all?
msg204947 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-12-01 18:28
When someone will report about failures on such systems.
msg207678 - (view) Author: Bohuslav "Slavek" Kabrda (bkabrda) * Date: 2014-01-08 09:32
When building for Fedora, we usually use minimal buildroot, that doesn't have net-tools (e.g. ifconfig and others) installed, so this test fails for us. It'd probably be best to skip this based on whether ifconfig binary can be found or not.
msg207770 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-01-09 18:50
Perhaps it would be better just use other executable (it is not ran in this test, just checked that it exists). Bohuslav, what is a content of your /sbin and /usr/sbin?
msg207847 - (view) Author: Bohuslav "Slavek" Kabrda (bkabrda) * Date: 2014-01-10 10:29
Attaching a list of files in /usr/sbin in Fedora's minimal buildroot. (Note, that in Fedora /sbin is a symlink to /usr/sbin.)
FWIW I can workaround this issue by adding net-tools to BuildRequires, so this is no big pain for me.
msg207857 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-01-10 12:59
Thank you Bohuslav. Unfortunately I don't see good replacement for ifconfig, any of these executables can be absent (e.g. chroot can be built in BusyBox). So I'll left ifconfig and adds checks for its accessibility.

You can workaround this issue by adding an executable with name ifconfig to your PATH. For example:

bin_for_test_uuid="$HOME/bin_for_test_uuid"
mkdir "$bin_for_test_uuid"
ln -s /bin/true "$bin_for_test_uuid/ifconfig"
export PATH="$PATH:$bin_for_test_uuid"
./python -m test.regrtest test_uuid
msg207858 - (view) Author: Roundup Robot (python-dev) Date: 2014-01-10 13:11
New changeset 34ae4333d3bf by Serhiy Storchaka in branch '2.7':
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
http://hg.python.org/cpython/rev/34ae4333d3bf

New changeset 201077b57fe0 by Serhiy Storchaka in branch '3.3':
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
http://hg.python.org/cpython/rev/201077b57fe0

New changeset 51dc9b2a5b35 by Serhiy Storchaka in branch 'default':
Issue #19804: The test_find_mac test in test_uuid is now skipped if the
http://hg.python.org/cpython/rev/51dc9b2a5b35
History
Date User Action Args
2014-01-15 15:08:57serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: resolved
2014-01-10 13:11:38python-devsetmessages: + msg207858
2014-01-10 12:59:29serhiy.storchakasetmessages: + msg207857
2014-01-10 10:29:25bkabrdasetfiles: + usr-sbin-contents

messages: + msg207847
2014-01-09 18:50:06serhiy.storchakasetmessages: + msg207770
2014-01-08 10:12:30Arfreversetstatus: closed -> open
resolution: fixed -> (no value)
stage: resolved -> (no value)
2014-01-08 09:32:36bkabrdasetnosy: + bkabrda
messages: + msg207678
2013-12-01 18:28:39serhiy.storchakasetmessages: + msg204947
2013-12-01 15:21:34Arfreversetmessages: + msg204935
2013-12-01 15:16:05serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg204934

stage: resolved
2013-12-01 14:32:13Arfreversetmessages: + msg204924
2013-12-01 14:24:58Arfreversetmessages: + msg204921
2013-12-01 11:10:10serhiy.storchakasetmessages: + msg204910
2013-12-01 05:06:57Arfreversetstatus: closed -> open


title: test_uuid failing on 32-bit Windows Vista -> test_uuid.TestUUID.test_find_mac() fails
nosy: + Arfrever
versions: + Python 2.7, Python 3.3
messages: + msg204881
resolution: fixed -> (no value)
stage: resolved -> (no value)
2013-11-27 07:01:14serhiy.storchakasetstatus: open -> closed
messages: + msg204556

components: + Tests
resolution: fixed
stage: resolved
2013-11-27 06:58:47python-devsetnosy: + python-dev
messages: + msg204554
2013-11-27 03:04:24tim.peterssetmessages: + msg204549
2013-11-27 02:59:28tim.peterscreate