apps/netutils: Modify the MQTT compilation file to enable MQTT testing
Summary
Modify the build and test files to make the MQTT test cases run.
Impact
Only affects MQTT testing
Testing
The compilation is successful and the test commands can be executed normally. `nsh> cmocka_mqttc_test Staring MQTT-C unit-tests. Using broker: "test.mosquitto.org:1883"
[MQTT Packet Serialization/Deserialization Tests] [==========] framing_tests: Running 11 test(s). [ RUN ] TEST__framing__fixed_header [ OK ] TEST__framing__fixed_header [ RUN ] TEST__framing__connect [ OK ] TEST__framing__connect [ RUN ] TEST__framing__connack [ OK ] TEST__framing__connack [ RUN ] TEST__framing__publish [ OK ] TEST__framing__publish [ RUN ] TEST__framing__pubxxx [ OK ] TEST__framing__pubxxx [ RUN ] TEST__framing__subscribe [ OK ] TEST__framing__subscribe [ RUN ] TEST__framing__suback [ OK ] TEST__framing__suback [ RUN ] TEST__framing__unsubscribe [ OK ] TEST__framing__unsubscribe [ RUN ] TEST__framing__unsuback [ OK ] TEST__framing__unsuback [ RUN ] TEST__framing__ping [ OK ] TEST__framing__ping [ RUN ] TEST__framing__disconnect [ OK ] TEST__framing__disconnect [==========] framing_tests: 11 test(s) run. [ PASSED ] 11 test(s).
[MQTT-C Utilities Tests] [==========] util_tests: Running 4 test(s). [ RUN ] TEST__utility__message_queue [ OK ] TEST__utility__message_queue [ RUN ] TEST__utility__pid_lfsr [ OK ] TEST__utility__pid_lfsr [ RUN ] TEST__utility__connect_disconnect Failed to open socket (getaddrinfo): EAI_AGAIN [ ERROR ] --- client.socketfd != -1 [ LINE ] --- MQTT-C/tests.c:280: error: Failure! [ FAILED ] TEST__utility__connect_disconnect [ RUN ] TEST__utility__ping Failed to open socket (getaddrinfo): EAI_AGAIN [ ERROR ] --- client.socketfd != -1 [ LINE ] --- MQTT-C/tests.c:482: error: Failure! [ FAILED ] TEST__utility__ping [==========] util_tests: 4 test(s) run. [ PASSED ] 2 test(s). [ FAILED ] util_tests: 2 test(s), listed below: [ FAILED ] TEST__utility__connect_disconnect [ FAILED ] TEST__utility__ping
2 FAILED TEST(S)
[MQTT-C API Tests] [==========] api_tests: Running 3 test(s). [ RUN ] TEST__api__connect_ping_disconnect Failed to open socket (getaddrinfo): EAI_AGAIN [ ERROR ] --- __mqtt_send(&client) > 0 [ LINE ] --- MQTT-C/tests.c:640: error: Failure! [ FAILED ] TEST__api__connect_ping_disconnect [ RUN ] TEST__api__publish_subscribe__single Failed to open socket (getaddrinfo): EAI_AGAIN Failed to open socket (getaddrinfo): EAI_AGAIN [ ERROR ] --- __mqtt_send(&sender) > 0 [ LINE ] --- MQTT-C/tests.c:687: error: Failure! [ FAILED ] TEST__api__publish_subscribe__single [ RUN ] TEST__api__publish_subscribe__multiple Failed to open socket (getaddrinfo): EAI_AGAIN Failed to open socket (getaddrinfo): EAI_AGAIN error: MQTT_ERROR_SOCKET_ERROR [ ERROR ] --- rv > 0 [ LINE ] --- MQTT-C/tests.c:758: error: Failure! [ FAILED ] TEST__api__publish_subscribe__multiple [==========] api_tests: 3 test(s) run. [ PASSED ] 0 test(s). [ FAILED ] api_tests: 3 test(s), listed below: [ FAILED ] TEST__api__connect_ping_disconnect [ FAILED ] TEST__api__publish_subscribe__single [ FAILED ] TEST__api__publish_subscribe__multiple
3 FAILED TEST(S) `