]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.7] bpo-34490: Fix test_asyncio for AIX - do not call transport.get_extra_info...
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Fri, 14 Sep 2018 00:03:35 +0000 (17:03 -0700)
committerGitHub <noreply@github.com>
Fri, 14 Sep 2018 00:03:35 +0000 (17:03 -0700)
* [3.7] Fix test_asyncio for AIX - do not call transport.get_extra_info('sockname') (GH-8907).
(cherry picked from commit 413118ebf3162418639a5c4af14b02d26571a02c)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
* Update test_events.py

Lib/test/test_asyncio/test_events.py
Misc/NEWS.d/next/Tests/2018-08-24-20-23-15.bpo-34490.vb2cx4.rst [new file with mode: 0644]

index 01ed47b3649558035b4d0c35b5b7e25f6417276e..66b06034900703a18bcc8011cf5c4b875f258133 100644 (file)
@@ -37,9 +37,11 @@ from test.test_asyncio import utils as test_utils
 from test import support
 
 
-def osx_tiger():
+def broken_unix_getsockname():
     """Return True if the platform is Mac OS 10.4 or older."""
-    if sys.platform != 'darwin':
+    if sys.platform.startswith("aix"):
+        return True
+    elif sys.platform != 'darwin':
         return False
     version = platform.mac_ver()[0]
     version = tuple(map(int, version.split('.')))
@@ -613,7 +615,7 @@ class EventLoopTestsMixin:
     def test_create_unix_connection(self):
         # Issue #20682: On Mac OS X Tiger, getsockname() returns a
         # zero-length address for UNIX socket.
-        check_sockname = not osx_tiger()
+        check_sockname = not broken_unix_getsockname()
 
         with test_utils.run_test_unix_server() as httpd:
             conn_fut = self.loop.create_unix_connection(
@@ -744,7 +746,7 @@ class EventLoopTestsMixin:
     def test_create_ssl_unix_connection(self):
         # Issue #20682: On Mac OS X Tiger, getsockname() returns a
         # zero-length address for UNIX socket.
-        check_sockname = not osx_tiger()
+        check_sockname = not broken_unix_getsockname()
 
         with test_utils.run_test_unix_server(use_ssl=True) as httpd:
             create_connection = functools.partial(
diff --git a/Misc/NEWS.d/next/Tests/2018-08-24-20-23-15.bpo-34490.vb2cx4.rst b/Misc/NEWS.d/next/Tests/2018-08-24-20-23-15.bpo-34490.vb2cx4.rst
new file mode 100644 (file)
index 0000000..c778f94
--- /dev/null
@@ -0,0 +1,2 @@
+On AIX with AF_UNIX family sockets getsockname() does not provide 'sockname',
+so skip calls to transport.get_extra_info('sockname')