diff --git a/autotests/krununittest.cpp b/autotests/krununittest.cpp --- a/autotests/krununittest.cpp +++ b/autotests/krununittest.cpp @@ -235,20 +235,22 @@ void KRunUnitTest::testKtelnetservice() { - const QString ktelnetDesk = QFINDTESTDATA(QStringLiteral("../src/ioslaves/telnet/ktelnetservice5.desktop")); - QVERIFY(!ktelnetDesk.isEmpty()); + const QString ktelnetDesk = QStandardPaths::locate(QStandardPaths::ApplicationsLocation, QStringLiteral("ktelnetservice5.desktop")); - QString ktelnetExec = QStandardPaths::findExecutable(QStringLiteral("ktelnetservice5")); - - const KService service(ktelnetDesk); + if (ktelnetDesk.isEmpty()) { + qWarning() << "ktelnetservice5.desktop not found, skippping test"; + return; + } // if KIO is installed we'll find /ktelnetservice5, otherwise KIO::DesktopExecParser will // use the executable from Exec= line if (ktelnetExec.isEmpty()) { ktelnetExec = service.exec().remove(QLatin1String(" %u")); } QVERIFY(!ktelnetExec.isEmpty()); + const KService service(ktelnetDesk); + const QStringList protocols({QStringLiteral("ssh"), QStringLiteral("telnet"), QStringLiteral("rlogin")}); for (const QString &protocol : protocols) { QList urls({QUrl(QStringLiteral("%1://root@10.1.1.1").arg(protocol))});