Commit 0017d9b4 authored by thomas Bousselin's avatar thomas Bousselin
Browse files

feat: add mqtt host variables

parent 201dc0f7
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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}
+2 −2
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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
+6 −6
Original line number Diff line number Diff line
@@ -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
Loading