[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
Roundup Robot added the comment: New changeset 330c7aa2922b by Charles-François Natali in branch '3.3': Issue #18308: don't take the scope ID into account when comparing IPv6 http://hg.python.org/cpython/rev/330c7aa2922b New changeset b44749cee660 by Charles-François Natali in branch 'default': Issue #18308: don't take the scope ID into account when comparing IPv6 http://hg.python.org/cpython/rev/b44749cee660 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
Charles-François Natali added the comment: Fixed, thanks! -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
Charles-François Natali added the comment: I think the safest solution is not to compare scope_id when comparing addresses. Agreed. However, it might be simpler to special-case the IPv6 addresses comparison by overriding it in the IPv6 sendmsg base test. Could you try the patch attached? -- Added file: http://bugs.python.org/file30797/test_socket_scope_id.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___diff -r 6a0437adafbd Lib/test/test_socket.py --- a/Lib/test/test_socket.py Fri Jun 28 19:25:45 2013 +0200 +++ b/Lib/test/test_socket.py Sat Jul 06 12:18:10 2013 +0200 @@ -3312,7 +3312,11 @@ class SendrecvmsgUDP6TestBase(SendrecvmsgDgramFlagsBase, SendrecvmsgConnectionlessBase, ThreadedSocketTestMixin, UDP6TestBase): -pass + +def checkRecvmsgAddress(self, addr1, addr2): +# Called to compare the received address with the address of +# the peer, ignoring scope ID +self.assertEqual(addr1[:-1], addr2[:-1]) @requireAttrs(socket.socket, sendmsg) @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
STINNER Victor added the comment: However, it might be simpler to special-case the IPv6 addresses comparison by overriding it in the IPv6 sendmsg base test. Yes, this is why I proposed another approach. (But David convinced me that it is not the right approach.) Victor -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
David Edelsohn added the comment: The patch in msg192405 works and fixes that error on AIX. That is exactly what I had in mind, but I incorrectly had been looking higher up the class hierarchy to override the method. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
STINNER Victor added the comment: The scope_id in the original bind call defaults to 0, which represents an ambiguous scoped address and allows the IPV6 protocol and implementation to choose the interface or site identifier. Ok, so here is a patch using scope_id=1 to get a reliable IPv6 address. Can you please try it on AIX? -- keywords: +patch nosy: +haypo Added file: http://bugs.python.org/file30763/scope_id.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
David Edelsohn added the comment: The patch in msg192259 probably will work on the particular AIX system runnnig the buildbot, but I do not believe that the patch is the correct solution for the problem. scope_id 1 is not necessarily the correct link for IPv6 address ::1. The scope_id values are system dependent and the result could be any value depending on the interfaces available on the particular system running the test. scope_id 1 might not exist on the system, and forcing that value would generate an error. I think the safest solution is not to compare scope_id when comparing addresses. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
New submission from David Edelsohn: The recvmsg tests in test_socket.py check that the address returned by recvmsg matches the original address to which the socket was bound. For IPv6, sockaddr includes sin6_scope_id, in addition to the address and port. The test connects to host ::1, which is loopback, but is an under-specified address because the link scope is left ambiguous. The scope_id in the original bind call defaults to 0, which represents an ambiguous scoped address and allows the IPV6 protocol and implementation to choose the interface or site identifier. The recvmsg call returns the actual scope_id. The test incorrectly checks that the full sockaddr matches. sin6_scope_id may not match for IPv6 addresses. This generates bogus failures on AIX. (Microsoft has a good description about scope_id: http://msdn.microsoft.com/en-us/library/windows/desktop/ms739166%28v=vs.85%29.aspx) -- components: Tests messages: 191908 nosy: David.Edelsohn priority: normal severity: normal status: open title: checkRecvmsgAddress wrong in test_socket.py (AIX failures) type: behavior versions: Python 3.3, Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18308] checkRecvmsgAddress wrong in test_socket.py (AIX failures)
David Edelsohn added the comment: The current arguments to checkRecvmsgAddress() are the sockaddrs, so it does not know the protocol family. One potential patch to infer the family and apply the correct test is: diff -r 035d8fed07ad Lib/test/test_socket.py --- a/Lib/test/test_socket.py Tue Jun 25 22:54:35 2013 +0200 +++ b/Lib/test/test_socket.py Wed Jun 26 15:16:31 2013 -0700 @@ -1809,7 +1809,10 @@ def checkRecvmsgAddress(self, addr1, addr2): # Called to compare the received address with the address of # the peer. -self.assertEqual(addr1, addr2) +if len(addr1) 3 or len(addr2) 3: +self.assertEqual(addr1[:-1], addr2[:-1]) +else: +self.assertEqual(addr1, addr2) # Flags that are normally unset in msg_flags msg_flags_common_unset = 0 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18308 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com