topic validation in subscribe, unsubscribe & publish

Summary: resolves T13170

Reviewers: ivica

Reviewed By: ivica

Subscribers: miljen, iljazovic

Maniphest Tasks: T13170

Differential Revision: https://repo.mireo.local/D26728
This commit is contained in:
Korina Šimičević
2023-11-29 11:50:07 +01:00
parent 93dc1064a2
commit c18e5fc4f4
19 changed files with 284 additions and 108 deletions

View File

@@ -71,7 +71,7 @@ void publish_qos0_openssl_tls() {
c.credentials("test-qos0-openssl-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_most_once>(
@@ -104,7 +104,7 @@ void publish_qos1_openssl_tls() {
c.credentials("test-qos1-openssl-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_least_once>(
@@ -139,7 +139,7 @@ void publish_qos2_openssl_tls() {
c.credentials("test-qos2-openssl-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::exactly_once>(
@@ -174,7 +174,7 @@ void subscribe_and_receive_openssl_tls(int num_receive) {
c.credentials("test-subscriber-openssl-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
@@ -240,7 +240,7 @@ void test_coro() {
c.credentials("coro-client", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
std::vector<subscribe_topic> topics;

View File

@@ -7,9 +7,9 @@ void run_websocket_tls_examples();
int main(int argc, char* argv[]) {
run_tcp_examples();
run_openssl_tls_examples();
run_websocket_tcp_examples();
run_websocket_tls_examples();
// run_openssl_tls_examples();
// run_websocket_tcp_examples();
// run_websocket_tls_examples();
return 0;
}

View File

@@ -19,7 +19,7 @@ void publish_qos0_tcp() {
c.credentials("test-qos0-tcp", "", "")
.brokers("mqtt.mireo.local", 1883)
.will({ "test/mqtt-test", "i died",qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!",qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_most_once>(
@@ -46,7 +46,7 @@ void publish_qos1_tcp() {
c.credentials("test-qos1-tcp", "", "")
.brokers("mqtt.mireo.local", 1883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_least_once>(
@@ -73,7 +73,7 @@ void publish_qos2_tcp() {
c.credentials("test-qos2-tcp", "", "")
.brokers("mqtt.mireo.local", 1883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::exactly_once>(
@@ -101,7 +101,7 @@ void subscribe_and_receive_tcp(int num_receive) {
c.credentials("test-subscriber-tcp", "", "")
.brokers("mqtt.mireo.local", 1883)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_subscribe(

View File

@@ -24,7 +24,7 @@ void publish_qos0_websocket_tcp() {
c.credentials("test-qos0-websocket-tcp", "", "")
.brokers("fcluster-5/mqtt", 8083)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_most_once>(
@@ -54,7 +54,7 @@ void publish_qos1_websocket_tcp() {
c.credentials("test-qos1-websocket-tcp", "", "")
.brokers("fcluster-5/mqtt", 8083)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_least_once>(
@@ -85,7 +85,7 @@ void publish_qos2_websocket_tcp() {
c.credentials("test-qos2-websocket-tcp", "", "")
.brokers("fcluster-5/mqtt", 8083)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::exactly_once>(
@@ -117,7 +117,7 @@ void subscribe_and_receive_websocket_tcp(int num_receive) {
c.credentials("test-subscriber-websocket-tcp", "", "")
.brokers("fcluster-5/mqtt", 8083)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
std::vector<subscribe_topic> topics;

View File

@@ -86,7 +86,7 @@ void publish_qos0_websocket_tls() {
c.credentials("test-qos0-websocket-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8884)
.will({ "test/mqtt-test", "i died", async_mqtt5::qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", async_mqtt5::qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_most_once>(
@@ -121,7 +121,7 @@ void publish_qos1_websocket_tls() {
c.credentials("test-qos1-websocket-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8884)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::at_least_once>(
@@ -157,7 +157,7 @@ void publish_qos2_websocket_tls() {
c.credentials("test-qos2-websocket-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8884)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
c.async_publish<qos_e::exactly_once>(
@@ -194,7 +194,7 @@ void subscribe_and_receive_websocket_tls(int num_receive) {
c.credentials("test-subscriber-websocket-tls", "", "")
.brokers("iot.fcluster.mireo.hr/mqtt", 8884)
.will({ "test/mqtt-test", "i died", qos_e::at_least_once })
.will({ "test/mqtt-test", "Client disconnected!", qos_e::at_least_once })
.run();
std::vector<subscribe_topic> topics;