Whamcloud - gitweb
LU-18356 tests: allow server to specify except list 01/56901/8
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 6 Nov 2024 04:00:06 +0000 (21:00 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 2 Dec 2024 05:55:33 +0000 (05:55 +0000)
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.

Test-Parameters: trivial testlist=sanity serverversion=2.15
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I0216d9980147ce3409807e9d7f9759fe533ebbe5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56901
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/Makefile.am
lustre/tests/except/README [new file with mode: 0644]
lustre/tests/except/sanity.ex [new file with mode: 0644]
lustre/tests/runtests
lustre/tests/test-framework.sh

index 483196e..9c8d166 100644 (file)
@@ -45,12 +45,9 @@ nobase_noinst_SCRIPTS += test-groups/regression test-groups/regression-mpi
 nobase_noinst_SCRIPTS += acl/make-tree acl/run cfg/ncli.sh
 nobase_noinst_SCRIPTS += racer/*.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)
diff --git a/lustre/tests/except/README b/lustre/tests/except/README
new file mode 100644 (file)
index 0000000..e2347e7
--- /dev/null
@@ -0,0 +1,39 @@
+# 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.
diff --git a/lustre/tests/except/sanity.ex b/lustre/tests/except/sanity.ex
new file mode 100644 (file)
index 0000000..3a6e7ba
--- /dev/null
@@ -0,0 +1,3 @@
+# facet op need_version             jira     space_separated_subtests
+mds1    <  v2_14_55-100-g8a84c7f9c7 LU-14927 0f
+client  >  v2_15_63-134-gdacc4b6d38 LU-15963 312
index 4a5b912..0a0f3ff 100755 (executable)
@@ -11,6 +11,8 @@ RUNTESTS_SRC=${RUNTESTS_SRC:-"/etc /bin"}
 [ "$COUNT" ] || COUNT=10000
 [ "$SLOW" = "no" ] && COUNT=1000
 
+build_test_filter
+
 [ "$MKDIRMANY" ] || MKDIRMANY="createmany -d"
 [ "$STATMANY" ] || STATMANY="statmany -s"
 [ "$RMDIRMANY" ] || RMDIRMANY="unlinkmany -d"
index b53df9b..27301e1 100755 (executable)
@@ -7308,7 +7308,8 @@ skip_eopnotsupp() {
 # 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
 
@@ -7338,6 +7339,28 @@ build_test_filter() {
                fi
        done
 
+       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" ]] ||