[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

Michael Felt report at bugs.python.org
Sat Jul 21 06:37:28 EDT 2018


Michael Felt <michael at felt.demon.nl> added the comment:

OK. as promised when I closed PR 5183 - a restart.

You may skip the wall that follows - it is just documentation.

The key points:
* AIX ifconfig and arp do not supply maccaddr
* netstat supplies a macaddr, but uses '.' not ':' as a delimiter
** also, AIX netstat value is not always 17 characters (dec 15 is 'f' not '0f')
* since Python3-3.7 there is support for _uuid so test_unix_getnode passes "WithExtModule" but fails "WithoutExtModule"

A minor point:
test_find_mac() has always passed on AIX because the test was passed a
macaddr using ':' and tested for ':'. The test has been modified to provide a macaddr in "AIX" format. IMHO - the test would be better if the string was not "forced to be 17 characters" (e.g., this is my macaddr as returned by netstat: "0.12.a3.53.c9.46"

My question - getting back to what I had done previously - even though _uuid is working, should the "WithoutExtModule" and support for test_find_mac() be adjusted in uuid.py - OR - are these errors in test just going to be accepted asis?

Details: (skip the wall :p )


So, with only test_uuid.py patched, the verbose returns ('ok' tests not included!):

root at x066:[/data/prj/python/python3-3.8]./python ../git/**3.8/Lib/test/regrtest.py -v test_uuid | egrep -v "ok$"
== CPython 3.8.0a0 (default, Jul 20 2018, 00:54:36) [C]
== AIX-1-00C291F54C00-powerpc-32bit big-endian
== cwd: /data/prj/python/python3-3.8/build/test_python_11468890
== CPU count: 4
== encodings: locale=ISO8859-1, FS=iso8859-1
Run tests sequentially
0:00:00 [1/1] test_uuid
test_arp_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'because AIX "arp" does not provide macaddr'
test_find_mac (test.test_uuid.TestInternalsWithExtModule) ... FAIL
test_ifconfig_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'because AIX "ifconfig" does not provide macaddr'
test_ip_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'requires ip'
test_ipconfig_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'requires Windows'
test_lanscan_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'requires lanscan'
test_netbios_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'requires win32wnet'
test_netstat_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'requires netstat'
test_windll_getnode (test.test_uuid.TestInternalsWithExtModule) ... skipped 'requires Windows'
test_arp_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'because AIX "arp" does not provide macaddr'
test_find_mac (test.test_uuid.TestInternalsWithoutExtModule) ... FAIL
test_ifconfig_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'because AIX "ifconfig" does not provide macaddr'
test_ip_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'requires ip'
test_ipconfig_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'requires Windows'
test_lanscan_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'requires lanscan'
test_netbios_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'requires win32wnet'
test_netstat_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'requires netstat'
test_unix_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'requires uuid_generate_time'
test_windll_getnode (test.test_uuid.TestInternalsWithoutExtModule) ... skipped 'requires Windows'
test_uuid1_safe (test.test_uuid.TestUUIDWithExtModule) ... skipped 'requires uuid_generate_time_safe(3)'
test_uuid1_bogus_return_value (test.test_uuid.TestUUIDWithoutExtModule) ... skipped 'need uuid._generate_time_safe'
test_uuid1_is_safe (test.test_uuid.TestUUIDWithoutExtModule) ... skipped 'need uuid._generate_time_safe'
test_uuid1_is_unsafe (test.test_uuid.TestUUIDWithoutExtModule) ... skipped 'need uuid._generate_time_safe'
test_uuid1_safe (test.test_uuid.TestUUIDWithoutExtModule) ... skipped 'requires uuid_generate_time_safe(3)'
test_uuid1_unknown (test.test_uuid.TestUUIDWithoutExtModule) ... skipped 'need uuid._generate_time_safe'
test test_uuid failed

======================================================================
FAIL: test_find_mac (test.test_uuid.TestInternalsWithExtModule)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/prj/python/git/python3-3.8/Lib/test/test_uuid.py", line 548, in test_find_mac
    self.assertEqual(mac, 0x1234567890ab)
AssertionError: None != 20015998341291

======================================================================
FAIL: test_find_mac (test.test_uuid.TestInternalsWithoutExtModule)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/data/prj/python/git/python3-3.8/Lib/test/test_uuid.py", line 548, in test_find_mac
    self.assertEqual(mac, 0x1234567890ab)
AssertionError: None != 20015998341291

----------------------------------------------------------------------
Ran 50 tests in 0.629s

FAILED (failures=2, skipped=23)
test_uuid failed

== Tests result: FAILURE ==

1 test failed:
    test_uuid

Total duration: 797 ms
Tests result: FAILURE
root at x066:[/data/prj/python/python3-3.8]

----------
components: +Tests

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue28009>
_______________________________________


More information about the Python-bugs-list mailing list