qtconnectivity/tests/auto
Juha Vuolle 336bd4ff9e Close socket descriptor when QBluetoothSocketBluez is destroyed
There are two private QBluetoothSocket backends on Linux:
- QBluetoothSocketBluez is native linux socket implementation
  It is always used by the linux QBluetoothServer, and by
  QBluetoothSocket if Bluez version is < 5.46
- QBluetoothSocketBluezDbus used by QBluetoothSocket when
  Bluez >= 5.46

Leaving the native socket unclosed leaks the resource and eventually
we may run out of descriptors. This is reproducible by creating and
destroying QBluetoothServer instances in a loop.

As a related drive-by:
- Fix bluetooth socket autotest version check. DBus socket is used
  with bluez 5.46+ (for clarity: DBus lowenergycontroller
  is used with bluez 5.42+). This is needed for the test to pass
  with Bluez < 5.46
- Add a clarifying comment on socket close()

Fixes: QTBUG-103067
Change-Id: Idc38c743be09e559ea82bf09c2f9e44e4b80d666
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 3aafe9d5ce)
2022-05-30 13:27:25 +03:00
..
bic/data Add binary compatibility files for 5.15 for QtConnectivity 2020-08-17 14:42:10 +03:00
cmake Remove QtBluetooth and QtNfc namespace. 2013-09-09 12:44:29 +02:00
nfcdata re-added autotests 2011-10-07 03:31:39 +02:00
qbluetoothaddress Updated license headers 2016-01-20 20:14:38 +00:00
qbluetoothdevicediscoveryagent Repair tst_QBluetoothDeviceDiscoveryAgent on Android 2022-03-02 11:17:06 +00:00
qbluetoothdeviceinfo Add ability to have multiple manufacturer data per manufacturer ID 2019-08-08 10:40:48 +02:00
qbluetoothhostinfo Updated license headers 2016-01-20 20:14:38 +00:00
qbluetoothlocaldevice Enable the use of the Win32 Bluetooth backend 2019-08-05 09:16:09 +02:00
qbluetoothserver qbluetoothlocaldevice_p.cpp: Make sure d_ptr is initialized 2018-11-15 14:37:30 +00:00
qbluetoothservicediscoveryagent tst_qbluetoothservicediscovery: make auto-test less evil 2022-03-21 13:57:04 +01:00
qbluetoothserviceinfo tst_QBluetoothServiceInfo::tst_assignment - fix for Monterey 2021-12-29 14:16:06 +01:00
qbluetoothsocket Close socket descriptor when QBluetoothSocketBluez is destroyed 2022-05-30 13:27:25 +03:00
qbluetoothtransfermanager Replace foreach with for loop and set QT_NO_FOREACH 2018-08-15 07:56:46 +00:00
qbluetoothtransferrequest Replace foreach with for loop and set QT_NO_FOREACH 2018-08-15 07:56:46 +00:00
qbluetoothuuid Updated license headers 2016-01-20 20:14:38 +00:00
qlowenergycharacteristic Add Info.plists to autotests which require bluetooth usage key 2021-12-15 11:53:21 +02:00
qlowenergycontroller Add Info.plists to autotests which require bluetooth usage key 2021-12-15 11:53:21 +02:00
qlowenergycontroller-gattserver Replace foreach with for loop and set QT_NO_FOREACH 2018-08-15 07:56:46 +00:00
qlowenergydescriptor Add Info.plists to autotests which require bluetooth usage key 2021-12-15 11:53:21 +02:00
qlowenergyservice Updated license headers 2016-01-20 20:14:38 +00:00
qndefmessage Updated license headers 2016-01-20 20:14:38 +00:00
qndefnfcsmartposterrecord Fix QNdefNfcActRecord::action for platforms with unsigned char 2017-06-27 09:13:25 +00:00
qndefrecord Updated license headers 2016-01-20 20:14:38 +00:00
qnearfieldmanager Prepare tst_qnearfieldmanager for configurations with builtin_testdata 2018-12-06 06:30:56 +00:00
qnearfieldtagtype1 Also add a response for a request if reportError is called 2020-03-05 10:27:32 +01:00
qnearfieldtagtype2 Prepare tst_qnearfieldtagtype2 for configurations with builtin_testdata 2018-12-06 06:30:58 +00:00
shared Add Info.plists to autotests which require bluetooth usage key 2021-12-15 11:53:21 +02:00
auto.pro Bluetooth: Introduce API for LE advertising. 2015-11-17 15:40:02 +00:00