1# Copyright (c) 2020 Intel Corporation
2# SPDX-License-Identifier: Apache-2.0
3
4if [ -z "$RUNNING_FROM_MAIN_SCRIPT" ]; then
5    echo "Do not run this script directly!"
6    echo "Run $ZEPHYR_BASE/scripts/net/run-sample-tests.sh instead."
7    exit 1
8fi
9
10MSG_COUNT=5
11
12start_configuration || return $?
13
14# First IPv6
15start_docker "/usr/local/bin/syslog-receiver.py 2001:db8::2" || return $?
16start_zephyr "$overlay" "-DCONFIG_LOG_BACKEND_NET_SERVER=\"[2001:db8::2]:514\"" \
17             "-DCONFIG_NET_SAMPLE_SEND_ITERATIONS=$MSG_COUNT"
18wait $docker_pid
19docker_result=$?
20wait_zephyr
21result=$?
22stop_docker
23if [ $result -ne 0 ] || [ $docker_result -ne 0 ]; then
24    return ${result}${docker_result}
25fi
26
27# Then IPv4
28start_docker "/usr/local/bin/syslog-receiver.py 192.0.2.2" || return $?
29start_zephyr "$overlay" "-DCONFIG_LOG_BACKEND_NET_SERVER=\"192.0.2.2:514\"" \
30             "-DCONFIG_NET_SAMPLE_SEND_ITERATIONS=$MSG_COUNT"
31wait $docker_pid
32docker_result=$?
33wait_zephyr
34result=$?
35stop_docker
36if [ $result -ne 0 ] || [ $docker_result -ne 0 ]; then
37    return ${result}${docker_result}
38fi
39
40return 0
41