Author Michael.Felt
Recipients Michael.Felt, asvetlov, eamanu, lepaperwan, maxifree, miss-islington, twisteroid ambassador, yselivanov
Date 2019-05-24.08:10:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558685439.16.0.274596060761.issue35545@roundup.psfhosted.org>
In-reply-to
Content
In hindsight, maybe the message could have been better,

BUT - is it relevant?

commit 413118ebf3162418639a5c4af14b02d26571a02c
Author: Michael Felt <aixtools@users.noreply.github.com>
Date:   Fri Sep 14 01:35:56 2018 +0200

    Fix test_asyncio for AIX - do not call transport.get_extra_info('sockname') (#8907)

FYI:
I have a server where "netstat -in" (aka ip a) does show an address with a scope component. Not figured out how to query that in C or python yet. (not my favorite thing - messing with socket() :p@me)

Re: the example below - I would have thought the scopeid would be showing on en1, not en2 - and I am also wondering, if the scopeid is "%1" AIX ignores it. (also, I masked my global ipv6 address).
Maybe en0 has a scopeid BECAUSE there is a global address (where en1 does not).

michael@x071:[/home/michael]netstat -ni
Name  Mtu   Network     Address           Ipkts Ierrs    Opkts Oerrs  Coll
en0   1500  link#2      fa.d1.8c.f7.62.4  3103849     0  1085261     0     0
en0   1500  192.168.129 192.168.129.71    3103849     0  1085261     0     0
en0   1500  192.168.90  192.168.90.71     3103849     0  1085261     0     0
en0   1500  MASK::1:f8d1:8cff:fef7:6204   3103849     0  1085261     0     0
en0   1500  fe80::f8d1:8cff:fef7:6204%2   3103849     0  1085261     0     0
en1   1500  link#3      fa.d1.8c.f7.62.5    12704     0     9323     0     0
en1   1500  192.168.2   192.168.2.1         12704     0     9323     0     0
en1   1500  fe80::f8d1:8cff:fef7:6205       12704     0     9323     0     0
lo0   16896 link#1                           3908     0     3908     0     0
lo0   16896 127         127.0.0.1            3908     0     3908     0     0
lo0   16896 ::1%1                            3908     0     3908     0     0

So, I looked at another server with two interfaces - here only one has a IPv6 address

root@x064:[/home/root]netstat -in
Name  Mtu   Network     Address            Ipkts Ierrs    Opkts Oerrs  Coll
en0   1500  link#2      0.21.5e.a3.c7.44   119801     0    84874     0     0
en0   1500  192.168.129 192.168.129.64     119801     0    84874     0     0
en0   1500  fe80::221:5eff:fea3:c744       119801     0    84874     0     0
en1   1500  link#3      fa.d1.81.81.ac.5    89362     0    48409     0     0
en1   1500  192.168.2   192.168.2.64        89362     0    48409     0     0
lo0   16896 link#1                         139882     0   139881     0     0
lo0   16896 127         127.0.0.1          139882     0   139881     0     0
lo0   16896 ::1%1                          139882     0   139881     0     0
root@x064:[/home/root]

And, after I activate IPv6 on the second interface - I see a scopeid-like representation:

Name  Mtu   Network     Address            Ipkts Ierrs    Opkts Oerrs  Coll
en0   1500  link#2      0.21.5e.a3.c7.44   120043     0    85045     0     0
en0   1500  192.168.129 192.168.129.64     120043     0    85045     0     0
en0   1500  fe80::221:5eff:fea3:c744       120043     0    85045     0     0
en1   1500  link#3      fa.d1.81.81.ac.5    89370     0    48420     0     0
en1   1500  192.168.2   192.168.2.64        89370     0    48420     0     0
en1   1500  fe80::f8d1:81ff:fe81:ac05%2     89370     0    48420     0     0
lo0   16896 link#1                         139923     0   139922     0     0
lo0   16896 127         127.0.0.1          139923     0   139922     0     0
lo0   16896 ::1%1                          139923     0   139922     0     0

I would have to guess at this point, but to simplify, it seems that AIX resolves addresses differently (rather than say 'not correctly') and maybe requires specific conditions.

If relevant - I can provide the output from Debian on POWER. But it seems AIX is only using a "ADDRv6%scopeid" when there at least two interfaces defined.

+++++++++
What the bot is not showing is this re: the "mock" connections 'failing':

root@x066:[/data/prj/python/python3-3.8]./python -m test test_asyncio
Run tests sequentially
0:00:00 [1/1] test_asyncio
/data/prj/python/git/python3-3.8/Lib/test/support/__init__.py:1627: RuntimeWarning: coroutine 'AsyncMockMixin._mock_call' was never awaited
  gc.collect()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Future exception was never retrieved
future: <Future finished exception=BrokenPipeError(32, 'Broken pipe')>
Traceback (most recent call last):
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/subprocess.py", line 162, in _feed_stdin
    await self.stdin.drain()
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/streams.py", line 443, in drain
    await self._protocol._drain_helper()
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/streams.py", line 200, in _drain_helper
    await waiter
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/unix_events.py", line 661, in _write_ready
    n = os.write(self._fileno, self._buffer)
BrokenPipeError: [Errno 32] Broken pipe
Future exception was never retrieved
future: <Future finished exception=BrokenPipeError(32, 'Broken pipe')>
Traceback (most recent call last):
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/subprocess.py", line 162, in _feed_stdin
    await self.stdin.drain()
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/streams.py", line 443, in drain
    await self._protocol._drain_helper()
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/streams.py", line 200, in _drain_helper
    await waiter
  File "/data/prj/python/git/python3-3.8/Lib/asyncio/unix_events.py", line 661, in _write_ready
    n = os.write(self._fileno, self._buffer)
BrokenPipeError: [Errno 32] Broken pipe
test test_asyncio failed -- Traceback (most recent call last):
  File "/data/prj/python/git/python3-3.8/Lib/unittest/mock.py", line 1226, in patched
    return func(*args, **keywargs)
  File "/data/prj/python/git/python3-3.8/Lib/test/test_asyncio/test_base_events.py", line 1316, in test_create_connection_ipv6_scope
    sock.connect.assert_called_with(('fe80::1', 80, 0, 1))
  File "/data/prj/python/git/python3-3.8/Lib/unittest/mock.py", line 838, in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: connect(('fe80::1', 80, 0, 1))
Actual: connect(('fe80::1', 80, 0, 0))

FYI: I have IPv6 interfaces defined on this server (x066) - but only one. And I tried changing fe80::1%1 to fe80::1%2, etc, but the end result is similar:

AssertionError: expected call not found.
Expected: connect(('fe80::1', 80, 0, 2))
Actual: connect(('fe80::1', 80, 0, 0))

Hope this helps!
History
Date User Action Args
2019-05-24 08:10:39Michael.Feltsetrecipients: + Michael.Felt, asvetlov, yselivanov, lepaperwan, eamanu, twisteroid ambassador, miss-islington, maxifree
2019-05-24 08:10:39Michael.Feltsetmessageid: <1558685439.16.0.274596060761.issue35545@roundup.psfhosted.org>
2019-05-24 08:10:39Michael.Feltlinkissue35545 messages
2019-05-24 08:10:38Michael.Feltcreate