From 2df5a9567ff83a547c3c66e4b523844b78968108 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 6 May 2010 17:34:58 +0100 Subject: Run autotests with minimal capabilities The autotests were previously run with ALL-Tcb capability which gives them more access to the filesystem etc. than a typical Qt application. To have more realistic testing environmnent, tests are run with no capabilities other than those required for the Qt APIs they use. i.e. NetworkServices for network tests, None for others. Reviewed-by: Liang Qi --- mkspecs/features/qttest_p4.prf | 2 +- tests/auto/languagechange/tst_languagechange.cpp | 4 ++-- tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro | 1 + tests/auto/qabstractsocket/qabstractsocket.pro | 1 + tests/auto/qdirmodel/tst_qdirmodel.cpp | 5 +++++ tests/auto/qftp/qftp.pro | 1 + tests/auto/qhostaddress/qhostaddress.pro | 1 + tests/auto/qhostinfo/qhostinfo.pro | 1 + tests/auto/qhttp/qhttp.pro | 1 + tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro | 2 ++ tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro | 1 + tests/auto/qhttpsocketengine/qhttpsocketengine.pro | 1 + tests/auto/qiodevice/qiodevice.pro | 1 + tests/auto/qlocalsocket/qlocalsocket.pro | 1 + tests/auto/qnativesocketengine/qnativesocketengine.pro | 1 + tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro | 1 + .../qnetworkaccessmanager_and_qprogressdialog.pro | 1 + tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro | 2 ++ tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro | 1 + tests/auto/qnetworkcookie/qnetworkcookie.pro | 1 + tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro | 1 + tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro | 1 + tests/auto/qnetworkinterface/qnetworkinterface.pro | 1 + tests/auto/qnetworkproxy/qnetworkproxy.pro | 1 + tests/auto/qnetworkreply/qnetworkreply.pro | 1 + tests/auto/qnetworkrequest/qnetworkrequest.pro | 1 + tests/auto/qnetworksession/qnetworksession.pro | 1 + tests/auto/qsocketnotifier/qsocketnotifier.pro | 1 + tests/auto/qsocks5socketengine/qsocks5socketengine.pro | 1 + tests/auto/qsslcertificate/qsslcertificate.pro | 1 + tests/auto/qsslcipher/qsslcipher.pro | 1 + tests/auto/qsslerror/qsslerror.pro | 1 + tests/auto/qsslkey/qsslkey.pro | 1 + tests/auto/qsslsocket/qsslsocket.pro | 2 +- tests/auto/qtcpserver/qtcpserver.pro | 1 + tests/auto/qtcpsocket/qtcpsocket.pro | 1 + tests/auto/qudpsocket/qudpsocket.pro | 1 + tests/auto/qurl/qurl.pro | 1 + 38 files changed, 45 insertions(+), 4 deletions(-) diff --git a/mkspecs/features/qttest_p4.prf b/mkspecs/features/qttest_p4.prf index e3faef1..d2011d0 100644 --- a/mkspecs/features/qttest_p4.prf +++ b/mkspecs/features/qttest_p4.prf @@ -6,7 +6,7 @@ qtAddLibrary(QtTest) symbian:{ TARGET.EPOCHEAPSIZE = 0x100000 0x2000000 # DEFINES += QTEST_NO_SPECIALIZATIONS - TARGET.CAPABILITY="ALL -TCB" + TARGET.CAPABILITY="None" RSS_RULES ="group_name=\"QtTests\";" } diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp index d04707e..bcc3be4 100644 --- a/tests/auto/languagechange/tst_languagechange.cpp +++ b/tests/auto/languagechange/tst_languagechange.cpp @@ -238,8 +238,8 @@ void tst_languageChange::retranslatability() QString fooName = tmpParentDir + "/foo"; QDir dir; QCOMPARE(dir.mkpath(tmpDir), true); -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_NOKIAX86) - // Just create a new file instead of copying exe, because exe is not there in emulator +#if defined(Q_OS_SYMBIAN) + // Just create a new file instead of copying exe, because there is no read access to /sys/bin { QFile fooFile(fooName); QVERIFY(fooFile.open(QIODevice::WriteOnly | QIODevice::Text)); diff --git a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro index a57c56f..2e2577d 100644 --- a/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/qabstractnetworkcache/qabstractnetworkcache.pro @@ -9,3 +9,4 @@ wince*|symbian: { DEPLOYMENT += testFiles } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qabstractsocket/qabstractsocket.pro b/tests/auto/qabstractsocket/qabstractsocket.pro index 59999af..814a7d2 100644 --- a/tests/auto/qabstractsocket/qabstractsocket.pro +++ b/tests/auto/qabstractsocket/qabstractsocket.pro @@ -7,4 +7,5 @@ QT = core network SOURCES += tst_qabstractsocket.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qdirmodel/tst_qdirmodel.cpp b/tests/auto/qdirmodel/tst_qdirmodel.cpp index 1bc5b7f..41bbd87 100644 --- a/tests/auto/qdirmodel/tst_qdirmodel.cpp +++ b/tests/auto/qdirmodel/tst_qdirmodel.cpp @@ -613,6 +613,11 @@ void tst_QDirModel::task196768_sorting() //this task showed that the persistent model indexes got corrupted when sorting QString path = SRCDIR; +#ifdef Q_OS_SYMBIAN + if(!RProcess().HasCapability(ECapabilityAllFiles)) + QEXPECT_FAIL("", "QTBUG-9746", Continue); +#endif + QDirModel model; /* QDirModel has a bug if we show the content of the subdirectory inside a hidden directory diff --git a/tests/auto/qftp/qftp.pro b/tests/auto/qftp/qftp.pro index c060296..33d479a 100644 --- a/tests/auto/qftp/qftp.pro +++ b/tests/auto/qftp/qftp.pro @@ -14,6 +14,7 @@ wince*: { addFiles.path = . DEPLOYMENT += addFiles TARGET.EPOCHEAPSIZE="0x100 0x1000000" + TARGET.CAPABILITY = NetworkServices } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" } diff --git a/tests/auto/qhostaddress/qhostaddress.pro b/tests/auto/qhostaddress/qhostaddress.pro index b208214..7bcbfb0 100644 --- a/tests/auto/qhostaddress/qhostaddress.pro +++ b/tests/auto/qhostaddress/qhostaddress.pro @@ -12,3 +12,4 @@ wince*: { } } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhostinfo/qhostinfo.pro b/tests/auto/qhostinfo/qhostinfo.pro index 9bfe576..06a4b17 100644 --- a/tests/auto/qhostinfo/qhostinfo.pro +++ b/tests/auto/qhostinfo/qhostinfo.pro @@ -10,4 +10,5 @@ wince*: { win32:LIBS += -lws2_32 } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhttp/qhttp.pro b/tests/auto/qhttp/qhttp.pro index 8678a19..23a73c4 100644 --- a/tests/auto/qhttp/qhttp.pro +++ b/tests/auto/qhttp/qhttp.pro @@ -21,6 +21,7 @@ wince*: { addFiles.sources = rfc3252.txt trolltech addFiles.path = . DEPLOYMENT = addFiles webFiles cgi + TARGET.CAPABILITY = NetworkServices } else:vxworks*: { DEFINES += SRCDIR=\\\"\\\" } else { diff --git a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro index 0021bc1..d9e2dce 100644 --- a/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -4,3 +4,5 @@ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib requires(contains(QT_CONFIG,private_tests)) QT = core network + +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro index 1782b43..36d56c6 100644 --- a/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro +++ b/tests/auto/qhttpnetworkreply/qhttpnetworkreply.pro @@ -4,3 +4,4 @@ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/zlib requires(contains(QT_CONFIG,private_tests)) QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qhttpsocketengine/qhttpsocketengine.pro b/tests/auto/qhttpsocketengine/qhttpsocketengine.pro index f6ad073..d76ebb6 100644 --- a/tests/auto/qhttpsocketengine/qhttpsocketengine.pro +++ b/tests/auto/qhttpsocketengine/qhttpsocketengine.pro @@ -8,5 +8,6 @@ MOC_DIR=tmp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qiodevice/qiodevice.pro b/tests/auto/qiodevice/qiodevice.pro index e695bf6..716cdce 100644 --- a/tests/auto/qiodevice/qiodevice.pro +++ b/tests/auto/qiodevice/qiodevice.pro @@ -14,6 +14,7 @@ wince*: { addFiles.sources = tst_qiodevice.cpp addFiles.path = . DEPLOYMENT += addFiles + TARGET.CAPABILITY = NetworkServices } else { DEFINES += SRCDIR=\\\"$$PWD/\\\" contains(QT_CONFIG, qt3support):QT += qt3support diff --git a/tests/auto/qlocalsocket/qlocalsocket.pro b/tests/auto/qlocalsocket/qlocalsocket.pro index 0849453..287e946 100644 --- a/tests/auto/qlocalsocket/qlocalsocket.pro +++ b/tests/auto/qlocalsocket/qlocalsocket.pro @@ -1,3 +1,4 @@ TEMPLATE = subdirs SUBDIRS = lackey test !wince*:!symbian*: SUBDIRS += example +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnativesocketengine/qnativesocketengine.pro b/tests/auto/qnativesocketengine/qnativesocketengine.pro index ad40d53..0275d37 100644 --- a/tests/auto/qnativesocketengine/qnativesocketengine.pro +++ b/tests/auto/qnativesocketengine/qnativesocketengine.pro @@ -9,4 +9,5 @@ MOC_DIR=tmp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro b/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro index e2889c1..3ccbffb 100644 --- a/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro +++ b/tests/auto/qnetworkaccessmanager/qnetworkaccessmanager.pro @@ -2,4 +2,5 @@ load(qttest_p4) SOURCES += tst_qnetworkaccessmanager.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro index 7ed5b07..378deba 100644 --- a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro +++ b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro @@ -2,4 +2,5 @@ load(qttest_p4) SOURCES += tst_qnetworkaccessmanager_and_qprogressdialog.cpp QT += network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro b/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro index 8feb95f..885dbf7 100644 --- a/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro +++ b/tests/auto/qnetworkaddressentry/qnetworkaddressentry.pro @@ -2,3 +2,5 @@ load(qttest_p4) SOURCES += tst_qnetworkaddressentry.cpp QT = core network + +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro b/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro index b24fe00..77ad347 100644 --- a/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro +++ b/tests/auto/qnetworkcachemetadata/qnetworkcachemetadata.pro @@ -2,4 +2,5 @@ load(qttest_p4) QT += network SOURCES += tst_qnetworkcachemetadata.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkcookie/qnetworkcookie.pro b/tests/auto/qnetworkcookie/qnetworkcookie.pro index 95d8b6e..2f31138 100644 --- a/tests/auto/qnetworkcookie/qnetworkcookie.pro +++ b/tests/auto/qnetworkcookie/qnetworkcookie.pro @@ -2,3 +2,4 @@ load(qttest_p4) SOURCES += tst_qnetworkcookie.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro index 3a8e61b..6d75fab 100644 --- a/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro +++ b/tests/auto/qnetworkcookiejar/qnetworkcookiejar.pro @@ -2,3 +2,4 @@ load(qttest_p4) SOURCES += tst_qnetworkcookiejar.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro b/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro index f47d6d7..3b13087 100644 --- a/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro +++ b/tests/auto/qnetworkdiskcache/qnetworkdiskcache.pro @@ -2,4 +2,5 @@ load(qttest_p4) QT += network SOURCES += tst_qnetworkdiskcache.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkinterface/qnetworkinterface.pro b/tests/auto/qnetworkinterface/qnetworkinterface.pro index 26095e9..1c5feee 100644 --- a/tests/auto/qnetworkinterface/qnetworkinterface.pro +++ b/tests/auto/qnetworkinterface/qnetworkinterface.pro @@ -3,4 +3,5 @@ SOURCES += tst_qnetworkinterface.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkproxy/qnetworkproxy.pro b/tests/auto/qnetworkproxy/qnetworkproxy.pro index 8ffc80c..fc0a216 100644 --- a/tests/auto/qnetworkproxy/qnetworkproxy.pro +++ b/tests/auto/qnetworkproxy/qnetworkproxy.pro @@ -7,4 +7,5 @@ QT = core network SOURCES += tst_qnetworkproxy.cpp +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkreply/qnetworkreply.pro b/tests/auto/qnetworkreply/qnetworkreply.pro index fd8454c..86d3155 100644 --- a/tests/auto/qnetworkreply/qnetworkreply.pro +++ b/tests/auto/qnetworkreply/qnetworkreply.pro @@ -4,3 +4,4 @@ SUBDIRS = test requires(contains(QT_CONFIG,private_tests)) !wince*:SUBDIRS += echo +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworkrequest/qnetworkrequest.pro b/tests/auto/qnetworkrequest/qnetworkrequest.pro index f576ba2..f96fd3b 100644 --- a/tests/auto/qnetworkrequest/qnetworkrequest.pro +++ b/tests/auto/qnetworkrequest/qnetworkrequest.pro @@ -2,3 +2,4 @@ load(qttest_p4) SOURCES += tst_qnetworkrequest.cpp QT = core network +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qnetworksession/qnetworksession.pro b/tests/auto/qnetworksession/qnetworksession.pro index a85925b..34761e5 100644 --- a/tests/auto/qnetworksession/qnetworksession.pro +++ b/tests/auto/qnetworksession/qnetworksession.pro @@ -1,2 +1,3 @@ TEMPLATE = subdirs SUBDIRS = lackey test +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsocketnotifier/qsocketnotifier.pro b/tests/auto/qsocketnotifier/qsocketnotifier.pro index ec924c1..c43c96a 100644 --- a/tests/auto/qsocketnotifier/qsocketnotifier.pro +++ b/tests/auto/qsocketnotifier/qsocketnotifier.pro @@ -6,5 +6,6 @@ requires(contains(QT_CONFIG,private_tests)) include(../qnativesocketengine/qsocketengine.pri) +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro index 4a32852..cd5e6e7 100644 --- a/tests/auto/qsocks5socketengine/qsocks5socketengine.pro +++ b/tests/auto/qsocks5socketengine/qsocks5socketengine.pro @@ -11,6 +11,7 @@ QT = core network # Symbian toolchain does not support correct include semantics symbian:INCPATH+=..\..\..\include\QtNetwork\private +symbian: TARGET.CAPABILITY = NetworkServices requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/qsslcertificate/qsslcertificate.pro b/tests/auto/qsslcertificate/qsslcertificate.pro index b237f2e..d7671ea 100644 --- a/tests/auto/qsslcertificate/qsslcertificate.pro +++ b/tests/auto/qsslcertificate/qsslcertificate.pro @@ -24,4 +24,5 @@ wince*: { DEFINES += SRCDIR=\\\".\\\" } else:!symbian { DEFINES += SRCDIR=\\\"$$PWD/\\\" + TARGET.CAPABILITY = NetworkServices } diff --git a/tests/auto/qsslcipher/qsslcipher.pro b/tests/auto/qsslcipher/qsslcipher.pro index 6eae588..78fd387 100644 --- a/tests/auto/qsslcipher/qsslcipher.pro +++ b/tests/auto/qsslcipher/qsslcipher.pro @@ -14,4 +14,5 @@ win32 { } } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsslerror/qsslerror.pro b/tests/auto/qsslerror/qsslerror.pro index ee5872b..5b907fb 100644 --- a/tests/auto/qsslerror/qsslerror.pro +++ b/tests/auto/qsslerror/qsslerror.pro @@ -14,4 +14,5 @@ win32 { } } +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qsslkey/qsslkey.pro b/tests/auto/qsslkey/qsslkey.pro index 32138f8..e3eeef9 100644 --- a/tests/auto/qsslkey/qsslkey.pro +++ b/tests/auto/qsslkey/qsslkey.pro @@ -24,4 +24,5 @@ wince*: { DEFINES += SRCDIR=\\\".\\\" } else:!symbian { DEFINES+= SRCDIR=\\\"$$PWD\\\" + TARGET.CAPABILITY = NetworkServices } diff --git a/tests/auto/qsslsocket/qsslsocket.pro b/tests/auto/qsslsocket/qsslsocket.pro index 541b2d9..3557fc8 100644 --- a/tests/auto/qsslsocket/qsslsocket.pro +++ b/tests/auto/qsslsocket/qsslsocket.pro @@ -24,7 +24,7 @@ wince* { } else:symbian { DEFINES += QSSLSOCKET_CERTUNTRUSTED_WORKAROUND TARGET.EPOCHEAPSIZE="0x100 0x1000000" - TARGET.CAPABILITY="ALL -TCB" + TARGET.CAPABILITY=NetworkServices certFiles.sources = certs ssl.tar.gz certFiles.path = . diff --git a/tests/auto/qtcpserver/qtcpserver.pro b/tests/auto/qtcpserver/qtcpserver.pro index fe5ea37..a3744a2 100644 --- a/tests/auto/qtcpserver/qtcpserver.pro +++ b/tests/auto/qtcpserver/qtcpserver.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs SUBDIRS = test crashingServer +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qtcpsocket/qtcpsocket.pro b/tests/auto/qtcpsocket/qtcpsocket.pro index 3d4eba3..370a695 100644 --- a/tests/auto/qtcpsocket/qtcpsocket.pro +++ b/tests/auto/qtcpsocket/qtcpsocket.pro @@ -6,3 +6,4 @@ wince*|symbian*|vxworks* : SUBDIRS = test requires(contains(QT_CONFIG,private_tests)) +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qudpsocket/qudpsocket.pro b/tests/auto/qudpsocket/qudpsocket.pro index 4ef8a40..8fd3545 100644 --- a/tests/auto/qudpsocket/qudpsocket.pro +++ b/tests/auto/qudpsocket/qudpsocket.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs SUBDIRS = test clientserver +symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qurl/qurl.pro b/tests/auto/qurl/qurl.pro index 72c93bc..018bb38 100644 --- a/tests/auto/qurl/qurl.pro +++ b/tests/auto/qurl/qurl.pro @@ -1,3 +1,4 @@ load(qttest_p4) SOURCES += tst_qurl.cpp QT = core +symbian: TARGET.CAPABILITY = NetworkServices -- cgit v0.12