diff mbox series

[net] selftests: net: amt: indicate progress in the stress test

Message ID 20250403145636.2891166-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit 94f68c0f99a548d33a102672690100bf76a7c460
Delegated to: Netdev Maintainers
Headers show
Series [net] selftests: net: amt: indicate progress in the stress test | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success Errors and warnings before: 26 (+2) this patch: 26 (+2)
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success net selftest script(s) already in Makefile
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 39 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-04-04--00-00 (tests: 911)

Commit Message

Jakub Kicinski April 3, 2025, 2:56 p.m. UTC
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 ]

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
Since net-next is closed I'm sending this for net.
We enabled DEBUG_PREEMPT in the debug flavor and the test now
times out most of the time.

CC: ap420073@gmail.com
CC: shuah@kernel.org
CC: linux-kselftest@vger.kernel.org
---
 tools/testing/selftests/net/amt.sh | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

Comments

Taehee Yoo April 4, 2025, 5:08 a.m. UTC | #1
On Thu, Apr 3, 2025 at 11:56 PM Jakub Kicinski <kuba@kernel.org> wrote:
>

Hi Jakub,
Thanks a lot for this work!

> 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>

I tested it, and it works well.

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 ]

Thanks a lot!
Taehee Yoo

> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> Since net-next is closed I'm sending this for net.
> We enabled DEBUG_PREEMPT in the debug flavor and the test now
> times out most of the time.
>
> CC: ap420073@gmail.com
> CC: shuah@kernel.org
> CC: linux-kselftest@vger.kernel.org
> ---
>  tools/testing/selftests/net/amt.sh | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/tools/testing/selftests/net/amt.sh b/tools/testing/selftests/net/amt.sh
> index d458b45c775b..3ef209cacb8e 100755
> --- a/tools/testing/selftests/net/amt.sh
> +++ b/tools/testing/selftests/net/amt.sh
> @@ -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()
> @@ -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
> --
> 2.49.0
>
patchwork-bot+netdevbpf@kernel.org April 4, 2025, 3:10 p.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  3 Apr 2025 07:56:36 -0700 you wrote:
> 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:
> 
> [...]

Here is the summary with links:
  - [net] selftests: net: amt: indicate progress in the stress test
    https://git.kernel.org/netdev/net/c/94f68c0f99a5

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/amt.sh b/tools/testing/selftests/net/amt.sh
index d458b45c775b..3ef209cacb8e 100755
--- a/tools/testing/selftests/net/amt.sh
+++ b/tools/testing/selftests/net/amt.sh
@@ -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()
@@ -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