1# Copyright (c) 2024 BayLibre SAS
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
10# Running PTP sample using Docker testing
11
12start_configuration || return $?
13start_docker \
14	"/usr/local/sbin/ptp4l -4 -f /etc/gptp.cfg -m -q -l 6 -S -i eth0" \
15	|| return $?
16
17# For native_sim PTP run, the delay threshold needs to be huge
18start_zephyr "$overlay" "-DCONFIG_NET_SAMPLE_RUN_DURATION=15" \
19
20wait_zephyr
21ptp_result=$?
22
23if [ $ptp_result -eq 1 -o $ptp_result -eq 2 ]; then
24	result=0
25else
26	result=1
27fi
28
29stop_docker
30