Skip to content
Closed
Changes from 2 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
ebbaa22
bpo-32107 - Fix test_uuid
warsaw Nov 21, 2017
941b47d
Return None instead of 0
warsaw Nov 21, 2017
803ddd8
bpo-31324: Optimize support._match_test() (#4421)
vstinner Nov 21, 2017
e529214
Never return a locally administered MAC address
warsaw Nov 22, 2017
bb11c3c
bpo-31324: Fix test.support.set_match_tests(None) (#4505)
vstinner Nov 22, 2017
8265627
bpo-27535: Optimize warnings.warn() (#4508)
vstinner Nov 22, 2017
d434110
bpo-32030: Add _PyCoreConfig.module_search_path_env (#4504)
vstinner Nov 22, 2017
20d48a4
bpo-32100: IDLE: Fix pathbrowser errors; improve tests. (#4484)
csabella Nov 23, 2017
0784a2e
bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
Jesse-Bakker Nov 23, 2017
e32e79f
bpo-32030: Move PYTHONPATH to _PyMainInterpreterConfig (#4511)
vstinner Nov 23, 2017
1f15111
bpo-32030: Add _PyMainInterpreterConfig.pythonhome (#4513)
vstinner Nov 23, 2017
5ad7ef8
bpo-28538: Revert all the changes (now using Android Unified Headers)…
xdegaye Nov 23, 2017
c06c22e
bpo-29040: Support building Android with Unified Headers (GH-4492)
xdegaye Nov 23, 2017
5ce1069
bpo-28762: Revert last commit (now using Android Unified Headers) (GH…
xdegaye Nov 23, 2017
bdb8315
bpo-1102: View.Fetch() now returns None when it's exhausted (GH-4459)
berkerpeksag Nov 23, 2017
24c4db2
Several sleep-improved fixes
warsaw Nov 23, 2017
c056584
A missed return
warsaw Nov 23, 2017
7fd446e
Two typos
warsaw Nov 23, 2017
0327bde
bpo-32030: Rewrite calculate_path() (#4521)
vstinner Nov 23, 2017
b98f171
bpo-27535: Cleanup create_filter() (#4516)
vstinner Nov 23, 2017
b919795
bpo-32030: Fix calculate_path() on macOS (#4526)
vstinner Nov 23, 2017
6a54c67
bpo-31979: Remove unused align_maxchar() function (#4527)
vstinner Nov 23, 2017
dcaed6b
bpo-19610: setup() now raises TypeError for invalid types (GH-4519)
berkerpeksag Nov 23, 2017
0858495
bpo-32099 Add deque variant of roundrobin() recipe (#4497)
rhettinger Nov 23, 2017
3df02db
bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529)
berkerpeksag Nov 23, 2017
cdfe910
Extending Python Doc minor updates (GH-4518)
lelit Nov 24, 2017
4864a61
bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528)
berkerpeksag Nov 24, 2017
9e87e77
bpo-32096: Remove obj and mem from _PyRuntime (#4532)
vstinner Nov 24, 2017
19fb134
bpo-12239: Make GetProperty() return None for VT_EMPTY (GH-4539)
berkerpeksag Nov 24, 2017
0f86cd3
bpo-28684: asyncio tests handle PermissionError raised on binding uni…
xdegaye Nov 24, 2017
78a5722
Improve the String tutorial docs (GH-4541)
Nov 24, 2017
5742f67
bpo-28684: Remove useless import added by the previous commit (GH-4547)
xdegaye Nov 24, 2017
da9c8c3
bpo-32125: Remove Py_UseClassExceptionsFlag flag (#4544)
vstinner Nov 24, 2017
84c4b19
bpo-32124: Document C functions safe before init (#4540)
vstinner Nov 24, 2017
46972b7
bpo-32030: Add _PyMainInterpreterConfig_ReadEnv() (#4542)
vstinner Nov 24, 2017
f04ebe2
bpo-32030: Add _PyMainInterpreterConfig.program_name (#4548)
vstinner Nov 24, 2017
f8802d8
Asyncion-Dev docs: Fix the reference to sys.excepthook (GH-4414)
ashwoods Nov 24, 2017
706cb31
bpo-32128: Skip test_nntplib.test_article_head_body() (#4552)
vstinner Nov 25, 2017
9316ee4
bpo-32030: Add _PyPathConfig_Init() (#4551)
vstinner Nov 25, 2017
610e5af
bpo-30004: Fix the code example of using group in Regex Howto Docs (G…
mandeep Nov 25, 2017
9d5ec80
Improve Scheduler Objects documentation. (GH-4556)
Mariatta Nov 25, 2017
8d9bb11
bpo-28334: netrc() now uses expanduser() to find .netrc file (GH-4537)
berkerpeksag Nov 25, 2017
fb2c2f2
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
5b48dc6
bpo-32071: Add unittest -k option (#4496)
jonashaag Nov 25, 2017
cfa797c
bpo-24641: Improved error message for JSON unserializible keys. (#4364)
serhiy-storchaka Nov 25, 2017
77f5139
bpo-32059: setup.py now also searches the sysroot paths (GH-4452)
xdegaye Nov 25, 2017
76fdac4
bpo-26856: Skip test_pwd on Android until issue 32033 is fixed (GH-4561)
xdegaye Nov 25, 2017
cef88b9
mark fatal_error as noreturn (#4563)
benjaminp Nov 25, 2017
53efbf3
bpo-11063: Handle uuid.h being in default include path (GH-4565)
ncoghlan Nov 26, 2017
4274609
bpo-32096: Ensure new embedding test can find the encodings module (G…
ncoghlan Nov 26, 2017
a6fba9b
bpo-32126: Skip asyncio test when sem_open() is not functional (GH-4559)
xdegaye Nov 26, 2017
99e86b2
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
74702e3
bpo-32107: Remove the check of the multicast bit in test_uuid.
serhiy-storchaka Nov 26, 2017
d8d6b91
bpo-30487: automatically create a venv and install Sphinx when runnin…
cjrh Nov 26, 2017
0cd2e81
bpo-29879: Update typing documentation. (GH-4573)
ilevkivskyi Nov 26, 2017
ede2ac9
bpo-23033: Improve SSL Certificate handling (GH-937)
daxlab Nov 26, 2017
41adbad
bpo-32107 - Fix test_uuid
warsaw Nov 21, 2017
d3d0465
Return None instead of 0
warsaw Nov 21, 2017
7c17cd8
Never return a locally administered MAC address
warsaw Nov 22, 2017
511fab0
Several sleep-improved fixes
warsaw Nov 23, 2017
af7929c
A missed return
warsaw Nov 23, 2017
51ba0b3
Two typos
warsaw Nov 23, 2017
909ee79
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
6acb120
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
b7d647c
Merge branch 'test_uuid' of github.com:warsaw/cpython into test_uuid
warsaw Nov 26, 2017
26db2f5
Merge branch 'test-uuid-multicast-bit' of https://github.com/serhiy-s…
warsaw Nov 26, 2017
18a96ce
bpo-32107 - Fix test_uuid
warsaw Nov 21, 2017
83dc3a3
Return None instead of 0
warsaw Nov 21, 2017
fb156f3
Never return a locally administered MAC address
warsaw Nov 22, 2017
3e8e17d
Several sleep-improved fixes
warsaw Nov 23, 2017
668f4f6
A missed return
warsaw Nov 23, 2017
6eecb80
Two typos
warsaw Nov 23, 2017
87712f3
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
740393e
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
225b063
bpo-32107: Remove the check of the multicast bit in test_uuid.
serhiy-storchaka Nov 26, 2017
5b8ca90
DEBUGGING TRAVIS - DO NOT MERGE
warsaw Nov 25, 2017
2aa4f50
Two tests cannot succeed on Travis-CI
warsaw Nov 26, 2017
71ab3b5
Merge branch 'test_uuid' of github.com:warsaw/cpython into test_uuid
warsaw Nov 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions Lib/test/test_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,62 +512,69 @@ def test_find_mac(self):

self.assertEqual(mac, 0x1234567890ab)

def check_node(self, node, requires=None, network=False):
def check_node(self, node, requires=None, *, random=False):
if requires and node is None:
self.skipTest('requires ' + requires)
hex = '%012x' % node
if support.verbose >= 2:
print(hex, end=' ')
if network:
self.assertFalse(node & (1 << 41), hex)
# The MAC address will be universally administered (i.e. the second
# least significant bit of the first octet must be unset) for any
# physical interface, such as an ethernet port or wireless adapter.
# There are some cases where this won't be the case. Randomly
# generated MACs may not be universally administered, but they must
# have their multicast bit set, though this is tested in the
# `test_random_getnode()` method specifically. Another case is the
# Travis-CI case, which apparently only has locally administered MAC
# addresses.
if not random and not os.getenv('TRAVIS'):
self.assertFalse(node & (1 << 41), '%012x' % node)
self.assertTrue(0 < node < (1 << 48),
"%s is not an RFC 4122 node ID" % hex)

@unittest.skipUnless(os.name == 'posix', 'requires Posix')
@unittest.skipIf(os.getenv('TRAVIS'),
'Travis-CI has no universally administered MAC addresses')
def test_ifconfig_getnode(self):
node = self.uuid._ifconfig_getnode()
self.check_node(node, 'ifconfig', True)
self.check_node(node, 'ifconfig')

@unittest.skipUnless(os.name == 'posix', 'requires Posix')
@unittest.skipIf(os.getenv('TRAVIS'),
'Travis-CI has no universally administered MAC addresses')
def test_ip_getnode(self):
node = self.uuid._ip_getnode()
self.check_node(node, 'ip', True)
self.check_node(node, 'ip')

@unittest.skipUnless(os.name == 'posix', 'requires Posix')
def test_arp_getnode(self):
node = self.uuid._arp_getnode()
self.check_node(node, 'arp', True)
self.check_node(node, 'arp')

@unittest.skipUnless(os.name == 'posix', 'requires Posix')
def test_lanscan_getnode(self):
node = self.uuid._lanscan_getnode()
self.check_node(node, 'lanscan', True)
self.check_node(node, 'lanscan')

@unittest.skipUnless(os.name == 'posix', 'requires Posix')
def test_netstat_getnode(self):
node = self.uuid._netstat_getnode()
self.check_node(node, 'netstat', True)
self.check_node(node, 'netstat')

@unittest.skipUnless(os.name == 'nt', 'requires Windows')
def test_ipconfig_getnode(self):
node = self.uuid._ipconfig_getnode()
self.check_node(node, 'ipconfig', True)
self.check_node(node, 'ipconfig')

@unittest.skipUnless(importable('win32wnet'), 'requires win32wnet')
@unittest.skipUnless(importable('netbios'), 'requires netbios')
def test_netbios_getnode(self):
node = self.uuid._netbios_getnode()
self.check_node(node, network=True)
self.check_node(node)

def test_random_getnode(self):
node = self.uuid._random_getnode()
# Least significant bit of first octet must be set.
# The multicast bit, i.e. the least significant bit of first octet,
# must be set for randomly generated MAC addresses. See RFC 4122,
# $4.1.6.
self.assertTrue(node & (1 << 40), '%012x' % node)
self.check_node(node)
self.check_node(node, random=True)

@unittest.skipUnless(os.name == 'posix', 'requires Posix')
def test_unix_getnode(self):
Expand Down