summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/socket
Commit message (Collapse)AuthorAgeFilesLines
* Fallback to IPv4 when IPv6 is not present.Jonas M. Gastal2012-05-213-32/+55
| | | | | | | 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>
* 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>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtNetwork]Thiago Macieira2012-05-041-14/+14
| | | | | | | | | | | | 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>
* Don't use obsolete qVariantValue, qVariantCanConvert, etc.Debao Zhang2012-05-023-10/+10
| | | | | | | | | | 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 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>
* Using QLatin1String instead of QLatin1LiteralDebao Zhang2012-04-251-1/+1
| | | | | | | | QLatin1Literal is just a typedef of QLatin1String. Change-Id: If20ca225e57a7fb45a7775f0fc81aedb6da88c96 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Re-enable network tests on Mac OS.Jason McDonald2012-04-241-0/+2
| | | | | | | | | Switch on most of the tests (all but the bearer tests), marking the two known failures as insignificant tests. Change-Id: I17f228a938de1a23eddf897f494bfa4e54338dae Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove insignification of qsocks5socketengine on Ubuntu 11.10Jason McDonald2012-04-192-1/+10
| | | | | | | | | | | The test has one stable failure on CI, but that failure is not observed by all Ubuntu 11.10 users. Mark that failure with QEXPECT_FAIL when it is going to fail and re-enable the test, following the pattern established for the qtcpsocket test on this platform. Task-number: QTBUG-23380 Change-Id: Ic7546595f314c55ebd36957ada92978141a1c509 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Update task numbers for QUdpSocket autotest.Jason McDonald2012-04-181-1/+1
| | | | | | | | Reference tasks with detailed analysis of failures rather than generic task for blacklisted tests. Change-Id: Ibd0ed836ffb84fe9aa14488d43085316e666de21 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add bug numbers to insignificant_test markers.Jason McDonald2012-04-161-1/+1
| | | | | Change-Id: I4033ef0bd50a1be484503886b6bfda456da26675 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Put bug numbers on same line as insignificant_test markers.Jason McDonald2012-04-161-2/+1
| | | | | | | | This makes it easier to find insignificant tests that have no associated bug report. Change-Id: Ia71d59da062818d3860b0365d063e044705267fd Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix MSVC warnings in tests.Friedemann Kleint2012-04-021-2/+3
| | | | | | | | | - Unused variables - conversion truncations - Overflow in expressions like '-1 + sizeof()' Change-Id: Ibbd18497951e9e7e9dccaf596cb4e864b69ec02c Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix QTcpServer::listen() returning true when the port is in use on OS X.Robin Burchell2012-04-021-0/+22
| | | | | | | | | | | | | | | | | | | | Way back in the mists of time, someone added SO_REUSEPORT to socket binding, which was great, because otherwise it meant that multiple UDP sockets couldn't share the same port on OS X (as platforms with SO_REUSEPORT apparently don't support rebinding with SO_REUSEADDR). However: SO_REUSEPORT also means that *any* bind on a port will succeed, which is most definitely not wanted in the case of TCP sockets, so check the socket type before performing the actual bind. Also test that multiple listens don't take effect. Change-Id: I2f8d450bcfb8a7f3abd8918a4e789a850281dd13 Done-with: Thiago Macieira Done-with: Shane Kearns Task-number: QTBUG-6305 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix multicast join/leave when binding to QHostAddress::Any.Robin Burchell2012-04-021-0/+3
| | | | | | | | | | | | | | | | | | On OS X and Windows, this was not working, because the socket was being bound in v6 mode (due to ::Any being for dual mode), but the address passed was a v4 address, meaning it took the wrong codepath. Linux, strangely, apparently works anyway. This is fixable in OS X (by using the v6 join path when bound in v6/dual mode), but the same fix doesn't work on Windows, failing with WSAEADDRNOTAVAIL. Don't allow this behaviour, and provide a sane error message telling the user what to do instead. Done-with: Shane Kearns Task-number: QTBUG-25047 Change-Id: Iaf5bbee82e13ac92e11b60c558f5af9ce26f474b Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Fix some compiler warnings in tests.Friedemann Kleint2012-03-271-1/+1
| | | | | | | | - Unused variables - Deprecated conversion from const char * to char *. Change-Id: Iea0b9c4613ea74cead6d95ba12ad1028f531cbff Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Allow autobound UDP sockets to send to IPv4 and IPv6Shane Kearns2012-03-221-0/+79
| | | | | | | | | | | | | | | | When writeDatagram is called without first binding the UDP socket, then bind it as QHostAddress::Any. This allows the same socket to be used to sent to both IPv4 and IPv6 destination addresses. Allowing the OS to autobind the socket inside sendTo() may result in a single protocol socket. Task-number: QTBUG-5275 Change-Id: I2b76507e8a8a38369c6eafb61ce4191d1d6cc930 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Mark unstable windows network testsShane Kearns2012-03-081-0/+9
| | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-041-2/+2
|\ | | | | | | | | | | | | | | | | | | 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-011-2/+2
| | | | | | | | | | Change-Id: I6c91a613007043d0f26ac11e98353a0b9ce646ae Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | 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>
* 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-231-0/+1
| | | | | 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-211-5/+5
| | | | | | | | 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>
* 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>
* Windows: Fixed helper process finding in network testsMiikka Heikkinen2012-02-152-6/+26
| | | | | | | | | | | | | | | | | | | | 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>
* 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>
* 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>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-3017-17/+17
| | | | | | | | | | 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>
* Update contact information in license headers.Jason McDonald2012-01-2317-17/+17
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@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>
* Fixed build break when bearer is disabled.Xizhi Zhu2012-01-161-0/+2
| | | | | Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
* Fixes examples/tests to use qinptr in QTcpServer::incomingConnection.Jonas M. Gastal2012-01-132-2/+2
| | | | | | | | 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>
* 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>
* Removing QHttp class, its tests and its usage in examples.Jonas M. Gastal2012-01-062-2/+0
| | | | | | Task-number: QTBUG-22750 Change-Id: I161fad772bfb26797e6ee9d69da925b6747c371f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make socket descriptors qintptr.Jonas M. Gastal2012-01-054-13/+13
| | | | | | | | | | 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-0517-17/+17
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* tests: use contains(QT_CONFIG,private_tests) consistentlySergio Ahumada2012-01-021-5/+4
| | | | | | | | | | | | | | 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>
* 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>
* 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-066-16/+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 sanity check of network test serverJason McDonald2011-11-286-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>