Adds docker support and makes it no longer skip the whole test
if there is no docker or network server.
Pick-to: 6.2 6.3
Change-Id: Ie98496df338a804d5c9842cce372e3410fdf9990
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Android uses its own implementation of QNetworkProxyFactory, so the
test of a generic implementation will never be working there. The
"http_proxy" environment variable is simply ignored in Android's
implementation.
Fixes: QTBUG-87385
Pick-to: 6.3 6.2
Change-Id: I3c24e3481b70872d332310aa86c68adad9c2b7e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
To enable using `ninja tst_qlocalsocket_check` and have the
helper (re)built as part of the dependencies.
Pick-to: 6.3 6.2
Change-Id: I8703c4202a97606991d1cffe0d0f8e909a51f12f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously the blacklisting file format only worked with slot:data or
plain slot names for the items to blacklist. However, tests with
global data report themselves with the global data-row tag in the same
way as function-specific ones do; and tests which have both join the
two as slot(global:data) in the test output name, so the reader is apt
to mistake global:data for a data tag. In any case, it is potentially
desirable to be able to blacklist a function with either or both of
global and local data-row tags specified. Add support for that and
remove a blacklisting that was only needed due to the lack of this
support.
For now, make the new parameter to checkBlackLists() optional, so
that qtdeclarative's qmltest framework can adapt to this change.
Fixes: QTBUG-100870
Change-Id: I9125811ebdab75d3fb462ba8b60561f003426502
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
pthread_yield() is a non-posix extension and was deprecated for a long time.
It's been removed recently at least from Fedora 35. Use sched_yield() instead.
Change-Id: Iae47fa09cc89005aa466446149be87e1b673c074
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
And remove their uses.
[ChangeLog][QtCore][Deprecation Notice] Deprecated QString::count()
and QByteArray::count() that take no parameters, to avoid confusion
with the algorithm overloads of the same name. They can be replaced
by size() or length() methods.
Change-Id: I6541e3235ab58cf750d89568d66d3b1d9bbd4a04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If a test crashes it might leave local sockets, causing test failures
on subsequent runs due to the socket already being "in use".
Pick-to: 6.3
Change-Id: Ie1107c414f4819026907071c7b8281b2e27b8541
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
[ChangeLog][Network][QNetworkCookieJar] It is possible to use
system's copy of publicsuffix database when it is available.
This behavior is enabled by default on Linux and can be
controlled using new command line switches -system-publicsuffix,
-qt-publicsuffix, -no-publicsuffix, and -publicsuffix=all.
Fixes: QTBUG-95889
Change-Id: I911e1a13c1422cdc35851953309fff064e7c5f26
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Without features getifaddrs and ipv6ifname we cannot
get correct IPV6 information for interfaces.
Pick-to: 6.2 6.3
Change-Id: I7f8c4e68d345160d218fde8db640440f3324014e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This format will be changed by the next commit. Also it is an
implimentation detail that can be changed at any time.
Task-number: QTBUG-95889
Change-Id: I00b1133078f1035e03e2cd6fae28192de54d2154
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Currently test relies solely for external test server. This makes it
not possible to run test successfully with environment where docker is
used.
Pick-to: 6.2 6.3
Change-Id: Ie2974a0e2fec9b16d9d023730b76fa2a32f77e65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
As QNX claims to support abstract Unix-domain sockets, its getsockname
always returns for socket that has not been bound to local name
address_len of sun_path as maximum length (106) even when it does not
contain valid address.
https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/u/unix_proto.html
Pick-to: 6.2 6.3
Change-Id: I0f0f5c05611c8db6af35377dde16450f58c83c56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The redirect handling for http2 was a little simple. E.g. not handling
relative URLs.
Fix this using the redirect response parsing function which the http1
protocol handler already uses.
Fixes: QTBUG-100651
Pick-to: 6.3 6.2 5.15
Change-Id: Ic0cec4cacc92707e7a7fde1f4665f80995a6057e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Moved to after the header is actually written, not just generated.
For requests with data (put/post) we may have to wait for a callback
before the data to write is available. Since we then delay writing the
header as well it would be disingenuous to emit requestSent().
Pick-to: 6.3
Change-Id: I76c2d40ca48faaa1f6730ce8b3d5a8a4c3156f8f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It only stores one layer of state, and pausing twice in a row will just
overwrite the previous state. This doesn't happen often but can happen,
especially on Windows if a certificate needs to be looked up in the system
certificate stores (socket gets paused) and then a recoverable error
occurs in QNAM (socket gets paused again).
Fixes: QTBUG-100362
Fixes: QTBUG-63196
Fixes: QTBUG-98476
Pick-to: 6.3 6.2 5.15
Change-Id: Ie524c48e11b6fa8010b78cc1bf3931efe2ce3351
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
CI tests for QNX are run in QEMU which does not have enough RAM
to run this test successfully.
Pick-to: 6.2 6.3
Change-Id: Idab3e8b6a1e0ae3eddf5aedb82e6784a74ae9a3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Task-number: QTBUG-100362
Change-Id: Ib09aec5ea03867163d476a2c92562bc949fc1b1a
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
From the API review.
Pick-to: 6.3
Change-Id: Ic05737db79327e7811fcd974a70914b837e06601
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QNetworkHeadersPrivate::toHttpDate() used a custom format to output a
date-time; the format supplied GMT as suffix, but neglected to convert
the date-time to UTC, so local-time was formatted as if it were UTC,
regardless of its actual offset from it. Fixing this (by the obvious
toUTC() call) broke formatting when the supplied header value was a
QDate, since it's packaged as a QVariant and QVariant's conversion of
QDate to QDateTime uses local time's (not UTC's) start of day. So fix
headerValue() to separate QDate and QDateTime cases and use
startOfDay(Qt::UTC) to get the right start of the day. Added tests for
non-UTC date-times appearing correctly in HTTP headers.
Fixes: QTBUG-80666
Pick-to: 6.3 6.2 6.2.3 5.15
Change-Id: I2792bce14a07be025cf551b0594630260c112269
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Some lines in tests had to be updated because they lost the implicit
conversion from char* to QString.
Change-Id: I95af5859ced95b9ca974205398e38c0bd4395652
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
At some point we decided to support a custom set of ciphersuites specified
by QSslConfiguration (which if you ask me was never a good idea). The law
of unforseen consequiences bit us again: since we now give a set of ciphesuites
to QSslConfiguration and set ciphesuites from the configuration a socket has,
we are limited by the ciphersuites we know about at the moment of 'coding'.
Meaning if an SDK was updated and CipherSuite.h later adds more ciphersuites,
we miss them and 'don't support them', while we ... actually do.
This patch tries to add some more ciphersuites introduced in TLS 1.3 (interesting,
SecureTransport does not support TLS 1.3, but TLS 1.3 suites can be used in TLS
1.2 session).
Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-99368
Change-Id: I439b63845c4893e5621cffaf3bcaf62e2b643c74
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This test case fails on qemux86_64-webos-linux environment and based
on comment on the test case, it probably cannot be expected to pass on
webOS.
Fixes: QTQAINFRA-4717
Change-Id: Ifb34b0c85da2d180a59529791d1109185fef2665
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
[ChangeLog][QtNetwork][QNetworkRequest] Added
QNetworkRequest::Http2CleartextAllowedAttribute which controls whether
HTTP/2 cleartext (h2c) is allowed or not. The default is false. This
replaces the QT_NETWORK_H2C_ALLOWED environment variable.
Task-number: QTBUG-98642
Change-Id: I43ae1cc671788f6d2559cd316f6667b412c8e75e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
And since it's relatively unlikely to be used, just leave it
behind a environment variable for now.
[ChangeLog][QtNetwork][Potentially Source-Incompatible] Support for
clear-text http/2 was disabled due to incompatibility with certain
servers. If you were relying on this feature you must re-enable it by
setting the QT_NETWORK_ALLOW_H2C environment variable. For a later
version of Qt it will get a dedicated attribute.
Pick-to: 6.2
Task-number: QTBUG-98642
Change-Id: Id3e360726e285b3128e3e3f4bce9440404c9ad6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Which is anything other than MD5
Pick-to: 6.2 5.15
Fixes: QTBUG-98280
Change-Id: Ifbf143f233ee5602fed1594e3316e6b2adec1461
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We have some special handling in qt_windows.h,
use it instead of the original windows.h
Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The header for QTestEventLoop hadn't been included.
Pick-to: 6.2
Change-Id: Ife3418d1634c030c421c2aa55469f5a099386d4b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This may be a useful factor in deciding whether or not you should
perform communications over the network which are not purely essential.
For example, if you have a logging mechanism you can delay uploading
them until you are no longer on a metered network.
Task-number: QTBUG-91024
Change-Id: I19d32f031a3893512dc440914133678004987fb1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Which just returns all the supported features
Change-Id: I8c3996b00a6ebb114bdbc9db3085a0e27fc8fa79
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Previously, when deciding where the actual data is, Frame was calling
padding() to test if offset is needed. A curious case with a DATA frame
containing compressed body and having 'PADDED' flag set with a padding
equal to ... 0, ended in a decompression error (and assert in 6.2 code).
Pick-to: 6.2 5.15
Fixes: QTBUG-97179
Change-Id: I9341a4d68510aa4c26f4972afdcd09a530d5a367
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The new public API returns and notifies changes to the currently active
transport medium for the application. And there's a new private API to
report it, with backends to follow.
Task-number: QTBUG-91023
Change-Id: I527985f9dabcd7bc4a32f36597e21bc4ab664c4e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
After calling close(), the socket can enter 'Closing' state, in which
we try to write buffered data before disconnecting. As the device is
already closed, we must disable any pipe reader activity and clear the
read buffer.
Change-Id: I8994df32bf324325d54dd36cbe1a1ee3f08022d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To allow reading from a slot connected to the aboutToClose() signal,
we should call QIODevice::close() just before closing the inner device.
This patch amends 21f3ff65b8.
Pick-to: 6.2
Change-Id: Ic8cd00497e1bdf923b980c26e9ca874b77e82f89
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The docs (10 lines above) say it will find the backend case
insensitively. Thus the comparison should also be case-insensitive.
Pick-to: 6.2
Change-Id: I65901ed81b7d8bdfcf76f5b6c7b40efe63245503
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- process environment/DNS are OFF for INTEGRITY
Task-number: QTBUG-96176
Pick-to: 6.2
Change-Id: I189a97f88c96a428586c31a66b8d250e04482900
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
To match the Unix behavior, we should emit errorOccurred() signal and
close the channel if the write operation fails.
Change-Id: Iac3acb18dbbfe6e7e8afb2555d9adaff1fe98d0f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In a blocking application, receiving the results of write operations
must be synchronized with the waitFor...() functions. But, clearing
the buffer in another thread can cause the code
localsocket.write(...);
QVERIFY(localsocket.bytesToWrite() > 0);
to fail unexpectedly, if the socket has been disconnected between
the calls.
So, defer resetting the buffer until checkForWrite() is called.
Change-Id: I8c21036aab6a4c56d02c0d9a18d4bbce52d724f4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The test used to hang on waitForRead(), sometimes, which underneath
involve a poll()+read() syscall pair.
When this happened, the IMAP data came together with the proxy data on a
previous poll()+read() call and the proxy code had already consumed it.
We now wait for data only if data is not already available.
Fixes: QTBUG-96345
Pick-to: 6.2
Change-Id: I084f5d1268a5091ea614fcec91c8d356dcb90d9f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The unversioned libcrypto.dylib that's shipped with macOS 10.15 will
result in a crash if loaded, with a message saying that the unversioned
library should not be loaded, as it doesn't provide a stable ABI.
Task-number: QTBUG-95249
Pick-to: 6.2 5.15
Change-Id: I49325e5d675155e90840cc93623549f725bc77b4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The h2 server is running in a separate thread, so while the previous
test was finished and the server was deleted, it could still emit
and have a queued emission in-flight which would be picked up by
the next running test.
Pick-to: 6.2 6.1 5.15
Change-Id: I26b1bc711df7473032d6078f35f8aca37c40137e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
There were several issues with the socket state checking when the pipe
reader is not running:
- the number of object handles in the WaitForMultipleObjectsEx()
call might have been zero;
- a call to the waitForDisconnected(-1) might have hung;
- we did not perform a loop iteration for the waitFor...(0) calls,
so disconnect detection was unreliable.
These issues are related to the same code, so they don't seem to be
addressable separately.
Change-Id: I3bca872bb4191e6a7d38a693d81f7981af7fe145
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
There's not much context to the URLs being printed, so remove the
message. And suppress the message coming from the MiniHttpServer
Change-Id: Ie2025ac717657ed0f2f0163bd0af22e12a49b30f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The insertions are sorted by when they expire. So, we test the various
orders to insert entries.
Fixes: QTBUG-95959
Change-Id: I1e8d7f4c77dce5eae3d4bfa5101f296c3eea1961
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Remove SRCDIR defines from tests that don't use them. There is a
standard define called QT_TESTCASE_SOURCEDIR that is available to all
tests and serves the same purpose.
Pick-to: 6.2
Change-Id: I2aa237739c011495e31641cca525dc0eeef3c870
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>