qtconnectivity/tests/auto/qbluetoothsocket
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
..
README.txt Fix qbluetoothsocket unit test 2014-02-27 16:14:01 +01:00
qbluetoothsocket.pro Support for Q_OS_ANDROID_EMBEDDED and android-embedded builds 2017-04-24 12:28:09 +00:00
tst_qbluetoothsocket.cpp Close socket descriptor when QBluetoothSocketBluez is destroyed 2022-05-30 13:27:25 +03:00

README.txt

This test requires bttestui running on a remote machine, and for it to
be discoverable and connectable to the device under test. The bttestui
should run an rfcomm server (see UI option SListenUuid).

bttestui is available in tests/bttestui.

The unit test attempts to use service discovery to locate bttestui.