Allow the installed server code to specify a lists of subtests that
should be excluded by older clients when running a particular test
script. This allows older clients to skip tests that they would
otherwise run from their local test script, but that do not work due
to server changes.
The files for each test script are read from the mds1 and ost1 facets.
The filename(s) under lustre/tests/except/ should start with the base
test script name (e.g. sanity), followed by '.', an optional unique
string to avoid conflicts between patches, and end with ".ex".
For example, sanity.ex, sanity.test_142.ex, sanity.acl.ex are valid
"sanity.sh" except filenames, but sanity-acl.ex is not.
Lines starting with '#' are comments and ignored. Otherwise, lines
should have whitespace-separated fields on each line, as shown in the
examples below.
#facet op need_version jira space_separated_subtests
mds1 < v2_14_55-100-g8a84c7f9c7 LU-14927 0f
linux < 5.12.0 LU-18102 27J
client == OST1_VERSION LU-13081 151 156
The facet may be "client", "mds1", "ost1", or "linux" (client), and
"need_version" can be any Lustre (or Linux) version number or another
version name like OST1_VERSION, MDS1_VERSION, or CLIENT_VERSION.
The "op" can be standard math/logic comparisons ">=", "<", "!=", etc.
The version comparison is handled like the below pseudo-code:
${FACET}_VERSION $op $need_version OR except $subtests
In other words, the version check must be true or the subtest(s) will
not be run. Checks within a single file should be ordered by subtest
number to make it easier to see whether some subtest is being skipped.
Lustre-change: https://review.whamcloud.com/56901
Lustre-commit:
c4c3a7350b55ace0c38123c4b820c713f42e1cb7
Fix tests using "sh TESTSCRIPT.sh" instead of "bash TESTSCRIPT.sh"
to start a script that is calling test-framework.sh, since that
would now run afoul of the bashism that is added in this patch.
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I0216d9980147ce3409807e9d7f9759fe533ebbe5
nobase_noinst_SCRIPTS += racer/file_mknod.sh racer/file_setxattr.sh racer/file_truncate.sh
nobase_noinst_SCRIPTS += racer/lss_create.sh racer/lss_destroy.sh
nobase_noinst_SCRIPTS += posix/posix.cfg
-nobase_noinst_DATA = acl/cp.test acl/getfacl-noacl.test acl/inheritance.test
-nobase_noinst_DATA += acl/misc.test acl/permissions.test acl/setfacl.test
-nobase_noinst_DATA += acl/permissions_xattr.test
-nobase_noinst_DATA += acl/974.test acl/974_remote.test
-nobase_noinst_DATA += acl/2561.test acl/2561_zfs.test acl/4924.test
+nobase_noinst_DATA = acl/*.test
nobase_noinst_DATA += clientapi/simple_test.c
+nobase_noinst_DATA += except/*.ex
EXTRA_DIST = $(noinst_SCRIPTS) $(noinst_DATA) \
$(nobase_noinst_SCRIPTS) $(nobase_noinst_DATA)
test_34a() {
setup
- do_facet client "sh runmultiop_bg_pause $DIR/file O_c"
+ do_facet client "bash runmultiop_bg_pause $DIR/file O_c"
manual_umount_client
rc=$?
do_facet client killall -USR1 multiop
--- /dev/null
+# The files in this directory contain lists of subtests that should
+# be excluded by older clients when running a particular test
+# script. This allows older clients to skip tests that they would
+# otherwise run from their local test script, but that do not work due
+# to server changes.
+#
+# The files for each test script are read from the mds1 and ost1 facet
+# nodes. The filename(s) under lustre/tests/except/ should start with
+# the base test script name (e.g. sanity), followed by '.', an optional
+# unique string to avoid conflicts between patches, and end with ".ex".
+# Lines are handled in build_test_filter() to check subtests to exclude.
+#
+# The files for each test script are read from the mds1 and ost1 facets.
+# The filename(s) under lustre/tests/except/ should start with the base
+# test script name (e.g. sanity), followed by '.', an optional unique
+# string to avoid conflicts between patches, and end with ".ex".
+# Lines are handled in build_test_filter() to check subtests to exclude.
+#
+# Lines starting with '#' are comments and ignored. Otherwise, lines
+# should have whitespace-separated fields on each line, as shown in the
+# examples below.
+#
+# facet op need_version jira space_separated_subtests
+# mds1 < v2_14_55-100-g8a84c7f9c7 LU-14927 0f
+# linux < 5.12.0 LU-18102 27J
+# ost1 == CLIENT_VERSION LU-13081 151 156
+#
+# The facet may be "client", "mds1", "ost1", or "linux" (client), and
+# "need_version" can be any Lustre (or Linux) version number or another
+# version name like OST1_VERSION, MDS1_VERSION, or CLIENT_VERSION.
+#
+# The version comparison is something like the below pseudo-code:
+#
+# (( ${FACET}_VERSION $op $need_version )) ||
+# always_except $ticket $subtests
+#
+# In other words, the version check must be true or subtest(s) will
+# not be run. Checks within a single file should be ordered by subtest
+# number to make it easier to see whether some subtest is being skipped.
--- /dev/null
+# facet op need_version jira space_separated_subtests
+mds1 < v2_14_55-100-g8a84c7f9c7 LU-14927 0f
fi
echo "tests: $tests"
for test in $tests; do
- local cmd="sh ./runtests -N $cnt_NRUN $test -f $testdir"
+ local cmd="bash ./runtests -N $cnt_NRUN $test -f $testdir"
local rc=0
log "$cmd"
[ "$COUNT" ] || COUNT=10000
[ "$SLOW" = "no" ] && COUNT=1000
+build_test_filter
+
[ "$MKDIRMANY" ] || MKDIRMANY="createmany -d"
[ "$STATMANY" ] || STATMANY="statmany -s"
[ "$RMDIRMANY" ] || RMDIRMANY="unlinkmany -d"
# File is owned by root, make it accessible to RUNAS user
chmod a+rw $DIR/$tdir/$tfile.shell
stack_trap 'rm -f $DIR/$tdir/$tfile.shell' EXIT
- do_facet $SINGLEAGT nsenter -t $PID -U -m "sh $DIR/$tdir/$tfile.shell"
+ do_facet $SINGLEAGT nsenter -t $PID -U -m "bash $DIR/$tdir/$tfile.shell"
do_facet $SINGLEAGT nsenter -t $PID -U -m $LFS pcc attach -i $HSM_ARCHIVE_NUMBER \
$file || error "RW-PCC attach $file failed"
check_lpcc_state $file "readwrite"
# Add a list of tests to ALWAYS_EXCEPT due to an issue.
# Usage: always_except LU-4815 23 42q ...
#
-function always_except() {
+function \
+always_except() {
local issue="${1:-}" # single jira style issue ("LU-4815")
local test_num
fi
done
- [ "$EXCEPT$ALWAYS_EXCEPT" ] &&
- log "excepting tests: `echo $EXCEPT $ALWAYS_EXCEPT`"
- [ "$EXCEPT_SLOW" ] &&
- log "skipping tests SLOW=no: `echo $EXCEPT_SLOW`"
+ local nodes=$(comma_list $(facets_nodes mds1,ost1))
+ local exceptions="$LUSTRE/tests/except/$TESTSUITE.*ex"
+
+ do_nodes --verbose $nodes "ls $exceptions || true"
+ while read facet op need_ver jira subs; do
+ local have_ver_code=${facet^^*}_VERSION
+ local need_ver_code
+
+ [[ "$facet" =~ "#" ]] && continue
+ [[ "$need_ver" =~ _VERSION ]] && need_ver_code=$need_ver ||
+ need_ver_code=$(version_code $need_ver)
+
+ (( ${!have_ver_code} $op $need_ver_code )) &&
+ echo "- see $facet $op $need_ver for $jira, go $subs" ||
+ {
+ log "- need $facet $op $need_ver for $jira, skip $subs"
+ for E in $subs; do
+ eval EXCEPT_${E}=true
+ done
+ }
+ done < <(do_nodes $nodes "cat $exceptions 2>/dev/null ||true" | sort -u)
+
+ [[ -z "$EXCEPT$ALWAYS_EXCEPT" ]] ||
+ log "excepting tests: $(echo $EXCEPT $ALWAYS_EXCEPT)"
+ [[ -z "$EXCEPT_SLOW" ]] ||
+ log "skipping tests SLOW=no: $(echo $EXCEPT_SLOW)"
for E in $EXCEPT; do
eval EXCEPT_${E}=true
done