From f11b9c1e18956b8268933b01b8a42379c36c5f36 Mon Sep 17 00:00:00 2001 From: Steve-Mcl Date: Thu, 29 Sep 2022 13:12:15 +0100 Subject: [PATCH] add test bad birth topic part of #3865 --- test/nodes/core/network/21-mqtt_spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/nodes/core/network/21-mqtt_spec.js b/test/nodes/core/network/21-mqtt_spec.js index 655cc9c73..390e50b91 100644 --- a/test/nodes/core/network/21-mqtt_spec.js +++ b/test/nodes/core/network/21-mqtt_spec.js @@ -430,6 +430,25 @@ describe('MQTT Nodes', function () { }; testSendRecv(brokerOptions, { topic: brokerOptions.birthTopic }, {}, options, hooks); }); + itConditional('should fail with bad birth topic', function (done) { + if (skipTests) { return this.skip() } + this.timeout = 2000; + const baseTopic = nextTopic(); + const brokerOptions = { + protocolVersion: 4, + birthTopic: baseTopic + "#", + birthPayload: "broker connected", + birthQos: 2, + } + const options = {}; + const hooks = { done: done, beforeLoad: null, afterLoad: null, afterConnect: null }; + options.expectMsg = { + topic: brokerOptions.birthTopic, + payload: brokerOptions.birthPayload, + qos: brokerOptions.birthQos + }; + testSendRecv(brokerOptions, { topic: brokerOptions.birthTopic }, {}, options, hooks); + }); itConditional('should publish close message', function (done) { if (skipTests) { return this.skip() } this.timeout = 2000;