net: scripts: Add gPTP support to sample testing
Allow gPTP sample to be run via run-sample-tests.sh script. This makes it possible to do simple smoke testing and verify that gPTP stack is not broken. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
b31f1e3dc7
commit
861c2c78f0
2 changed files with 27 additions and 2 deletions
|
@ -146,7 +146,10 @@ start_zephyr ()
|
|||
cmake -GNinja -DBOARD=native_posix -B build "$@" . && \
|
||||
ninja -C build
|
||||
|
||||
ninja -C build run &
|
||||
# Run the binary directly so that ninja does not print errors that
|
||||
# could be confusing.
|
||||
#ninja -C build run &
|
||||
build/zephyr/zephyr.exe &
|
||||
zephyr_pid=$!
|
||||
|
||||
sleep 3
|
||||
|
@ -361,6 +364,28 @@ docker_exec ()
|
|||
return $result
|
||||
;;
|
||||
|
||||
gptp)
|
||||
start_configuration || return $?
|
||||
start_docker \
|
||||
"/usr/local/sbin/ptp4l -2 -f /etc/gptp.cfg -m -q -l 6 -S -i eth0" \
|
||||
|| return $?
|
||||
|
||||
# For native_posix gPTP run, the delay threshold needs to be huge
|
||||
start_zephyr "$overlay" "-DCONFIG_NET_SAMPLE_RUN_DURATION=10" \
|
||||
"-DCONFIG_NET_GPTP_NEIGHBOR_PROP_DELAY_THR=12000000"
|
||||
|
||||
wait_zephyr
|
||||
gptp_result=$?
|
||||
|
||||
if [ $gptp_result -eq 1 -o $gptp_result -eq 2 ]; then
|
||||
result=0
|
||||
else
|
||||
result=1
|
||||
fi
|
||||
|
||||
stop_docker
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "No sample test corresponding to directory '$1' found" >&2
|
||||
return 1
|
||||
|
|
2
west.yml
2
west.yml
|
@ -99,7 +99,7 @@ manifest:
|
|||
revision: f28a637db12c4b12fb2b18bddc6b2a0deaa95251
|
||||
path: modules/lib/mcumgr
|
||||
- name: net-tools
|
||||
revision: e53774b71288a85f7321bfbfa57cae6d3419f022
|
||||
revision: c72fbf3300264a8a4bb48be314ca93765c863a19
|
||||
path: tools/net-tools
|
||||
- name: hal_nxp
|
||||
revision: 56915d2942a3af7205b3c4991a8b87e915de7f59
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue