From 9334a8de8a061ee139784a2e13974be373b2b01b Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Wed, 8 Jul 2020 19:05:50 +0200 Subject: run-tests.sh improvements Added --help and -R options. -R sets $retry to "no"; so far there was no way to disable retrying (default value for $retry is yes and threre was an option only for enablement). Change-Id: Ia7cedac52be72fe2abd60fb6bdd1927cfda0e229 Updates: #1000 Signed-off-by: Csaba Henk --- run-tests.sh | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'run-tests.sh') diff --git a/run-tests.sh b/run-tests.sh index 2768adb5afd..dc25d8cca31 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -512,8 +512,38 @@ function run_head_tests() run_tests "$htests" } -function parse_args () { - args=`getopt frcbkphHno:t: "$@"` +function show_usage () +{ + cat < [|]... + +Options: + +-f force +-h skip tests altering from HEAD +-H run only tests altering from HEAD +-r retry failed tests +-R do not retry failed tests +-c dont't exit on failure +-b don't skip bad tests +-k don't skip known bugs +-p don't keep logs from preceding runs +-o OUTPUT +-t TIMEOUT +-n skip NFS tests +--help +EOF +} + +usage="no" + +function parse_args () +{ + args=`getopt -u -l help frRcbkphHno:t: "$@"` + if ! [ $? -eq 0 ]; then + show_usage + exit 1 + fi set -- $args while [ $# -gt 0 ]; do case "$1" in @@ -521,6 +551,7 @@ function parse_args () { -h) head="no" ;; -H) head="only" ;; -r) retry="yes" ;; + -R) retry="no" ;; -c) exit_on_failure="no" ;; -b) skip_bad_tests="no" ;; -k) skip_known_bugs="no" ;; @@ -528,6 +559,7 @@ function parse_args () { -o) result_output="$2"; shift;; -t) run_timeout="$2"; shift;; -n) nfs_tests="no";; + --help) usage="yes" ;; --) shift; break;; esac shift @@ -542,6 +574,10 @@ echo # Get user options parse_args "$@" +if [ x"$usage" == x"yes" ]; then + show_usage + exit 0 +fi # Make sure we're running as the root user check_user -- cgit