diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_01.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_01.robot index 93b3d1825a0d469a69066d711b4ab8288bfe6526..8367ae8fb0754700054c62b1c70925ee562e9158 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_01.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_01.robot @@ -24,19 +24,19 @@ ${topic} ngsild-test-suite/topic *** Test Cases *** 058_01_01 Without User And Port [Tags] sub-mqtt-notification 5_8_6 - mosquitto.conf mqtt://127.0.0.1/${topic} + mosquitto.conf mqtt://${mqtt_broker_host}/${topic} 058_01_02 With Non Default Port [Tags] sub-mqtt-notification 5_8_6 - mosquitto.conf mqtt://127.0.0.1:2883/${topic} port=2883 + mosquitto.conf mqtt://${mqtt_broker_host}:${mqtt_broker_non_default_port}/${topic} port=${mqtt_broker_non_default_port} 058_01_03 With User [Tags] sub-mqtt-notification 5_8_6 - mosquitto.conf mqtt://user@127.0.0.1/${topic} + mosquitto.conf mqtt://user@${mqtt_broker_host}/${topic} 058_01_04 With User And Password [Tags] sub-mqtt-notification 5_8_6 - mosquitto_with_user.conf mqtt://user_with_password:password@127.0.0.1/${topic} username=user_with_password password=password + mosquitto_with_user.conf mqtt://user_with_password:password@${mqtt_broker_host}/${topic} username=user_with_password password=password 058_01_05 With User Password And Non Default Port [Tags] sub-mqtt-notification 5_8_6 - mosquitto_with_user.conf mqtt://user_with_password:password@127.0.0.1:2883/${topic} username=user_with_password password=password port=2883 + mosquitto_with_user.conf mqtt://user_with_password:password@${mqtt_broker_host}:${mqtt_broker_non_default_port}/${topic} username=user_with_password password=password port=${mqtt_broker_non_default_port} *** Keywords *** @@ -48,7 +48,7 @@ Receive MQTT Notification Setup Mqtt Subscription ${endpoint_uri} Set Username And Password ${username} ${password} - Connect 127.0.0.1 ${port} + Connect ${mqtt_broker_host} ${port} Subscribe topic=${topic} qos=1 ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_02.robot index 3f985a6930537b0a3d8032378b01813fd241535a..5db442acc2a1df486ef7cdef4be89402a2db40a7 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_02.robot @@ -20,7 +20,7 @@ ${building_id_prefix} urn:ngsi-ld:Building: ${entity_building_filepath} building-simple-attributes-sample.jsonld ${fragment_filename} airQualityLevel-fragment.jsonld ${topic} ngsild-test-suite/topic -${endpoint} mqtt://127.0.0.1/${topic} +${endpoint} mqtt://${mqtt_broker_host}/${topic} ${config_filename} mosquitto.conf @@ -49,7 +49,7 @@ Receive MQTT Notification Start Mqtt Server And Connect Start Mqtt Server ${config_filename} 1883 - Connect 127.0.0.1 1883 + Connect ${mqtt_broker_host} 1883 Subscribe topic=${topic} qos=1 After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_03.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_03.robot index 863e95341626179ab26fb8bb22ea493360bd65f1..ee91ce8bf7e1257b0cdcb23b3e252b587bac386d 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_03.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_03.robot @@ -20,7 +20,7 @@ ${building_id_prefix} urn:ngsi-ld:Building: ${entity_building_filepath} building-simple-attributes-sample.jsonld ${fragment_filename} airQualityLevel-fragment.jsonld ${topic} ngsild-test-suite/topic -${endpoint} mqtt://127.0.0.1/${topic} +${endpoint} mqtt://${mqtt_broker_host}/${topic} ${config_filename} mosquitto.conf @@ -51,7 +51,7 @@ Receive Mqtt Notification Start Mqtt Server And Connect Start Mqtt Server ${config_filename} 1883 - Connect 127.0.0.1 1883 + Connect ${mqtt_broker_host} 1883 Subscribe topic=${topic} qos=1 After Test diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_04.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_04.robot index e45aca73109a54c6d6ec1aa3eded1be4efaf2eca..297f693e68149db630a7498a97c45b1c36c1bc67 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_04.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/MQTT/058_04.robot @@ -20,7 +20,7 @@ ${building_id_prefix} urn:ngsi-ld:Building: ${entity_building_filepath} building-simple-attributes-sample.jsonld ${fragment_filename} airQualityLevel-fragment.jsonld ${topic} ngsild-test-suite/topic -${endpoint} mqtt://127.0.0.1/${topic} +${endpoint} mqtt://${mqtt_broker_host}/${topic} ${config_filename} mosquitto.conf @@ -54,7 +54,7 @@ Start Mqtt Server And Connect Start Mqtt Server ${config_filename} 1883 Setup Mqtt Subscription ${endpoint} - Connect 127.0.0.1 1883 + Connect ${mqtt_broker_host} 1883 Subscribe topic=${topic} qos=1 After Test diff --git a/resources/mqttUtils/MqttUtils.resource b/resources/mqttUtils/MqttUtils.resource index 8ee17e867c2835d289e8be3f602bbf2a80fa8490..d14ac9a602079250628577218136b02ab4560525 100644 --- a/resources/mqttUtils/MqttUtils.resource +++ b/resources/mqttUtils/MqttUtils.resource @@ -17,12 +17,12 @@ Start Mqtt Server ${result} = Run Process ${request} shell=yes IF ${result.rc} > 0 - Log The launch of mosquitto encount an error - Log Check that docker is installed - Log that the port ${port} is available - Log and that no other container named ${container_name} is running - Log ${result.stdout} - Log ${result.stderr} + Log To Console The launch of mosquitto encounter an error + Log To Console Check that docker is installed + Log To Console that the port ${port} is available + Log To Console and that no other container named ${container_name} is running + Log To Console ${result.stdout} + Log To Console ${result.stderr} END Stop Mqtt Server diff --git a/resources/variables.py b/resources/variables.py index 1017093281036a3d8785ac7d67371fc1e8d8f3ac..8e573fd36c54218d636aaeba7a710cbda578834f 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -3,6 +3,8 @@ temporal_api_url = 'http://localhost:8080/ngsi-ld/v1' ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' notification_server_host = '0.0.0.0' notification_server_port = 8085 +mqtt_broker_host = '127.0.0.1' +mqtt_broker_non_default_port = 8085 context_source_host = '0.0.0.0' context_source_port = 8086 context_server_host = '0.0.0.0'