diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-06 21:13:51 -0700 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-06-08 11:09:13 +0000 |
commit | 121cdbdd30de1bee58e349859409dd08865c17f5 (patch) | |
tree | 030d55ad7dfb32435810b272c0b7e99e397fb466 | |
parent | e8d391f1f409b1fe87cf117e16f3d3cc65ef3305 (diff) |
Autotests: Blacklist "utun" interfaces on Darwin
Packets sent to to link-local addresses on it are never received. We
don't know why this happens, as the tooling provided by Apple for
development is close to useless. So we just ignore this interface.
Task-number: QTBUG-61041
Change-Id: Ia608df1fff6bdee5238e107d8a50292a1f9e5c03
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
(cherry-picked from commits e579c822c5bedf5e626e4eb72db3b49a4a4015dc
and 74111ce590ec8b40ee48e828c238bbfb1bf41aaa)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r-- | tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp | 7 | ||||
-rw-r--r-- | tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp index 5df5432cdd..bb94c04cb8 100644 --- a/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp +++ b/tests/auto/network/socket/qtcpserver/tst_qtcpserver.cpp @@ -920,9 +920,16 @@ void tst_QTcpServer::linkLocal() //Windows preallocates link local addresses to interfaces that are down. //These may or may not work depending on network driver (they do not work for the Bluetooth PAN driver) if (iface.flags() & QNetworkInterface::IsUp) { +#if defined(Q_OS_WIN) // Do not connect to the Teredo Tunneling interface on Windows Xp. if (iface.humanReadableName() == QString("Teredo Tunneling Pseudo-Interface")) continue; +#elif defined(Q_OS_DARWIN) + // Do not add "utun" interfaces on macOS: nothing ever gets received + // (we don't know why) + if (iface.name().startsWith("utun")) + continue; +#endif foreach (QNetworkAddressEntry addressEntry, iface.addressEntries()) { QHostAddress addr = addressEntry.ip(); if (addr.isInSubnet(localMaskv4, 16)) { diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 7ab8f6d3cc..dd9ede4884 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1462,9 +1462,17 @@ void tst_QUdpSocket::linkLocalIPv6() //Windows preallocates link local addresses to interfaces that are down. //These may or may not work depending on network driver if (iface.flags() & QNetworkInterface::IsUp) { +#if defined(Q_OS_WIN) // Do not add the Teredo Tunneling Pseudo Interface on Windows. if (iface.humanReadableName().contains("Teredo")) continue; +#elif defined(Q_OS_DARWIN) + // Do not add "utun" interfaces on macOS: nothing ever gets received + // (we don't know why) + if (iface.name().startsWith("utun")) + continue; +#endif + foreach (QNetworkAddressEntry addressEntry, iface.addressEntries()) { QHostAddress addr(addressEntry.ip()); if (!addr.scopeId().isEmpty() && addr.isInSubnet(localMask, 64)) { @@ -1537,9 +1545,16 @@ void tst_QUdpSocket::linkLocalIPv4() //Windows preallocates link local addresses to interfaces that are down. //These may or may not work depending on network driver (they do not work for the Bluetooth PAN driver) if (iface.flags() & QNetworkInterface::IsUp) { +#if defined(Q_OS_WIN) // Do not add the Teredo Tunneling Pseudo Interface on Windows. if (iface.humanReadableName().contains("Teredo")) continue; +#elif defined(Q_OS_DARWIN) + // Do not add "utun" interfaces on macOS: nothing ever gets received + // (we don't know why) + if (iface.name().startsWith("utun")) + continue; +#endif foreach (QNetworkAddressEntry addr, iface.addressEntries()) { if (addr.ip().isInSubnet(localMask, 16)) { addresses << addr.ip(); |