1
0
mirror of https://github.com/qt/qtmqtt.git synced 2026-10-25 16:16:26 +00:00
qtmqtt/tests
Even Oscar Andersen 8316766cec Add tests for websocket support for mqtt
For at least one platform run the twelve combinations of:
 Transport: [Tcp,Ssl,Ws,Wss]
 Protocol: [3.1, 3.1.1, 5.0]

This happens if the following defines are present:
  MQTT_TEST_BROKER
  MQTT_TEST_TYPE
  MQTT_TEST_PROTOCOL

If these are not defined, the old test behavior is kept

The logic is that we are replacing the type of VersionClient
to homegrown logic that replaces connectToHost with the
correct function:
  connectToHost
  connectToHostEncrypted,
  connectToHostWebSocket
  connectToHostWebSocketEncrypted

For this to work it is important that the VersionClient
macro is used everywhere.

Also, DefaultVersionTestData has been changed to
return version(0) if MQTT_TEST_PROTOCOL is defined,
we will now run one protocol at the time instead.

This is Change Request 2 of 2 wrt testing.

Task-number: QTBUG-129171
Change-Id: I4f68d7c2ea226a1107f009c80f87f8b749d9f120
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2025-01-29 15:54:55 +01:00
..
auto Add tests for websocket support for mqtt 2025-01-29 15:54:55 +01:00
benchmarks Add tests for websocket support for mqtt 2025-01-29 15:54:55 +01:00
certificate Add tests for websocket support for mqtt 2025-01-29 15:54:55 +01:00
common Add tests for websocket support for mqtt 2025-01-29 15:54:55 +01:00
libfuzzer/mqtt/data_receive Change license for test files 2024-03-20 08:11:56 +01:00
manual Only call find_package when building tests as standalone 2024-11-28 18:02:17 +01:00
CMakeLists.txt Add tests for websocket support for mqtt 2025-01-29 15:54:55 +01:00
README.txt Add README for using auto tests 2018-02-02 07:59:27 +00:00

The tests included in the subdirectories check for functionality and
conformance of the Qt MQTT module.

To be able to run the tests successfully, a broker needs to be available and
reachable.

The continuous integration utilized the paho conformance test broker. It can
be obtained at this location:
https://github.com/eclipse/paho.mqtt.testing

For the unit tests being able to locate this script, use the
MQTT_TEST_BROKER_LOCATION environment variable and set it
to “<install-path>/interoperability/startbroker.py”.

Alternatively, any broker can be instantiated and passed to the auto tests
by using the environment variable MQTT_TEST_BROKER. This must point to a
valid url. The broker must run on the standardized port 1883.

Note, that the unit tests verify functionality against the MQTT 3.1.1 version
of the standard, hence the broker needs to be compliant to the adherent
specifications.