summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
Commit message (Collapse)AuthorAgeFilesLines
* QtNetwork: use nullary version of qRegisterMetaType<T>("T")Marc Mutz2012-07-258-26/+3
| | | | | | | | | | | | | | | | | Using the nullary version has the advantage that multiple calls during a program run are much more efficient, since an inlined atomic is used to store the result. It also ensures that Q_DECLARE_METATYPE(T) has been used, whereas qRegisterMetaType<T>("T") will happily register anything. So I've added the macro where it was missing, or moved it to a central place when it existed hidden. In tst_qnetworkreply, this became a bit tricky, because a private header is conditionally included, so moved the Q_DECLARE_METATYPE() into a conditional section, too. Change-Id: I71484523e4277f4697b7d4b2ddc3505375162727 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix some spelling errorsSergio Ahumada2012-07-112-2/+2
| | | | | | Change-Id: I19d3b2e9a5180b13deb828b55195404ef20be295 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* fixed unittest builds for winceBjoern Breitmeyer2012-07-061-14/+0
| | | | | | | | | | removed printsupport tests for wince as there is no print support on wince and removed the special handling for wince from 4.8 on some tests as the dependent modules are not part of qt base anymore Change-Id: I4ffb22da11f98beee1013f775cb5ce4b936d3211 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* tst_qudpsocket: Interface fix for Windows XpMartin Petersson2012-07-061-0/+6
| | | | | | | | On Windows Xp we can not connect to the pseudo interfaces used for Teredo, so do not add these to the tests. Change-Id: I4e20c880fa2d18f266ffcef2f640d8b2e6d0cd21 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* tst_QTcpServer::linkLocal fix for Windows XpMartin Petersson2012-07-051-0/+3
| | | | | | | | Do not try to connect to the Terdo Tunneling Pseudo-Interface as this will fail for Windows Xp. Change-Id: I6dcd8369ba1e8642224cd4ac53f4032ed46d050d Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Avoid load(testcase) for installing test helper appsRohan McGovern2012-07-042-4/+3
| | | | | | | | | | | | Make test projects declare TEST_HELPER_INSTALLS rather than calling a function exported by testcase.prf. load(testcase) may be unsafe, as testcase.prf should be processed after default_post.prf. Fixes silent disabling of various autotests. Change-Id: I56b35ffd653a637ad5ab18d64dd1a1edadfac59f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com>
* tst_QTcpServer::clientServerLoop fix for Windows XpMartin Petersson2012-07-031-1/+1
| | | | | | | | When we do not have dual stack the listen on QHostAddress::Any will result in a serverAddress that is AnyIPv4. Change-Id: I3c2c21c9412cd46a57e3ed7ce1c1bd2ef42d4bd9 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fixed warnings in qnetworkreply unit testKurt Korbatits2012-07-031-0/+2
| | | | | | | | | On windows without ssl there was a disconnect on sslError signal that was not wrapped in ifdef. Change-Id: I9b1327adfa853d4dc8f1d8a0120f8f0ed7c13e9e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* QSslCertificate::fromPath fix wildcard handlingMartin Petersson2012-07-031-0/+4
| | | | | | | | | | | | | | The reqExp used to handle wildcards in the path was broken. So we always searched the working directory and not the specified path. Autotest where passing because of a hack used for Windows paths where we removed the first two chars in the path string. This fix will not use nativeSeparators thus removing the Windows hack and fix the regExp to match wildcard chars. Task-number: QTBUG-23573 Change-Id: I56fadbb67f25b8ce9c0f17cb6232e0bdb9148b1c Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fixed several unit tests to work in shadow buildsKurt Korbatits2012-06-291-0/+1
| | | | | | | | - qlogging, qthreadstorage, qnetworkreply, qapplication, qfile, qprocess Added app_bundle and debug_and_release_target to CONFIG Change-Id: I6212902c449520dc016da9590149a423069cc38c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed qsslsocket_onDemandCertificates_{static,member}Rohan McGovern2012-06-282-4/+2
| | | | | | | | | | | | | | | | | | | | This test had been XFAILing since August 2011, but recently started to XPASS, possibly due to changes in the SSL setup on the tested host (qt.nokia.com). Removed QEXPECT_FAIL and replaced qt.nokia.com with codereview.qt-project.org as a host expected to have working SSL. (If SSL on the latter were broken, it would immediately be detected by any attempts at git over HTTPS.) SSL setup can be verified as working by: openssl s_client -CApath /etc/ssl/certs \ -connect codereview.qt-project.org:443 </dev/null Task-number: QTBUG-20983 Change-Id: I9b4146da6545ab4115d6308044b1d242dd52b7f9 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Implement RFC6265 test suiteShane Kearns2012-06-272-0/+2056
| | | | | | | | | | | | | Tests against the test data from the IETF working group https://github.com/abarth/http-state The test data is in the parser.json file, imported from that repository and with one patch applied to make the ordering0001 test case data match the raw files which are used by their python test server. Task-number: QTBUG-18920 Change-Id: I17c1a8d92aef2850907f009667c6574e4c8d0cdb Reviewed-by: Richard J. Moore <rich@kde.org>
* Use RFC6265 rules for cookie path & path matchingShane Kearns2012-06-271-13/+25
| | | | | | | | | | | | | | | Url encoding of paths is no longer used. This matches the current release behaviour of Firefox, Chrome and MSIE browsers. RFC6265 does not allow this type of encoding. This fixes remaining path test cases in the IETF test suite. Currently the path0027 test is passed by Firefox but failed by Chrome and MSIE, so there is a potential compatibility issue. However it is a corner case with a malformed cookie. Task-number: QTBUG-15794 Change-Id: I9b02bb5adc32d614f512d314d06f2c60894aa2b0 Reviewed-by: Richard J. Moore <rich@kde.org>
* QNetworkCookie: Use RFC6265 rules for parsing Set-CookieShane Kearns2012-06-271-3/+9
| | | | | | | | | | | | | | The ';' separator takes priority even inside a quoted string. Quotation marks have no special meaning, they are not parsed and regenerated anymore. This means it is not possible to include the ';' character inside a cookie value. Other characters are returned transparently, including [",\] Task-number: QTBUG-15794 Task-number: QTBUG-26002 Task-number: QTBUG-11641 Change-Id: I4eefef5c6ac7753d5a21c226169e264578521fe9 Reviewed-by: Richard J. Moore <rich@kde.org>
* Change invalid test case (two cookies separated by ,)Shane Kearns2012-06-271-2/+9
| | | | | | | | Two cookies in a single Set-Cookie header are no longer allowed. Check that this header is parsed according to RFC6265 rules instead Change-Id: Ice48bbe78a9886208f7d1186cf1d8c37f46f1252 Reviewed-by: Richard J. Moore <rich@kde.org>
* QNetworkRequest autotest: adapt to new cookie parsing (re. commas)Peter Hartmann2012-06-271-1/+1
| | | | | | | | | | | | | | Cookies cannot be separated by commas anymore, but are separated by new lines. See "Remove support for multiple cookies in one Set-Cookie header to follow RFC6265." Reviewed-by: Martin Petersson Task-number: QTBUG-21456 (cherry-picked from 5d809703aa2d2a08ae7e9610fd42025b081d3d0c) Change-Id: If7d1b4e58399a5d678495af6ff280409ba220e86 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove support for multiple cookies in one Set-Cookie header to follow RFC6265.Jocelyn Turcotte2012-06-271-39/+15
| | | | | | | | | | | | This also allows cookie values to contain commas to increase compatibility like most popular browsers do even though the RFC still reserves them for future uses. Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Task-number: QTBUG-21456 (cherry-picked from 8ba781b01e900148fec2e9d26485369b3295487f) Change-Id: Ib09ab2411dddf7f99de1c0c31680428b7412fc7e Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Handle fragmented responses on SOCKS5 control channelShane Kearns2012-06-211-19/+138
| | | | | | | | | | | | Server responses may arrive in more than one packet, though this is rare due to nagle algorithm. Also fixed IPv6 addresses being discarded from server responses, which was caught by the new autotest. Task-number: QTBUG-18564 Change-Id: I32d9e2978037fb3e1fff27b7e618b5da6d222f28 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Rewrite QNetworkReply downloadProgress autotestShane Kearns2012-06-141-54/+56
| | | | | | | | | | | The existing autotest was made invalid by the downloadProgress signal choking patch. Rewrote the autotest to download files from the test server with some rate limiting applied to ensure more than one signal is emitted. Change-Id: I6026bacdf356b4e1796b80f6983e5bdce0d1bfce Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* choke uploadProgress signalsShane Kearns2012-06-141-1/+4
| | | | | | | | | | | | | | | | | | The QNetworkReply::uploadProgress signal is intended for updating UI elements such as a progress bar. Limit the signal emissions to 10 per second to prevent overloading the UI with updates. As with the downloadProgress choke, this is implemented by dropping signals that occur within 100ms of the previous emission. The 100% signal is always emitted (bytesSent == bytesTotal) When the upload size is initially unknown, this behaviour is still provided by the upload device emitting a suitable readProgress signal when EOF is reached. Task-number: QTBUG-20449 Change-Id: I77e03c8a49109106e1c375ee00380293fd326b63 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fix namespace compilation on OSX.Toby Tomkins2012-06-141-1/+1
| | | | | Change-Id: Ib579ae298a5f894b8b02a5d56567870109bd29bd Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix QDnsLookup test again after public DNS servers changedThiago Macieira2012-06-141-1/+1
| | | | | | | | | gitorious.org's IP no longer resolves back to gitorious.org. This fix is temporary, again. Change-Id: I85b5fe1c5e603d23dd3226b843ef42165d4c417b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Partial fix for WebKit compilation on WindowsSimon Hausmann2012-06-133-0/+7
| | | | | | | | | | | | | | | | | | | | | | qdatetime.h uses std::min/max and on Windows windows.h (or some subsequent header file) may under certain circumstances define min/max as macros. The easiest way to prevent the windows header files from doing that is to define NOMINMAX in the place right before windows.h is included. The other way is to define min and max to min/max themselves to prevent windows.h from doing its evil thing. If a user of Qt (WebKit in this case) chooses the approach of defining min/max to themselves and then includes qdatetime.h, then a subsequent inclusion of windows.h doesn't work because qdatetime.h undefines min/max. We should not enforce the type of workaround needed, therefore this patch removes the workaround from qdatetime.h and requires user code that happens to include windows header files before qdatetime.h (seldom case) to choose either workaround. Change-Id: I7347eec7369491a065e894cff557004e069453d5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QIODevice::seek() return false for sequential files.Mitch Curtis2012-06-051-2/+2
| | | | | | | Task-number: QTBUG-18173 Change-Id: Ie3a96d3a6f60995b8ba7823153778869d0c2dc58 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Make tst_qabstractnetworkcache parallel-safeRohan McGovern2012-06-012-3/+5
| | | | | | | Use a unique QTemporaryDir instead of a fixed path for the test cache. Change-Id: Ib664033a509a6cefd7c323708f80ef595b202178 Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Make tst_qnetworkdiskcache parallel-safeRohan McGovern2012-05-312-26/+35
| | | | | | | | Use a QTemporaryDir for a unique test cache directory for each process, rather than a fixed path. Change-Id: I64df8422d01282bbc108e942947c1b55368bd941 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Set explicit testcase.timeout for slow testsRohan McGovern2012-05-293-0/+3
| | | | | | | | | | | | We'd like to decrease the default timeout for tests in the Qt Project CI so that we waste less time waiting for hanging tests. Tests which genuinely take a long time to run, such as these, should have their timeout explicitly set in their .pro file. Change-Id: I4fe6249e9efa764b230251d73a1115c24411e168 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
* Make tst_qnetworkreply parallel-safe.Rohan McGovern2012-05-292-2/+3
| | | | | | | | | Ensure we always use a unique filename when writing to test files. The test already contained code for this, but it was not applied in a couple of places. Change-Id: I1e29ee162c390e014688ab46e3658e2a463d203e Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Add CONFIG+=parallel_test to suspected parallel-safe tests.Rohan McGovern2012-05-2819-0/+19
| | | | | | | | | These tests have passed a parallel stress test on all three of Linux, Mac, Windows. Mark them with CONFIG+=parallel_test to allow CI to run them in parallel, saving time. Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* QAuthenticator - test NTLM SSO and normal paths separatelyShane Kearns2012-05-231-7/+17
| | | | | | | | | Single signon code path gets the NTLM responses from the system, so we can't predict the contents. Task-number: QTBUG-25851 Change-Id: Ia8aa1741ae5af9e48643331bf9a3768550a30166 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fixed unused function warning in qsslcertificate test.Mitch Curtis2012-05-221-2/+2
| | | | | Change-Id: I4d402e486a8ceb965d008056f5f1bcb227f6f40c Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fixed unused function warning in qsslkey test.Mitch Curtis2012-05-211-2/+2
| | | | | | | Change-Id: I5039e011f3c9b44ed1887424f11e4e146c3eb07f Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com> Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fallback to IPv4 when IPv6 is not present.Jonas M. Gastal2012-05-215-36/+57
| | | | | | | In tests when IPv6 is not present QSKIP IPv6 tests. Task-number: QTBUG-23660 Change-Id: I02abc7322d765a93cbf661e53c76257f03dca73e Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Change QSslCertificate::toText() to return a QString.Richard Moore2012-05-211-2/+2
| | | | | | | | | | A couple of people reviewing the toText() method (which is new in 5.0) have said that since the string returned is human readable it should be a QString not a QByteArray. This change follows their advice. Change-Id: Ibade9a24870805f7fbe2d299abeb9c6e964f0cf4 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* tst_QNetworkReply: enable the ioGetFromBuiltinHttp test.Martin Petersson2012-05-161-6/+5
| | | | | | | | | | This can be enabled again now. The sender transfer test is still not re-enabled since the test would take to long to run if sending enough data to overwhelm the reciever's kernel buffers. Change-Id: I4056fdca53ec8ebbcc53dfdc814d8bfdbc73f7ce Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* Add test case for link local TCP connectionsShane Kearns2012-05-151-0/+83
| | | | | | | | | The socket engines already implemented this, but it is a good idea to test it explicitly. Task-number: QTBUG-25634 Change-Id: Ife3fe09b0119ed435e4055523c553847739a09fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix sending UDP packets to link local addressesShane Kearns2012-05-111-0/+135
| | | | | | | | | | | | When the scope ID is not set, Mac and Windows will not transmit packets to link local addresses. This patch implements setting the scope in the native socket engines and adds a test case. (it was partially implemented already, though UDP specific code paths were missed in the unix engine) Task-number: QTBUG-25634 Change-Id: I23300bdc9856e38458078e913daaa59cd05a74b5 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* tst_QNetworkReply: fix backgroundRequestInterruption test.Martin Petersson2012-05-111-0/+3
| | | | | | | | After we have change the policy we should set the readbuffersize to unlimited again, so that we try to download all data. Change-Id: I1b9bdb6c2e5f408c920f6e6d7e85a39e4c18316b Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix a QSslSocket test expectation on ubuntu 11.10Shane Kearns2012-05-101-4/+8
| | | | | | | | | | Because SSL2 is disabled in ubuntu's openssl binaries, the SSL connection is expected to succeed rather than fail when the server side is using SSL3/TLS1.0. Used the OPENSSL_NO_SSL2 macro to decide this. Change-Id: I2c35aa5aa0c9432ae78000c81f70086bdc31843d Reviewed-by: Richard J. Moore <rich@kde.org>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtNetwork]Thiago Macieira2012-05-044-27/+27
| | | | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I94cc301ea75cc689bcb6e2d417120cf14e36808d Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Rename QAbstractSocket::PauseOnNotify -> PauseOnSslErrorsShane Kearns2012-05-041-1/+1
| | | | | | | | | | | | | | | Although we created an enum for pause modes to make 5.x binary compatible with 5.0, the enum value is not well named. In 5.1, we propose to add PauseOnProxyAuthentication to the enum. PauseOnNotify is not clear what it means, while PauseOnSslErrors is. Any new notification in a minor release would need a new enum value otherwise applications would get pauses they did not expect. Task-number: QTBUG-19032 Change-Id: I4dbb7467663b37ca7f0551d24a31bc013968bedc Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* troll.no changed its NS record configuration. Adapt.Thiago Macieira2012-05-031-1/+1
| | | | | | Change-Id: I62d778da67a463da765b6ad70774449560105d7d Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Optimise windows cert fetching and fix test case.Shane Kearns2012-05-031-2/+1
| | | | | | | | | | | | | If we're not going to verify the peer, or we know in advance that windows won't have a CA root then don't ask it to verify the certificate chain. The test case started failing in CI when the windows cert fetcher was integrated due to timing change. I've relaxed the timing requirement of the test to avoid it being unstable. Task-number: QTBUG-24827 Change-Id: I694f193f7d96962667f00aa01b9483b326e3e054 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* tst_qdnslookup: disabled broken testdataRohan McGovern2012-05-031-0/+4
| | | | | | | | The mentioned records for råkat.se cannot be resolved. Note these were marked with a FIXME in the first place. Change-Id: I4ea3bbb0aec8ca1b3487c44656b48a8715228886 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-025-23/+23
| | | | | | | | | | qVariantValue and qVariantCanConvert are Compatibility members, while in Qt4.8 they are marked as Qt 3 Support Members. qVariantFromValue and qVariantSetValue are Obsolete members. Change-Id: Ie8505cad1e0950e40c6f6710fde9f6fb2ac670fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove insignification from qsslsocket_onDemandCertificates_* testsJason McDonald2012-04-302-4/+0
| | | | | | | | These tests have been passing consistently since they started running on Windows in CI. Change-Id: I4505497afc477a7f4fbda0acc29987d0d0cf220a Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove insignification from qtcpserver test on Mac OS X.Jason McDonald2012-04-301-2/+0
| | | | | | | | This test has been passing consistently since starting to run in CI. Task-number: QTBUG-25445 Change-Id: Id024921b18ea4ef94ad2f47d9db2ccda3212eaaa Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove insignification of qsslsocket test on Windows and Mac.Jason McDonald2012-04-302-6/+3
| | | | | | | | | | | | The test has a single stable failure on both of these platforms. Mark the failure with QEXPECT_FAIL (that was already the case on Ubuntu 11.10) and re-enable the test. Note also the elimination of duplicate bug numbers. Task-number: QTBUG-24234 Change-Id: Ica11e7d1f3cd9487647127984fef7c75e0e764fe Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Wrap the non-ASCII testcases with QString::fromUtf8Thiago Macieira2012-04-271-5/+5
| | | | | | | And use QString::toUtf8() to recover the byte array original. Change-Id: Ic94de12e7ac67479e85a64a86f8467428b4d22ba Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Uncomment qnetworkproxyfactory autotestShane Kearns2012-04-261-1/+1
| | | | | | | | | It no longer requires hardcoded configuration, and it passes on linux, mac 10.6 and windows desktops Change-Id: Ibaa63520dade58ce13c23cf2aba3ddbc5be1c472 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>