summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/socket')
-rw-r--r--tests/auto/network/socket/qudpsocket/BLACKLIST3
-rw-r--r--tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp19
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST
index d58a850a1f..a98c4d5c6b 100644
--- a/tests/auto/network/socket/qudpsocket/BLACKLIST
+++ b/tests/auto/network/socket/qudpsocket/BLACKLIST
@@ -18,12 +18,9 @@ osx
osx
[broadcasting]
osx
-ubuntu-16.04
[zeroLengthDatagram]
osx
[linkLocalIPv6]
redhatenterpriselinuxworkstation-6.6
-[pendingDatagramSize]
-ubuntu-16.04
[readyReadForEmptyDatagram]
ubuntu-16.04
diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
index bbac03b708..8165ccbc58 100644
--- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
+++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp
@@ -126,12 +126,14 @@ protected slots:
private:
bool shouldSkipIpv6TestsForBrokenSetsockopt();
+ bool shouldWorkaroundLinuxKernelBug();
#ifdef SHOULD_CHECK_SYSCALL_SUPPORT
bool ipv6SetsockoptionMissing(int level, int optname);
#endif
QNetworkInterface interfaceForGroup(const QHostAddress &multicastGroup);
bool m_skipUnsupportedIPv6Tests;
+ bool m_workaroundLinuxKernelBug;
QList<QHostAddress> allAddresses;
QHostAddress multicastGroup4, multicastGroup6;
QVector<QHostAddress> linklocalMulticastGroups;
@@ -207,6 +209,16 @@ QNetworkInterface tst_QUdpSocket::interfaceForGroup(const QHostAddress &multicas
return ipv6if;
}
+bool tst_QUdpSocket::shouldWorkaroundLinuxKernelBug()
+{
+#ifdef Q_OS_LINUX
+ const QVersionNumber version = QVersionNumber::fromString(QSysInfo::kernelVersion());
+ return version.majorVersion() == 4 && version.minorVersion() >= 6 && version.minorVersion() < 13;
+#else
+ return false;
+#endif
+}
+
static QHostAddress makeNonAny(const QHostAddress &address, QHostAddress::SpecialAddress preferForAny = QHostAddress::LocalHost)
{
if (address == QHostAddress::Any)
@@ -276,6 +288,7 @@ void tst_QUdpSocket::initTestCase()
qDebug() << "Will use multicast groups" << multicastGroup4 << multicastGroup6 << linklocalMulticastGroups;
+ m_workaroundLinuxKernelBug = shouldWorkaroundLinuxKernelBug();
if (EmulationDetector::isRunningArmOnX86())
QSKIP("This test is unreliable due to QEMU emulation shortcomings.");
}
@@ -360,6 +373,9 @@ void tst_QUdpSocket::unconnectedServerAndClientTest()
void tst_QUdpSocket::broadcasting()
{
+ if (m_workaroundLinuxKernelBug)
+ QSKIP("This test can fail due to linux kernel bug");
+
QFETCH_GLOBAL(bool, setProxy);
if (setProxy) {
#ifndef QT_NO_NETWORKPROXY
@@ -805,6 +821,9 @@ void tst_QUdpSocket::bindAndConnectToHost()
void tst_QUdpSocket::pendingDatagramSize()
{
+ if (m_workaroundLinuxKernelBug)
+ QSKIP("This test can fail due to linux kernel bug");
+
QUdpSocket server;
QVERIFY2(server.bind(), server.errorString().toLatin1().constData());