summaryrefslogtreecommitdiffstats
path: root/tests/auto/network
Commit message (Collapse)AuthorAgeFilesLines
* Fixed build break when bearer is disabled.Xizhi Zhu2012-01-168-4/+39
| | | | | Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Modify SSL Socket test exceptions on Ubuntu 11.10 x64.Toby Tomkins2012-01-161-20/+5
| | | | | | | | | | | Modified exceptions as most tests are now passing correctly. Three exceptions still remain, two serverSideMode tests (ssl3-any, tls1.0-any) and a verifyMode test. Task-number: QTBUG-23575 Change-Id: I847e8c2e3484050b8d07ede9aec955c30f7ef5a1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fixed failure of tst_qhostinfo since ~15 Jan 2012Rohan McGovern2012-01-161-1/+1
| | | | | | | | | | | | This test hardcodes IP address / hostname pairs to be used for forward and reverse lookups. The reverse DNS entry for 62.70.27.69 has recently disappeared. Replace it with an IP / name pair which is (hopefully) much less likely to disappear. Change-Id: I03f589e1c0f4bde0b1a14e94b3c1047eeb81246e Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fixes examples/tests to use qinptr in QTcpServer::incomingConnection.Jonas M. Gastal2012-01-134-9/+9
| | | | | | | | This is a fix for problems introduced by bf7f170. Change-Id: If5dd8e031ef2efea578b3efb188c2e950e1ba41a Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Cleaning up header includes.Jonas M. Gastal2012-01-132-0/+2
| | | | | | | | | | QNetworkCookie doesn't need to know about QNetworkCookieJar and for QNetworkCookieJar header a forward declared QNetworkCookie is enough. Change-Id: I21145ce0f67a0a6bd68a46a5e757f82105cdf520 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Make QFtp private.Jonas M. Gastal2012-01-123-24/+23
| | | | | | | | | All references to QFtp in documentation have been removed, QFtp's documentaiton was marked internal. The QFtp example was removed. Task-number: QTBUG-23199 Change-Id: Ifff83cac069fb350e8ebeae63e605850e65c0c30 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Flag test as expected failure for Ubuntu 11.10 x64.Toby Tomkins2012-01-122-0/+4
| | | | | Change-Id: I05ff434581f48d4d3ede7ecb59208821a2ab3e7d Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* SSL Socket withoutproxy failures on Ubuntu 11.10 x64.Toby Tomkins2012-01-122-0/+24
| | | | | | | | | | | | Numerous failures in the qsslsocket autotest suite relating to connections without using proxies. Some have been skipped due to the number of failures, other more specific tests have been set to expect a failure. Task-number: QTBUG-23575 Change-Id: I35fccc65bcab303646617a57a33f5aa7f7a4323f Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove unused QT_NO_TEXTSTREAM.David Faure2012-01-111-2/+0
| | | | | | | | It was checked in a few places, but it didn't actually remove QTextStream, so it was pretty useless. Change-Id: I8eaf28893cd6c7acbe1c0b69d58de90742aee755 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Tests: Remove duplicate QTRY_VERIFY/QTRY_COMPARE macros in bearer.Friedemann Kleint2012-01-104-52/+42
| | | | | | | | | | Introduce QTRY_VERIFY_WITH_TIMEOUT and QTRY_COMPARE_WITH_TIMEOUT to be able to specify a timeout value. Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Change-Id: Iaeaa4938eb14f2c431537055f626510cba183ce3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove the unused QTRY_COMPARE macro from bearer auto tests.Xizhi Zhu2012-01-101-15/+0
| | | | | | | | The custom QTRY_VERIFY macro is needed since the one provided by testlib does not support custom timeout. Change-Id: I12bbc5efcb16c4f53514ad738d6115d217a55b05 Reviewed-by: Alex <alex.blasche@nokia.com>
* Remove ICD plugin for bearer.Xizhi Zhu2012-01-106-371/+1
| | | | | | | It's only used by Maemo and Harmattan, thus not needed in Qt5. Change-Id: I8638f4fc63637be88d1aa584cde7e3a4116f2de6 Reviewed-by: Alex <alex.blasche@nokia.com>
* Avoid using check as an identifier.Stephen Kelly2012-01-101-6/+6
| | | | | | | Avoids conflict with Mac OS. Change-Id: I64856a64808dcd481f6075eb4f3a7cc19950bad3 Reviewed-by: hjk <qthjk@ovi.com>
* Removing QHttp class, its tests and its usage in examples.Jonas M. Gastal2012-01-0616-5328/+0
| | | | | | Task-number: QTBUG-22750 Change-Id: I161fad772bfb26797e6ee9d69da925b6747c371f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add regression test for QTBUG-22660Sami Rosendahl2012-01-061-0/+23
| | | | | | | | | | QHttpNetworkReply crashed in Qt4.7 and 4.8 if a HTTP server responded with gzip-encoded empty content without defining Content-Length in the response header. This commit adds the test for the problem as a regression test to Qt5. Change-Id: Iddfb970a31d92a66fd1dd524811cf54bb06e5157 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Make socket descriptors qintptr.Jonas M. Gastal2012-01-055-14/+14
| | | | | | | | | | Windows x64 uses 64 bits integer for sockets, to ensure compatibility we should use ptr sized integers for our socket descriptors. Task-number: QTBUG-19004 Change-Id: I4b56023874a4f1bad107c66c054fecfedde33d88 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-0552-52/+52
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Use true and false in preference to TRUE and FALSE in tests.Jason McDonald2012-01-032-77/+77
| | | | | | | | | Use the C++ boolean constants true and false instead of the C macros TRUE and FALSE (which are actually integers), and use QVERIFY instead of QCOMPARE for verifying simple boolean expressions. Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* tests: use contains(QT_CONFIG,private_tests) consistentlySergio Ahumada2012-01-022-5/+9
| | | | | | | | | | | | | | These tests used requires(contains(QT_CONFIG,private_tests)) in their .pro file, but did not subtract themselves from their parent project SUBDIRS when private_tests weren't enabled. In the best case, this wastes a little time as qmake iterates over these projects which won't be built. In some worse esoteric cases, this may break compilation or packaging. Change-Id: If36b1b8f69c3509128786fec67899ae18ffaa2bc Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Flag udpTest as insignificant, fails on Ubuntu 11.10 x64.Toby Tomkins2011-12-301-0/+3
| | | | | | | | | | This testcase fails on the Ubuntu 11.10 x64 platform, add flag to .pro file so test is ignored on this platform. Task-number: QTBUG-23380 Change-Id: I51831df8c8e9bfcf63d3689e37552ca1a62691cd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove mention of Trolltech in QHttp autotest.Jason McDonald2011-12-283-4/+4
| | | | | | | | | | The data file named "trolltech" has nothing specific to Trolltech in its contents. Rename it to "testhtml". The lack of a file extension is intentional. Task-number: QTBUG-19653 Change-Id: Idc5c5f4ffa447151e47f66ff7364f0fa8753a699 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* network auto tests: add QNetworkReply test for pipeliningPeter Hartmann2011-12-251-0/+39
| | | | | | | | | Reviewed-by: Markus Goetz Task-number: QTBUG-21369 (cherry picked from commit a32bfdef6d6b45c916f143dcf8495a2e102c3eec) Change-Id: Iecde23c56f128008c5172675601928d83180358a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix http authentication to a different realm on the same serverShane Kearns2011-12-221-0/+33
| | | | | | | | | | This is a regression caused by the NTLMv2 authentication patch. I have manually tested NTLMv2 authentication against MS IIS and reverting these two lines does not break it. Task-number: QT-5209 Change-Id: I64159cbe468e1a7f834f8726fd0c9d4ab4c54b38 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Test case for QTBUG-22875Shane Kearns2011-12-221-1/+188
| | | | | | | | | | | | | Test the authentication cache works properly with "cancelled dialogs" or if the user enters username/password incorrectly. Expected behaviour is based on web browsers: If cancelled, current request fails, and prompt again the next time. If wrong password is given, prompt again and retry the current request. If bad credentials are in the cache, prompt again Task-number: QTBUG-22875 Change-Id: Ic02ccac8dbeb3f2580ca4ffe47d0773982c4ab25 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fix QNetworkReply test cases that use the MiniHttpServer on windowsShane Kearns2011-12-191-1/+1
| | | | | | | | | | | | | The "happy eyeballs" connection code means that IPv4 and IPv6 connections are both attempted for a http request. For a normal http server, this is no problem, but the MiniHttpServer in the test code is very simplistic and cannot cope with more than one client connected at the same time. On windows this causes all these tests to fail with timeouts. Changed the MiniHttpServer to listen on IPv4 only instead of Any address. Change-Id: I81e249997d894d266001da474a351b1f5642599e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* fix QMutex warning in tst_QLocalSocket::threadedConnectionJoerg Bornemann2011-12-151-0/+1
| | | | | Change-Id: I5728af1944e44bd976e51d4f0c0a923deacbeea0 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove QtWidgets dependency from QTcpSocket autotestShane Kearns2011-12-093-33/+12
| | | | | | | | | | | | | | QMessageBox was being used to test nested event loops. This has been changed to use QEventLoop directly. Also, there was an unnecessary use of QPushButton to trigger a test case, which has been removed. As a result, 3 test cases can be run on VXWORKS, and one more test case on Windows that were previously skipped. Change-Id: Ic65ed441cd37d242f89df3ef3b8638a1458d9cf3 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix unstable test caseShane Kearns2011-12-092-2/+1
| | | | | | | | | | | | | tst_QTcpSocket::disconnectWhileLookingUp required the host lookup + connect + disconnect procedure to complete in <50ms, which is not always true. When disconnecting (rather than aborting with close()), wait for the disconnection to complete with a timeout of 5 seconds. Task-number: QTBUG-21043 Change-Id: I3b59abf9a8eb2c6d99416e1a8ec6b528885b656e Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Fix failing setSocketDescriptor test in QTcpSocketShane Kearns2011-12-091-0/+1
| | | | | | | | | | setSocketDescriptor fails because socket is in the wrong state. This is timing dependent, if qt-test-server is still in the DNS cache then the test failed. - clear the DNS cache to avoid the host lookup state being skipped. Change-Id: If159d514b1aa9b62a4834f6352d5e7b0a00a5724 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Check we're connected before startClientEncryption()Richard Moore2011-12-071-0/+13
| | | | | | | | | The docs say this is required, but we don't check it and instead segfault right now. Change-Id: I825b00a312a481c5383af127333c0c4698188348 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Skip untestable interfaces in QTcpSocket::bind autotestShane Kearns2011-12-061-1/+5
| | | | | | | | | | | | | | | bind() test failed if there is an autoconfigured IPv4 address. e.g. bluetooth adaptor that is not attached to a network. Or WLAN adaptor in peer-peer mode. - solved by skipping the autoconfigured IPv4 addresses in the same way as IPv6 addresses are already skipped bind() test fails for proxy - skipped, QTBUG-22964 created Change-Id: I9a799ae8db421783f474e97cf876d6e265516397 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-0613-34/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix QTcpServer::serverAddress() for dual stack socketsShane Kearns2011-12-012-1/+39
| | | | | | | | | | When listening on QHostAddress::Any, serverAddress() should return QHostAddress::Any too, assuming that setting the socket options was successful. Task-number: QTBUG-22899 Change-Id: I50a9ff1b4ad0c1c1905e2952c595d7068df2627d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QHostAddress::operator==(QHostAddress::SpecialAddress)Shane Kearns2011-11-301-0/+4
| | | | | | | | | QHostAddress(QHostAddress::Any) was not equal to QHostAddress::Any because only one of the operator== overloads was handling this. Task-number: QTBUG-22898 Change-Id: Ifd36947a50e8c36362b4e850fd8d5105ee0925ff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make the default ssloptions testable.Richard Moore2011-11-291-0/+5
| | | | | | | | | Centralise the specification of the default ssloptions to make the code clearer and more testable. Change-Id: I4f4bae72736dd063ee4cd64c6375e82d0600a105 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix sanity check of network test serverJason McDonald2011-11-2816-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of Qt's autotests depend on access to a test server. For each test that used the test server, tests/auto/network-settings.h created a global object to verify at startup that host lookups to the test server will succeed (and abort the test otherwise). There are two problems with that approach: First, the sanity check happens before main(), and thus before the test framework has started logging test results. This means that if the sanity check aborts the test, the failure message will not be visible in the test output if logging to a file or will cause the output to be malformed if logging to the console in XML format. Second, since Qt 4.7, the host lookup uses a class that connects to the QCoreApplication instance, which doesn't exist before main(), and this caused all tests that included network-settings.h to output an error message from QObject::connect() at the beginning of the test. Both of these problems are solved by removing the global object from network-settings.h and instead performing the sanity check in the initTestCase() function of each test. Task-number: QTBUG-22876 Change-Id: Id49c1826906327bf571686cc11527f0265e5af44 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* tst_qsslsocket: improve failure messageRohan McGovern2011-11-211-1/+1
| | | | | | | | | Cast enum to int so that we get the actual and expected values in the failure message, rather than merely "Compared values are not the same". Change-Id: Idc20e050c2e8a07d70f839c0a45044b070c0900e Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* tst_qsslsocket: don't run SSLv2 tests when SSLv2 has been disabledRohan McGovern2011-11-211-0/+16
| | | | | | | | | SSLv2 may be disabled in openssl at compile time. If so, do not attempt to test it. Change-Id: I189c8fde5b5dc8e739d54cc1adde1d3e3e217391 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Don't depend on moc to disable test functions.Jason McDonald2011-11-184-45/+40
| | | | | | | | | | | | | | | | | | | | | The moc tool is not aware of all defines (particularly those that are compiler builtins) and does not correctly evaluate others that depend on compiler builtins, such as Q_OS_FOO. This commit reverts parts of the following commits, but is not a complete fix as there were many instances of this problem in the tests prior to those commits: 924d810dbdcd5b5b0fa860922b2487ea9062d002 8aaff6751038b88d17e23be6fcee945771297c5b 338d3f11973412047c2c9cd41cbd0c961d738ef3 a55034062ba2bf73a9f1ed3d9cf31745b38149e3 253497b7446c7d723aa3bdd7152e25d6852f2604 7cfad460c56319ba89c4a3a0bbcb2e54ab1cdbc6 9d2ff58f3642828e494e7e9b2df7dbb8e2cd408f 0cf6baa2d61ebaad2a2a0530c37f27e719b68f4b Change-Id: I947d797fe3ec76139ba1b55561cea569895662c5 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Improve the testability of QSslOptions.Richard Moore2011-11-171-0/+43
| | | | | | | | | | The handling of QSslOptions is complicated not only by the subject, but also by the fact that some of the openssl directives are negatives. This commit tries to separate the inherent complexity from the complexity of the api by allowing us to test them independently. Change-Id: Ieb9386c69dd9b0b49dc42e26b2878a301f26ded1 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* SSL namespace: rename TlsV1 to TlsV1_0Peter Hartmann2011-11-161-17/+17
| | | | | | | | | | | | This is a source-incompatible change. TlsV1 is ambiguous; what is actually meant is TLS version 1.0. There are also TLS versions 1.1 and 1.2; we might want to add options for these once OpenSSL supports them (apparently they will be with OpenSSL version 1.0.1). Change-Id: I940d020b181b5fa528788ef0c3c47e8ef873796a Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Always use the hex format for certificate serial numbers.Richard Moore2011-11-151-1/+1
| | | | | | | | | In Qt 4.x the serial number is reported by a mixture of the hex value and the number, The hex is what is used by other tools, and we should do the same. Change-Id: Ia0361d43fb5b920d053c95e932e0c8a012436e5e Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Deprecate QSslCertificate::isValid() replace with isBlacklisted()Richard Moore2011-11-141-4/+4
| | | | | | | | | | | Currently isValid wrongly gives the impression it checks a certificate for validity - it doesn't. It merely checks if the certificate dates are valid and if the certificate is blacklisted. Since it's already easy for users to check the dates, let's just give them access to the ability to check for blacklisting. Change-Id: I25be3bde6a01063034702a9574b28469bf4882cd Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* QNAM: Fix authentication cache when the password is in the URLOlivier Goffart2011-11-081-5/+83
| | | | | | | | | | | | | | | Two problems: - The signal cacheCredidentials was not connected in the synchronous case while it must be connected. (Regression when the threaded http was merged) - We cannot cache the credidentials when we proceed the url because at that point, we do not know the realm (this basically reverts 9bc5a32b875b812c3a706034c8c27614f86bd138) Task-number: QTBUG-18411 Change-Id: I8ea11fa23db4314c3f17ed06d2d7f9ee934ccdba Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* SSL certificate extensions: add unit testsRichard Moore2011-11-061-0/+89
| | | | | | | | Added tests for each of the supported extensions, and also for the handling of unknown ones. Change-Id: I29e0a5c1a411f41c2a554293662a33b56f205c00 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Moved tests into network/ssl/Jo Asplin2011-11-025-2/+513
| | | | | | | | | | This commit moves qsslsocket_onDemandCertificates_member and qsslsocket_onDemandCertificates_static from tests/auto/ to tests/auto/network/ssl/. Change-Id: I1593e113016ce7bb7dffbee82f1196275784d0ac Reviewed-by: Holger Ihrig <holger.ihrig@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Remove remains of qpa in tests.Friedemann Kleint2011-11-011-1/+1
| | | | | | | Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Change-Id: I41aed5290df5aebeb30ebf5d2796aca6c65980d1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Move support for socket binding from QUdpSocket upstream to QAbstractSocket.Robin Burchell2011-10-311-0/+61
| | | | | | | | | This should be API-compatible with Qt 4, but is not ABI-compatible, due to removing the enum from QUdpSocket. Task-number: QTBUG-121 Change-Id: I967968c6cb6f96d3ab1d6300eadd5bde6154b300 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove debug code from QLocalSocket autotest.Jason McDonald2011-10-311-7/+1
| | | | | | | | | Any test diagnostics that are useful should be part of the regular test output, as the CI system cannot switch on commented-out code when there is a test failure. Change-Id: Ie44b6ea8dd496857ea264f730148d3dc4f5c8324 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Doc: Fixing typoSergio Ahumada2011-10-261-2/+2
| | | | | | | Fix typos I was able to find in `tests/auto' directory. Change-Id: Id0bfcc18301381ac8b1ca8d5af17bd926e5913d4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>