This patch renames run.sh to rds_run.sh, and then adds two wrapper scripts, rds_rdma_run.sh and rds_tcp_run.sh which run rds_run.sh with the corresponding transport option, rdma or tcp respectively. These wrapper scripts are added to TEST_PROGS in place of run.sh so that they run and report as a separate test results on the netdev CI dashboard. Listing the wrappers in TEST_PROGS also gives the framework a self-describing name for each test. The underlying rds_run.sh remains directly usable with the full set of options. Suggested-by: Matthieu Baerts Signed-off-by: Allison Henderson --- tools/testing/selftests/net/rds/Makefile | 6 +++++- tools/testing/selftests/net/rds/README.txt | 13 +++++++++---- tools/testing/selftests/net/rds/rds_rdma_run.sh | 11 +++++++++++ .../selftests/net/rds/{run.sh => rds_run.sh} | 4 ++-- tools/testing/selftests/net/rds/rds_tcp_run.sh | 11 +++++++++++ 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/net/rds/Makefile b/tools/testing/selftests/net/rds/Makefile index fe363be8e3586..b176e637fc55b 100644 --- a/tools/testing/selftests/net/rds/Makefile +++ b/tools/testing/selftests/net/rds/Makefile @@ -3,9 +3,13 @@ all: @echo mk_build_dir="$(shell pwd)" > include.sh -TEST_PROGS := run.sh +TEST_PROGS := \ + rds_tcp_run.sh \ + rds_rdma_run.sh \ +# end of TEST_PROGS TEST_FILES := \ + rds_run.sh \ include.sh \ settings \ test.py \ diff --git a/tools/testing/selftests/net/rds/README.txt b/tools/testing/selftests/net/rds/README.txt index bac6f15a80d52..2296568c39444 100644 --- a/tools/testing/selftests/net/rds/README.txt +++ b/tools/testing/selftests/net/rds/README.txt @@ -13,10 +13,15 @@ with the necessary gcov options; pass -r to also enable the kernel configs required for the RDMA transport. The kernel may optionally be configured to omit the coverage report as well. +The test framework runs the rds_tcp_run.sh and rds_rdma_run.sh wrappers, +which invoke rds_run.sh with the matching transport so that the tcp and +rdma results are reported independently. rds_run.sh may also be run +directly with the options below. + USAGE: - run.sh [-d logdir] [-l packet_loss] [-c packet_corruption] - [-u packet_duplicate] [-t timeout] - [-T tcp|rdma|tcp,rdma] + rds_run.sh [-d logdir] [-l packet_loss] [-c packet_corruption] + [-u packet_duplicate] [-t timeout] + [-T tcp|rdma|tcp,rdma] OPTIONS: -d Log directory. If set, logs will be stored in the @@ -73,5 +78,5 @@ EXAMPLE: "export PYTHONPATH=tools/testing/selftests/net/; \ export SUDO_USER=example_user; \ export RDS_LOG_DIR=tools/testing/selftests/net/rds/rds_logs; \ - tools/testing/selftests/net/rds/run.sh -T tcp,rdma" + tools/testing/selftests/net/rds/rds_run.sh -T tcp,rdma" diff --git a/tools/testing/selftests/net/rds/rds_rdma_run.sh b/tools/testing/selftests/net/rds/rds_rdma_run.sh new file mode 100755 index 0000000000000..eddd389431573 --- /dev/null +++ b/tools/testing/selftests/net/rds/rds_rdma_run.sh @@ -0,0 +1,11 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Runs the RDS selftest over the RDMA (RoCE/RXE) transport. +# +# This is a wrapper script for rds_run.sh to run and report results when using +# the -T rdma option +# +# Exits with the kselftest SKIP code if rds RDMA prerequisites are not met + +exec "$(dirname "$0")/rds_run.sh" -T rdma "$@" diff --git a/tools/testing/selftests/net/rds/run.sh b/tools/testing/selftests/net/rds/rds_run.sh similarity index 98% rename from tools/testing/selftests/net/rds/run.sh rename to tools/testing/selftests/net/rds/rds_run.sh index 07af2f927a2a7..ef16039be1ae5 100755 --- a/tools/testing/selftests/net/rds/run.sh +++ b/tools/testing/selftests/net/rds/rds_run.sh @@ -209,7 +209,7 @@ while getopts "d:l:c:u:t:T:" opt; do TRANSPORT=${OPTARG} ;; :) - echo "USAGE: run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]" \ + echo "USAGE: rds_run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]" \ "[-u packet_duplicate] [-t timeout] [-T tcp|rdma|tcp,rdma]" exit 1 ;; @@ -224,7 +224,7 @@ done IFS=',' read -ra transports <<< "$TRANSPORT" for t in "${transports[@]}"; do if [ "$t" != "tcp" ] && [ "$t" != "rdma" ]; then - echo "run.sh: unknown transport '$t' (expected tcp or rdma)" + echo "rds_run.sh: unknown transport '$t' (expected tcp or rdma)" exit 1 fi done diff --git a/tools/testing/selftests/net/rds/rds_tcp_run.sh b/tools/testing/selftests/net/rds/rds_tcp_run.sh new file mode 100755 index 0000000000000..fad4d047aac61 --- /dev/null +++ b/tools/testing/selftests/net/rds/rds_tcp_run.sh @@ -0,0 +1,11 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# +# Runs the RDS selftest over the TCP transport. +# +# This is a wrapper script for rds_run.sh to run and report results when using +# the -T tcp option +# +# Exits with the kselftest SKIP code if rds TCP prerequisites are not met + +exec "$(dirname "$0")/rds_run.sh" -T tcp "$@" -- 2.25.1