drm/bridge: adv7511: Switch to atomic operations
[drm/drm-misc.git] / tools / testing / selftests / net / toeplitz_client.sh
blob2fef34f4aba17496978e8b40d0b84a921b4a79a6
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
4 # A simple program for generating traffic for the toeplitz test.
6 # This program sends packets periodically for, conservatively, 20 seconds. The
7 # intent is for the calling program to kill this program once it is no longer
8 # needed, rather than waiting for the 20 second expiration.
10 send_traffic() {
11 expiration=$((SECONDS+20))
12 while [[ "${SECONDS}" -lt "${expiration}" ]]
14 if [[ "${PROTO}" == "-u" ]]; then
15 echo "msg $i" | nc "${IPVER}" -u -w 0 "${ADDR}" "${PORT}"
16 else
17 echo "msg $i" | nc "${IPVER}" -w 0 "${ADDR}" "${PORT}"
19 sleep 0.001
20 done
23 PROTO=$1
24 IPVER=$2
25 ADDR=$3
26 PORT=$4
28 send_traffic