]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: rds: Add timeout flag to run.sh
authorAllison Henderson <achender@kernel.org>
Mon, 4 May 2026 05:41:37 +0000 (22:41 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 6 May 2026 02:19:54 +0000 (19:19 -0700)
Add a -t flag to run.sh to optionally override the default
timeout.  The --timeout flag is already supported in test.py,
so just add the shorthand -t flag

Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20260504054143.4027538-5-achender@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/rds/README.txt
tools/testing/selftests/net/rds/run.sh
tools/testing/selftests/net/rds/test.py

index 8df6cc35dd103936c16767f00d8c7f42d8cd090c..be9c7e25694ec326f7170c60c5686d011a1c21ca 100644 (file)
@@ -12,7 +12,7 @@ kernel may optionally be configured to omit the coverage report as well.
 
 USAGE:
        run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]
-              [-u packet_duplicate]
+              [-u packet_duplicate] [-t timeout]
 
 OPTIONS:
        -d      Log directory.  Defaults to tools/testing/selftests/net/rds/rds_logs
@@ -23,6 +23,8 @@ OPTIONS:
 
        -u      Simulates a percentage of packet duplication.
 
+       -t      Test timeout.  Defaults to tools/testing/selftests/net/rds/settings
+
 EXAMPLE:
 
     # Create a suitable gcov enabled .config
index 73a9b986b0ef4f29bfcd3112864e0519852a268b..bc2e53126aab7fcc5dd20abebed2ae601badb4e2 100755 (executable)
@@ -154,8 +154,9 @@ LOG_DIR="$current_dir"/rds_logs
 PLOSS=0
 PCORRUPT=0
 PDUP=0
+TIMEOUT=$timeout
 GENERATE_GCOV_REPORT=1
-while getopts "d:l:c:u:" opt; do
+while getopts "d:l:c:u:t:" opt; do
   case ${opt} in
     d)
       LOG_DIR=${OPTARG}
@@ -166,12 +167,15 @@ while getopts "d:l:c:u:" opt; do
     c)
       PCORRUPT=${OPTARG}
       ;;
+    t)
+      TIMEOUT=${OPTARG}
+      ;;
     u)
       PDUP=${OPTARG}
       ;;
     :)
       echo "USAGE: run.sh [-d logdir] [-l packet_loss] [-c packet_corruption]" \
-           "[-u packet_duplicate]"
+           "[-u packet_duplicate] [-t timeout]"
       exit 1
       ;;
     ?)
@@ -198,7 +202,8 @@ echo running RDS tests...
 echo Traces will be logged to "$TRACE_FILE"
 rm -f "$TRACE_FILE"
 strace -T -tt -o "$TRACE_FILE" python3 "$(dirname "$0")/test.py" \
-       --timeout "$timeout" -d "$LOG_DIR" -l "$PLOSS" -c "$PCORRUPT" -u "$PDUP"
+       -t "$TIMEOUT" -d "$LOG_DIR" -l "$PLOSS" -c "$PCORRUPT" \
+       -u "$PDUP"
 
 test_rc=$?
 dmesg > "${LOG_DIR}/dmesg.out"
index 4b6ffbb3a81cb2f4e8c70c9243aa27b69e2501ba..d48533505f0f76301f06b1a772f5f78f6300498a 100755 (executable)
@@ -83,7 +83,7 @@ parser = argparse.ArgumentParser(description="init script args",
                   formatter_class=argparse.ArgumentDefaultsHelpFormatter)
 parser.add_argument("-d", "--logdir", action="store",
                     help="directory to store logs", default="/tmp")
-parser.add_argument('--timeout', help="timeout to terminate hung test",
+parser.add_argument('-t', '--timeout', help="timeout to terminate hung test",
                     type=int, default=0)
 parser.add_argument('-l', '--loss', help="Simulate tcp packet loss",
                     type=int, default=0)