Skip to content

Commit

Permalink
selftests: net: amt: indicate progress in the stress test
Browse files Browse the repository at this point in the history
Our CI expects output from the test at least once every 10 minutes.
The AMT test when running on debug kernel is just on the edge
of that time for the stress test. Improve the output:
 - print the name of the test first, before starting it,
 - output a dot every 10% of the way.

Output after:

  TEST: amt discovery                                                 [ OK ]
  TEST: IPv4 amt multicast forwarding                                 [ OK ]
  TEST: IPv6 amt multicast forwarding                                 [ OK ]
  TEST: IPv4 amt traffic forwarding torture               ..........  [ OK ]
  TEST: IPv6 amt traffic forwarding torture               ..........  [ OK ]

Reviewed-by: Taehee Yoo <ap420073@gmail.com>
Link: https://patch.msgid.link/20250403145636.2891166-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Apr 4, 2025
1 parent af6610e commit 94f68c0
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions tools/testing/selftests/net/amt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,21 @@ test_remote_ip()

send_mcast_torture4()
{
ip netns exec "${SOURCE}" bash -c \
'cat /dev/urandom | head -c 1G | nc -w 1 -u 239.0.0.1 4001'
for i in `seq 10`; do
ip netns exec "${SOURCE}" bash -c \
'cat /dev/urandom | head -c 100M | nc -w 1 -u 239.0.0.1 4001'
echo -n "."
done
}


send_mcast_torture6()
{
ip netns exec "${SOURCE}" bash -c \
'cat /dev/urandom | head -c 1G | nc -w 1 -u ff0e::5:6 6001'
for i in `seq 10`; do
ip netns exec "${SOURCE}" bash -c \
'cat /dev/urandom | head -c 100M | nc -w 1 -u ff0e::5:6 6001'
echo -n "."
done
}

check_features()
Expand Down Expand Up @@ -278,10 +284,12 @@ wait $pid || err=$?
if [ $err -eq 1 ]; then
ERR=1
fi
printf "TEST: %-50s" "IPv4 amt traffic forwarding torture"
send_mcast_torture4
printf "TEST: %-60s [ OK ]\n" "IPv4 amt traffic forwarding torture"
printf " [ OK ]\n"
printf "TEST: %-50s" "IPv6 amt traffic forwarding torture"
send_mcast_torture6
printf "TEST: %-60s [ OK ]\n" "IPv6 amt traffic forwarding torture"
printf " [ OK ]\n"
sleep 5
if [ "${ERR}" -eq 1 ]; then
echo "Some tests failed." >&2
Expand Down

0 comments on commit 94f68c0

Please sign in to comment.