mirror of https://github.com/wolfSSL/wolfMQTT.git
32 lines
744 B
Bash
Executable File
32 lines
744 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Watson IoT Client test
|
|
|
|
# NOTE: 31MAY2021 Quickstart broker was disabled
|
|
|
|
# Check for application
|
|
[ ! -x ./examples/wiot/wiot ] && echo -e "\n\nWatson IoT MQTT Client doesn't exist" && exit 1
|
|
|
|
# Check for TLS support
|
|
has_tls=no
|
|
./examples/azure/azureiothub -? 2>&1 | grep -- 'Enable TLS'
|
|
if [ $? -eq 0 ]; then
|
|
has_tls=yes
|
|
fi
|
|
|
|
def_args="-T -C 2000"
|
|
|
|
if test -n "$WOLFMQTT_NO_EXTERNAL_BROKER_TESTS" && test $has_tls == yes; then
|
|
echo "WOLFMQTT_NO_EXTERNAL_BROKER_TESTS set or no TLS, won't run"
|
|
else
|
|
# Run
|
|
|
|
./examples/wiot/wiot $def_args $1
|
|
RESULT=$?
|
|
[ $RESULT -ne 0 ] && echo -e "\n\nWatson IoT MQTT Client failed! TLS=On, QoS=0" && exit 1
|
|
|
|
echo -e "\n\nWatson IoT MQTT Client Tests Passed"
|
|
fi
|
|
|
|
exit 0
|