export TF_SKIP=/tmp/tf.skip
usage() {
- less -F <<EOF
+ less -F <<EOF
Usage ${0##*/} [options] suite [suite options] [suite [suite options]]
Run Lustre regression tests suites.
-c CONFIG Test environment config file
-f STR Config name (cfg/<name>.sh)
-g GROUP Test group file (Overrides tests listed on command line)
-S TESTSUITE First test suite to run allows for restarts
+ -H Honor the EXCEPT and ALWAYS_EXCEPT list when --only is used
-i N Repeat tests N times (default 1). A new directory
will be created under LOGDIR for each iteration.
-k Don't stop when subtests fail
auster -f large -g test-groups/regression -i 5
EOF
- exit
+ exit
}
dry_run=false
reformat=false
script_lang=bash
test_logs_dir=/tmp/test_logs/$(date +%Y-%m-%d)/$(date +%H%M%S)
+export HONOR_EXCEPT=
export ${SLOW:=no}
export ${NAME:=local}
-while getopts "c:d:D:nkf:S:g:i:rRslL:hv" opt
+while getopts "c:d:D:nkf:S:g:Hi:rRslL:hv" opt
do
case "$opt" in
c) export CONFIG=$OPTARG;;
k) export FAIL_ON_ERROR=false;;
n) dry_run=:;;
v) verbose=:;;
+ H) export HONOR_EXCEPT="y";;
i) repeat_count=$OPTARG;;
f) NAME=$OPTARG;;
R) do_reset=:;;
#
run_test() {
assert_DIR
-
export base=$(basetest $1)
- if [ -n "$ONLY" ]; then
- testname=ONLY_$1
- if [ ${!testname}x != x ]; then
- [ -n "$LAST_SKIPPED" ] && echo "" && LAST_SKIPPED=
- run_one_logged $1 "$2"
- return $?
- fi
- testname=ONLY_$base
- if [ ${!testname}x != x ]; then
- [ -n "$LAST_SKIPPED" ] && echo "" && LAST_SKIPPED=
- run_one_logged $1 "$2"
- return $?
- fi
- LAST_SKIPPED="y"
- return 0
- fi
+ TESTNAME=test_$1
+ LAST_SKIPPED=
+ ALWAYS_SKIPPED=
- LAST_SKIPPED="y"
- ALWAYS_SKIPPED="y"
- testname=EXCEPT_$1
+ # Check the EXCEPT, ALWAYS_EXCEPT and SLOW lists to see if we
+ # need to skip the current test. If so, set the ALWAYS_SKIPPED flag.
+ local testname=EXCEPT_$1
+ local testname_base=EXCEPT_$base
if [ ${!testname}x != x ]; then
- TESTNAME=test_$1 skip_noexit "skipping excluded test $1"
- return 0
- fi
- testname=EXCEPT_$base
- if [ ${!testname}x != x ]; then
- TESTNAME=test_$1 skip_noexit "skipping excluded test $1 (base $base)"
- return 0
+ ALWAYS_SKIPPED="y"
+ skip_message="skipping excluded test $1"
+ elif [ ${!testname_base}x != x ]; then
+ ALWAYS_SKIPPED="y"
+ skip_message="skipping excluded test $1 (base $base)"
fi
+
testname=EXCEPT_ALWAYS_$1
+ testname_base=EXCEPT_ALWAYS_$base
if [ ${!testname}x != x ]; then
- TESTNAME=test_$1 skip_noexit "skipping ALWAYS excluded test $1"
- return 0
- fi
- testname=EXCEPT_ALWAYS_$base
- if [ ${!testname}x != x ]; then
- TESTNAME=test_$1 skip_noexit "skipping ALWAYS excluded test $1 (base $base)"
- return 0
+ ALWAYS_SKIPPED="y"
+ skip_message="skipping ALWAYS excluded test $1"
+ elif [ ${!testname_base}x != x ]; then
+ ALWAYS_SKIPPED="y"
+ skip_message="skipping ALWAYS excluded test $1 (base $base)"
fi
+
testname=EXCEPT_SLOW_$1
+ testname_base=EXCEPT_SLOW_$base
if [ ${!testname}x != x ]; then
- TESTNAME=test_$1 skip_noexit "skipping SLOW test $1"
- return 0
+ ALWAYS_SKIPPED="y"
+ skip_message="skipping SLOW test $1"
+ elif [ ${!testname_base}x != x ]; then
+ ALWAYS_SKIPPED="y"
+ skip_message="skipping SLOW test $1 (base $base)"
fi
- testname=EXCEPT_SLOW_$base
- if [ ${!testname}x != x ]; then
- TESTNAME=test_$1 skip_noexit "skipping SLOW test $1 (base $base)"
- return 0
+
+ # If there are tests on the ONLY list, check if the current test
+ # is on that list and, if so, check if the test is to be skipped
+ # and if we are supposed to honor the skip lists.
+ if [ -n "$ONLY" ]; then
+ testname=ONLY_$1
+ testname_base=ONLY_$base
+ if [[ ${!testname}x != x || ${!testname_base}x != x ]]; then
+
+ if [[ -n "$ALWAYS_SKIPPED" && -n "$HONOR_EXCEPT" ]]; then
+ LAST_SKIPPED="y"
+ skip_noexit "$skip_message"
+ return 0
+ else
+ [ -n "$LAST_SKIPPED" ] &&
+ echo "" && LAST_SKIPPED=
+ ALWAYS_SKIPPED=
+ run_one_logged $1 "$2"
+ return $?
+ fi
+
+ else
+ LAST_SKIPPED="y"
+ return 0
+ fi
fi
- LAST_SKIPPED=
- ALWAYS_SKIPPED=
- run_one_logged $1 "$2"
+ if [ -n "$ALWAYS_SKIPPED" ]; then
+ LAST_SKIPPED="y"
+ skip_noexit "$skip_message"
+ return 0
+ else
+ run_one_logged $1 "$2"
+ return $?
+ fi
- return $?
}
log() {