zephyr/samples/net/mqtt_publisher/docker-test.sh
Jukka Rissanen d1901d6a2f net: scripts: Make test runner script fully generic
Move actual test cases from the run-sample-tests.sh script to
the network samples directory that are supported by Docker based
testing. Each network sample directory that supports Docker testing,
will contain docker-test.sh script that is sourced by the runner
script. The docker-test.sh script will run the test as needed and
then return return value to the runner script.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 16:07:59 +02:00

58 lines
1.2 KiB
Bash

# Copyright (c) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
if [ -z "$RUNNING_FROM_MAIN_SCRIPT" ]; then
echo "Do not run this script directly!"
echo "Run $ZEPHYR_BASE/scripts/net/run-sample-tests.sh instead."
exit 1
fi
echo "Starting MQTT test"
start_configuration || return $?
start_docker \
"/usr/local/sbin/mosquitto -v -c /usr/local/etc/mosquitto/mosquitto.conf" || return $?
start_zephyr -DOVERLAY_CONFIG=overlay-sample.conf "$overlay"
wait_zephyr
result=$?
if [ $result -ne 0 ]; then
return $result
fi
stop_docker
# test TLS
echo "Starting MQTT TLS test"
start_docker \
"/usr/local/sbin/mosquitto -v -c /usr/local/etc/mosquitto/mosquitto-tls.conf" || return $?
start_zephyr -DOVERLAY_CONFIG="overlay-tls.conf overlay-sample.conf" "$overlay"
wait_zephyr
result=$?
if [ $result -ne 0 ]; then
return $result
fi
stop_docker
return $result
# FIXME: proxy test does not work as expected
# TLS and SOCKS5, mosquitto TLS is already running
echo "Starting MQTT TLS + proxy test"
start_docker "/usr/sbin/danted" || return $?
start_zephyr -DOVERLAY_CONFIG="overlay-tls.conf overlay-sample.conf overlay-socks5.conf" "$overlay" || return $?
wait_zephyr
result=$?
stop_docker