Commit b1fcb83d authored by thomas Bousselin's avatar thomas Bousselin
Browse files

Merge branch 'feature/fix-mqtt' into 'develop'

feat: add mqtt host variables

See merge request !149
parents 201dc0f7 0017d9b4
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -24,19 +24,19 @@ ${topic} ngsild-test-suite/topic
*** Test Cases ***
*** Test Cases ***
058_01_01 Without User And Port
058_01_01 Without User And Port
    [Tags]    sub-mqtt-notification    5_8_6
    [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
058_01_02 With Non Default Port
    [Tags]    sub-mqtt-notification    5_8_6
    [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
058_01_03 With User
    [Tags]    sub-mqtt-notification    5_8_6
    [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
058_01_04 With User And Password
    [Tags]    sub-mqtt-notification    5_8_6
    [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
058_01_05 With User Password And Non Default Port
    [Tags]    sub-mqtt-notification    5_8_6
    [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 ***
*** Keywords ***
@@ -48,7 +48,7 @@ Receive MQTT Notification
    Setup Mqtt Subscription    ${endpoint_uri}
    Setup Mqtt Subscription    ${endpoint_uri}


    Set Username And Password    ${username}    ${password}
    Set Username And Password    ${username}    ${password}
    Connect    127.0.0.1    ${port}
    Connect    ${mqtt_broker_host}    ${port}
    Subscribe    topic=${topic}    qos=1
    Subscribe    topic=${topic}    qos=1


    ${response}=    Update Entity Attributes    ${entity_id}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}
    ${response}=    Update Entity Attributes    ${entity_id}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}
+2 −2
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@ ${building_id_prefix} urn:ngsi-ld:Building:
${entity_building_filepath}             building-simple-attributes-sample.jsonld
${entity_building_filepath}             building-simple-attributes-sample.jsonld
${fragment_filename}                    airQualityLevel-fragment.jsonld
${fragment_filename}                    airQualityLevel-fragment.jsonld
${topic}                                ngsild-test-suite/topic
${topic}                                ngsild-test-suite/topic
${endpoint}                             mqtt://127.0.0.1/${topic}
${endpoint}                             mqtt://${mqtt_broker_host}/${topic}
${config_filename}                      mosquitto.conf
${config_filename}                      mosquitto.conf




@@ -49,7 +49,7 @@ Receive MQTT Notification


Start Mqtt Server And Connect
Start Mqtt Server And Connect
    Start Mqtt Server    ${config_filename}    1883
    Start Mqtt Server    ${config_filename}    1883
    Connect    127.0.0.1    1883
    Connect    ${mqtt_broker_host}    1883
    Subscribe    topic=${topic}    qos=1
    Subscribe    topic=${topic}    qos=1


After Test
After Test
+2 −2
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@ ${building_id_prefix} urn:ngsi-ld:Building:
${entity_building_filepath}             building-simple-attributes-sample.jsonld
${entity_building_filepath}             building-simple-attributes-sample.jsonld
${fragment_filename}                    airQualityLevel-fragment.jsonld
${fragment_filename}                    airQualityLevel-fragment.jsonld
${topic}                                ngsild-test-suite/topic
${topic}                                ngsild-test-suite/topic
${endpoint}                             mqtt://127.0.0.1/${topic}
${endpoint}                             mqtt://${mqtt_broker_host}/${topic}
${config_filename}                      mosquitto.conf
${config_filename}                      mosquitto.conf




@@ -51,7 +51,7 @@ Receive Mqtt Notification


Start Mqtt Server And Connect
Start Mqtt Server And Connect
    Start Mqtt Server    ${config_filename}    1883
    Start Mqtt Server    ${config_filename}    1883
    Connect    127.0.0.1    1883
    Connect    ${mqtt_broker_host}    1883
    Subscribe    topic=${topic}    qos=1
    Subscribe    topic=${topic}    qos=1


After Test
After Test
+2 −2
Original line number Original line Diff line number Diff line
@@ -20,7 +20,7 @@ ${building_id_prefix} urn:ngsi-ld:Building:
${entity_building_filepath}             building-simple-attributes-sample.jsonld
${entity_building_filepath}             building-simple-attributes-sample.jsonld
${fragment_filename}                    airQualityLevel-fragment.jsonld
${fragment_filename}                    airQualityLevel-fragment.jsonld
${topic}                                ngsild-test-suite/topic
${topic}                                ngsild-test-suite/topic
${endpoint}                             mqtt://127.0.0.1/${topic}
${endpoint}                             mqtt://${mqtt_broker_host}/${topic}
${config_filename}                      mosquitto.conf
${config_filename}                      mosquitto.conf




@@ -54,7 +54,7 @@ Start Mqtt Server And Connect
    Start Mqtt Server    ${config_filename}    1883
    Start Mqtt Server    ${config_filename}    1883
    Setup Mqtt Subscription    ${endpoint}
    Setup Mqtt Subscription    ${endpoint}


    Connect    127.0.0.1    1883
    Connect    ${mqtt_broker_host}    1883
    Subscribe    topic=${topic}    qos=1
    Subscribe    topic=${topic}    qos=1


After Test
After Test
+6 −6
Original line number Original line Diff line number Diff line
@@ -17,12 +17,12 @@ Start Mqtt Server


    ${result} =    Run Process    ${request}    shell=yes
    ${result} =    Run Process    ${request}    shell=yes
    IF    ${result.rc} > 0
    IF    ${result.rc} > 0
        Log    The launch of mosquitto encount an error
        Log To Console    The launch of mosquitto encounter an error
        Log    Check that docker is installed
        Log To Console    Check that docker is installed
        Log    that the port ${port} is available
        Log To Console    that the port ${port} is available
        Log    and that no other container named ${container_name} is running
        Log To Console    and that no other container named ${container_name} is running
        Log    ${result.stdout}
        Log To Console    ${result.stdout}
        Log    ${result.stderr}
        Log To Console    ${result.stderr}
    END
    END


Stop Mqtt Server
Stop Mqtt Server
Loading