summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Felt <aixtools@users.noreply.github.com>2018-09-13 23:35:56 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2018-09-13 23:35:56 (GMT)
commit413118ebf3162418639a5c4af14b02d26571a02c (patch)
tree86214c5509c932a9980280e91516e4e0ca2854f1
parenta3c8ba723530ceb3328d184d3e0020534b522778 (diff)
downloadcpython-413118ebf3162418639a5c4af14b02d26571a02c.zip
cpython-413118ebf3162418639a5c4af14b02d26571a02c.tar.gz
cpython-413118ebf3162418639a5c4af14b02d26571a02c.tar.bz2
Fix test_asyncio for AIX - do not call transport.get_extra_info('sockname') (#8907)
-rw-r--r--Lib/test/test_asyncio/test_events.py10
-rw-r--r--Misc/NEWS.d/next/Tests/2018-08-24-20-23-15.bpo-34490.vb2cx4.rst2
2 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 01f616a..708fb32 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -41,9 +41,11 @@ def tearDownModule():
asyncio.set_event_loop_policy(None)
-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('.')))
@@ -617,7 +619,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(
@@ -748,7 +750,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
index 0000000..c778f94
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2018-08-24-20-23-15.bpo-34490.vb2cx4.rst
@@ -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')