summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
Commit message (Collapse)AuthorAgeFilesLines
* Fix QDnsLookup autotest failure in CI environmentShane Kearns2012-03-151-4/+6
| | | | | | | | | | | | | | The DNS server can legitimately include NS and A records for the authoritative name server in addition to the DNS records that were requested. These are now ignored when checking the reply (we only check results that match the query, rather than failing if a result is for a different host name than the query). Task-number: QTBUG-24698 Change-Id: I327f31d58cdca50c7df6b32b275d7f28b56405f0 Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Mark unstable windows network testsShane Kearns2012-03-086-0/+25
| | | | | | | | | | | | | | This is unfortunately still "most of them", because of QTBUG-24451 however some of the unit tests are still possible to test stably. Also skipped test cases which would hang forever due to QTBUG-24451. Bearer tests are not run, because they pass when test machine has no wireless LAN, but fail or hang if it does (QTBUG-24503) Change-Id: Icf99d45707102d2ef9219ed0b5ad521605716219 Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Rework QNetworkProxyFactory::systemProxyForQuery autotestShane Kearns2012-03-081-21/+76
| | | | | | | | | | | | | | | | Rather than requiring specific hardcoded proxies in the system, it now checks the proxies returned by the system have the required capabilities for the request. Note the test will pass if no proxy is configured (as QNetworkProxy::NoProxy has all required capabilities) The test prints the returned proxy lists and elapsed time diagnostic for manual comparison and debugging. Change-Id: I621ef4d1d7264a98c3e8bd485c30bc1166fcbdf0 Task-number: QTBUG-19454 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark tst_QNetworkReply::getThenDeleteObject as unstableShane Kearns2012-03-081-0/+1
| | | | | | | | | | It's unstable on all platforms, because the reply can be finished due to a race with the http thread. It isn't crashing (which the test was trying to test for), but rather the QVERIFY(!reply->isFinished()) fails, which is an inconclusive verdict. Change-Id: Ib815a7cedd220544a0c9cb83023e3334df4a0fb3 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* tst_qnetworkreply - remove qRegisterMetaType duplicatesShane Kearns2012-03-081-28/+0
| | | | | | | | | | The metatypes are registered in the constructor, don't need to register them in test cases as well. Registering in a test case is bad practice, as it could result in tests failing when run individually due to unknown metatype. Change-Id: Ic4d65d0f5fe3cdd3ab57cf2512a4906d71205a05 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Add windows XFAIL to qnetworkreply autotestShane Kearns2012-03-081-0/+4
| | | | | | | | The test case that depends on QLocalSocket consistently fails due to bugs in QLocalSocket windows implementation Change-Id: Ibfe9eb3590be4f72b52f14cd4fbe5be61f6cf70e Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Fix tst_QNetworkReply::httpWithNoCredentialUsage autotestShane Kearns2012-03-061-16/+39
| | | | | | | | | | | | The test was testing the wrong thing, and passing even though QNetworkRequest::AuthenticationReuseAttribute was not being respected, until recently when I fixed username/password in URLs Now the cache is properly bypassed when this attribute is set to manual, and the autotest is updated to check this. Change-Id: I87943515562d0b16b03504f0758ba265758d1c22 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fix QNetworkReply ioGetFromHttpWithCache test caseShane Kearns2012-03-061-0/+1
| | | | | | | | | | | | | | Expiration date is calculated from max-age header when a response is inserted into the cache. Because the test case is prepopulating the cache outside of QNAM's control, the expiration date was uninitialised, causing the test to fail. This is due to a 2 year old change in QNAM, where max age calculation was removed from cache retrieval, and more recent changes to QDateTime where secsTo() returns 0 if one of the arguments is invalid. Change-Id: Ieecd46123dde4ca0fd0be3ae79e70e1528ec02bc Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* QSslCertificate - make lazy initialisation thread safeShane Kearns2012-03-061-0/+72
| | | | | | | | | | | | | | | | | | | QSslCertificate can be copied around into multiple threads, without detaching. For example, the https worker threads inside QNetworkAccessManager. There are const methods, which lazily initialise members of the private class without detaching (i.e. caching results of expensive function calls) These functions now lock the d pointer using QMutexPool to avoid concurrency related crashes. autotest crashes 20% of the time in release builds without the fix, passes 100 times in a row with the fix. Task-number: QTBUG-20452 Change-Id: I64a01af8159216f2dd6215a08669890f6c029ca8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-042-5/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| * Make some tests and benchmarks pass with QT_NO_QSTRINGBUILDERStephen Kelly2012-03-012-5/+5
| | | | | | | | | | Change-Id: I6c91a613007043d0f26ac11e98353a0b9ce646ae Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Change bugreports.qt.nokia.com -> bugreports.qt-project.orgSergio Ahumada2012-03-021-1/+1
| | | | | | | | | | Change-Id: Ia795098f24cf358b15067f54cd08dff0bd792bc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Use QSystemError for QDnsLookup windows backendShane Kearns2012-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | The OS provides the error string in this case. This gives more information to the developer seeing a generic error. Change-Id: Ia03642982f3513ee5a8a9fa98d918e948f8d97a5 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* | Windows - fix getsockopt calls for narrower than int optionsShane Kearns2012-03-011-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows unhelpfully writes to only one byte of the output buffer when getsockopt is called for a boolean option. Therefore we have to zero initialise the int rather than initialising to -1 as was done before. This in general only works for little endian architecture, because the word would look like 0x01000000 on big endian. So I have added some compile time asserts in the assumption that windows is always little endian. This is ok for comparisons with 0/false, but not comparisons with true or nonzero values. In the case of IPV6_V6ONLY, it is documented as DWORD (unsigned int) but on some windows versions it is returned as a boolean triggering the warning. I removed the warning, as the conversion to int works on both LE and BE since it is only compared with zero. Task-number: QTBUG-23488 Change-Id: I3c586d1ada76465fc045a82661f289920c657a4c Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
* | network cookies: check "example.com" != "example.com."Shane Kearns2012-02-291-0/+12
|/ | | | | | | | Only test code change, we already have the correct behaviour Task-number: QTBUG-20001 Change-Id: I2296f405f47f9c8d15796e69f9d1854063e38d6a Reviewed-by: Richard J. Moore <rich@kde.org>
* Changed qnetworkreply unittest to return correct codeKurt Korbatits2012-02-271-7/+5
| | | | | | | | - Changed waitForFinished() to return correct return code Change-Id: Ic6b0dfa195254783a2106011c4a108d907d73557 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* clean up qmake-generated projectsOswald Buddenhagen2012-02-242-14/+0
| | | | | | | | remove "header" and assignmets which are defaults or bogus, reorder some assignments. Change-Id: I67403872168c890ca3b696753ceb01c605d19be7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* compile fix: missing #include <unistd.h>sMarc Mutz2012-02-232-0/+6
| | | | | Change-Id: I3bd34f67033fb921c49da97419c107811d8da6ff Reviewed-by: David Faure <faure@kde.org>
* Fix the qlocalsocket testAndrew Stanley-Jones2012-02-211-1/+3
| | | | | | | | | | | | | | | | | This test is broken in a couple of ways. A few one line fixes combined into a single patch. 1. Linux is the only OS that does abstract unix domain sockets by prepending a null as the first character. Don't test this on non-Linux platforms and expect it to pass. 2. Change QVERIFY2 to QCOMPARE so we can see why this fails in CI but no on the local system. Use QCOMPARE where possible. Change-Id: Ic3d2cf9696730dc4d6589539fdfe8a48ccf28de5 Reviewed-by: Alex <alex.blasche@nokia.com>
* Enable qlocalsocket auto testAndrew Stanley-Jones2012-02-211-1/+1
| | | | | | | | Due to recent changes in the test it should now compile and run properly. This re-enables the test. Change-Id: I6c647d99fa1f1b1c53e006fef2865d6be08ec16c Reviewed-by: Alex <alex.blasche@nokia.com>
* Test for QT_NO_SSL instead of QT_NO_OPENSSLShane Kearns2012-02-218-64/+64
| | | | | | | | Change the ifdefs in our own code (except openssl backend) to use the new configure flag. Change-Id: I8774734771c66b22164b5fae8fdb27814ac3df7b Reviewed-by: Richard J. Moore <rich@kde.org>
* Changed qnetworksession unittest to work from installation dirKurt Korbatits2012-02-212-1/+6
| | | | | | | | - Made test depend on subprogram - added install of subprogram Change-Id: Ib263e9e75ed3c900b52fb1c9b6d319e71d19bdbb Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed qabstractnetworkcache unittest to use TESTDATAKurt Korbatits2012-02-201-5/+1
| | | | | | | | - Changed qabstractnetworkcache to install testdata Change-Id: I8f2ae6103214755ee7898dbc0ee50c0e4d7d45ab Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix handling of urls containing username/password in QNetworkAccessManagerShane Kearns2012-02-171-10/+53
| | | | | | | | | | | | | | | | | | QNetworkAccessManager was ignoring the supplied credentials, although webkit seems to support these urls at a higher level. Following the behaviour of browsers: We use supplied credentials if authentication is required. We add supplied credentials to the authentication cache. We emit authenticationRequired signal if the credentials were wrong. We do not use previously cached credentials for that url Synchronous http requests fail, if the credentials were wrong. Task-number: QTBUG-18107 Change-Id: If46e8eab1511ba8a0f4bbe0d4efaabc4df0b8ab4 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Changed qnetworkreply unittest to work from install directoryKurt Korbatits2012-02-174-289/+243
| | | | | | | | | | | | | | | | | - made subdir test depend on echo - remove SRCDIR and changed to use TESTDATA and QFINDTESTDATA - added waitForFinish() to handle slow networks - removed core module header from echo subprogram and replaced with needed header only - Added ipv6 skip to connectToIPV6Address() if not available - Added check QT_BUILD_INTERNAL and skip tests if backend not available - Skip permission tests if run as root - Removed win32 debug and release directory locations so that application is in known location relative to test data Change-Id: I58c3c2fca3cd2fee72fdb81d016bb4fd7fe08ac2 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Changed qsslkey to work from installation directoryKurt Korbatits2012-02-172-52/+12
| | | | | | | | - Changed to use TESTDATA and QFINDTESTDATA instead of SRCDIR Change-Id: I30bf175c2c9044e1f8556260a032467ca0dfc09f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Changed qsslcertificate unittest to work from install directoryKurt Korbatits2012-02-172-63/+38
| | | | | | | | - Changed to use TESTDATA and QFINDTESTDATA instead of SRCDIR Change-Id: I1957ef287ba2f337b5e0b2c6245d872eacb6316f Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Eliminate duplicate data row names in network autotestsJason McDonald2012-02-164-23/+24
| | | | | Change-Id: Icbfc24309a182f37268232fc3c299d35d6d6a0ea Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Allow the QLocalServer to listen to a native descriptorAndrew Stanley-Jones2012-02-151-4/+100
| | | | | | | | | | | | | QLocalServer could only listen to sockets it created. Thi is not always possible as sockets may be passed by socketpair() or have to be created locally by other means. This adds a similar feature to QLocalSocket where a native descriptor maybe used. Change-Id: I43b0af179b3b868dd164d4e1fd312ff4546cf9ff Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com> Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com> Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Abort FTP download, not the whole applicationShane Kearns2012-02-151-0/+24
| | | | | | | | | | An old coding error meant that the C runtime abort() function was being called instead of QFtp::abort() when cancelling an FTP download using QNetworkReply::close() Task-number: QTBUG-22820 Change-Id: Ib97fda9769b2b55a08c042c66c4444cb6216d2b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows: Fixed helper process finding in network testsMiikka Heikkinen2012-02-154-11/+44
| | | | | | | | | | | | | | | | | | | | Helper processes were not found properly on all network tests when the test was run with "nmake check": - tst_qtcpsocket - tst_qtcpserver - tst_qnetworksession - tst_qnetworkreply Task-number: QTBUG-24199 Task-number: QTBUG-24203 Task-number: QTBUG-24226 Task-number: QTBUG-24231 Task-number: QTBUG-24232 Change-Id: Ia4451b5a5e3fe9f81aba3837baf8292411f995d8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* Make "nmake check" pass for network tests in Windows.Miikka Heikkinen2012-02-142-0/+4
| | | | | | | | | | | | Marked two tests insignificant due to failures, these need to be fixed later and then re-enabled: - tst_qnetworkreply - tst_qsslsocket Task-number: QTBUG-24203 Change-Id: I9647833bf15fe5a340d7ef59e1dcb007a92677dc Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Add socketOptions flags to QLocalServerAndrew Stanley-Jones2012-02-101-0/+55
| | | | | | | | | | QLocalServer had no way to set socket options that more complicated servers require. The first set of options allow setting of access control on the sockets. Change-Id: If4268c66462fc2e6cf1e70b1d5f56c76d2c69228 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
* Replace Q_WS_WINCE against Q_OS_WINCE.Andreas Holzammer2012-02-091-1/+1
| | | | | | | | | | Window system Macros where deprecated so use Q_OS_WINCE for now. This code will need some refactoring, but this is the first step to it. Change-Id: I5876b80ee45d4b38ac63fc7d51e775dc70bbd485 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix qlocalsocket autotestHarald Fernengel2012-02-081-19/+11
| | | | | | | | | Lackey is currently not built due to a qscript dependency. Mark the test as an expected failure, so we can resume testing QLocalSocket again. See QTBUG-24142 Change-Id: I2642ed30cf7a2068f30f63801c632fea7dae7691 Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
* Improved stability of tst_qhttpsocketengineRohan McGovern2012-02-081-7/+7
| | | | | | | | | | | | | This autotest assumed that various network operations could always be completed within 5 seconds. Notably, it assumed that an attempt to resolve a nonexistent hostname would always result in an error within 5 seconds. In my testing, it usually takes 4-6 seconds to complete, but occasionally takes as much as 13 seconds. (cherry picked from qt4 commit c85faef67b6a7e8fcedb4ce800282d41f5b79ec1) Change-Id: I982ecf6ebc1bb8ee2184cf5592cb2684474c870b Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* tst_qnetworkreply: remove no such signal warningsMartin Petersson2012-02-071-2/+2
| | | | | | | | The QNetworkReply finished signal does not have a bool parameter. Change-Id: I87bd0410545f7a2fc2ab63cca90548f0585bf7a0 Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
* Don't include config.tests/unix/openssl/openssl.pri (again)Bradley T. Hughes2012-02-031-1/+0
| | | | | | | | | This file was removed in commit ba9302b8a9b6b50f37987261c1ade9af2ade2d3c. Commit 8fad23f3261bdcf9bd0e11980ebfc3b00c2469c6 removed openssl.pri from src/network/ssl/ssl.pri, but not from the qsslsocket autotest. Change-Id: Ic1a576ee7f0ee3d68471121ba636b94ce7bae455 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows: Fix inclusion of <windows.h>Friedemann Kleint2012-02-011-0/+3
| | | | | | | | | | | | | - Always use <qt_windows.h> as the last file to be included. - Remove it from some headers, use Qt::HANDLE instead of HANDLE. - Clean up #ifdef, use Q_OS_WIN for Windows/Windows CE. - Add NOMINMAX to qt_windows.h to avoid problems with the min/max macros. - Remove <windows.h> from qplatformdefs.h (VS2005) Change-Id: Ic44e2cb3eafce38e1ad645c3bf85745439398e50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Remove Symbian specific code from qtbase.Xizhi Zhu2012-01-311-1/+0
| | | | | Change-Id: I27d37d914b71e1e43c94e2a975ffec49e1ecd456 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix tst_QSslCertificate::toText on windowsShane Kearns2012-01-301-2/+2
| | | | | | | | Open the comparison file as text mode, so that it does not differ from the dumped certificate in CRLF vs LF line endings. Change-Id: I54d6ea6e37044059e89e762435657ebf5fa6cb39 Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix link error in QSslSocket auto testShane Kearns2012-01-301-2/+2
| | | | | | | | | This has been broken for months, but invisible because the code causing the link error is unreachable (due to QSKIP). So the link error only occurs in debug builds with -O0. Change-Id: I6093a7803bedf37bfc8c2d9ff0b28b2309b57959 Reviewed-by: Richard J. Moore <rich@kde.org>
* Add support for DNS lookups using native APIsJeremy Lainé2012-01-305-0/+382
| | | | | | | | | | | | | | | | The QDnsLookup class provides asynchronous APIs for performing DNS lookups. For now, the following lookups are supported: - A and AAAA - CNAME as defined per RFC 1035 - MX as defined per RFC 1035 - NS as defined per RFC 1035 - PTR as defined per RFC 1035 - SRV as defined per RFC 2782 - TXT as defined per RFC 1035 Task-number: QTBUG-10481 Change-Id: I46c1741ec23615863eeca3a1231d5e3f8942495e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3050-50/+50
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QAbstractSocket / QSslSocket: add API to pause and resumePeter Hartmann2012-01-251-17/+93
| | | | | | | | | | | | | | | pause and resume is currently only supported upon emitting the QSslSocket::sslErrors() signal. The API was added in QAbstractSocket to also support QAbstractSocket::proxyAuthenticationRequired() in the future. This is the first patch to support that feature on the socket level, another patch will follow to support sslErrors() and authenticationRequired() in QNetworkAccessManager / QNetworkReply. Task-number: QTBUG-19032 Change-Id: Ide2918268590ab9a01454ab26cb7fdca3dc840ab Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
* Changed qnetworkdiskcache unittest to cleanup test directory.Kurt Korbatits2012-01-241-0/+3
| | | | | | | | | - Remove foo directory tree after run. Change-Id: I2d554b4c64fc7162c7717c840534cf77f5e744d0 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-2350-50/+50
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Mark tst_qhostinfo as insignificant on Linux.Rohan McGovern2012-01-231-0/+2
| | | | | | | | | | This test sometimes gives different results on consecutive runs, and is therefore insignificant for the purpose of regression detection. Task-number: QTBUG-23837 Change-Id: I8747972c5cb7952089c54cbd22e1660db551e2f5 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Removing QHttpHeader and QHttpResponseHeader.Jonas M. Gastal2012-01-191-1/+1
| | | | | | | | | QAuthenticator used it for the convinience of QHttpSocketEngine only. QHttpSocketEngine has now been ported to use QHttpNetworkReply to parse HTTP responses. Change-Id: Idf6e70aa76613aad6e3d789d81ca1b4fd73575c2 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove QNetworkConfiguration::bearerName().Xizhi Zhu2012-01-181-8/+8
| | | | | | | | | It was added only to maintain source compatibility with Qt Mobility. Change-Id: Iea8d40e401bd1f8d5115268e09b256eacca69ea0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>