From 5fb50e1d840ff285d7b7c72d82981db281b331e7 Mon Sep 17 00:00:00 2001 From: eeff <33566201+eeff@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:30:36 +0800 Subject: [PATCH] test: add ft test case for empty mqtt subscription topic --- ft/resource/error.resource | 2 ++ ft/subscribe_test.robot | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/ft/resource/error.resource b/ft/resource/error.resource index 65563404..5619f20f 100644 --- a/ft/resource/error.resource +++ b/ft/resource/error.resource @@ -95,3 +95,5 @@ ${NEU_ERR_PLUGIN_NOT_FOUND} 3014 ${NEU_ERR_PLUGIN_DEVICE_NOT_RESPONSE} 3015 ${NEU_ERR_PLUGIN_NOT_SUPPORT_TEMPLATE} 3016 ${NEU_ERR_PLUGIN_NOT_SUPPORT_WRITE_TAGS} 3017 + +${NEU_ERR_MQTT_SUBSCRIBE_FAILURE} 4010 diff --git a/ft/subscribe_test.robot b/ft/subscribe_test.robot index 7434f68a..82c4f073 100644 --- a/ft/subscribe_test.robot +++ b/ft/subscribe_test.robot @@ -45,6 +45,14 @@ North APP subscribe multiple nonexistent groups, it should fail. Check Response Status ${res} 404 Check Error Code ${res} ${NEU_ERR_GROUP_NOT_EXIST} +North MQTT APP subscribe with empty topic, it should fail. + ${g1} = Evaluate {"driver": "modbus-node", "group": "group1", "params":{"topic":""}} + + ${res}= Subscribe Groups mqtt ${g1} + + Check Response Status ${res} 200 + Check Error Code ${res} ${NEU_ERR_MQTT_SUBSCRIBE_FAILURE} + North APP subscribe multiple groups, it should return success Add Group modbus-node group1 1000 Add Group modbus-node group2 1000