Whamcloud - gitweb
LU-18356 tests: allow server to specify except list
authorAndreas Dilger <adilger@whamcloud.com>
Wed, 6 Nov 2024 04:00:06 +0000 (21:00 -0700)
committerOleg Drokin <green@linuxhacker.ru>
Tue, 7 Jan 2025 02:19:43 +0000 (21:19 -0500)
commit61e8b82b4729c51db22fe7a087692e39c3056d93
treec6aca87c32f71026caea258f87cfca7c7ff57a0b
parentd92038bd31cb5c4693f9f6a11dfee8d770e8fce8
LU-18356 tests: allow server to specify except list

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
lustre/tests/Makefile.am
lustre/tests/conf-sanity.sh
lustre/tests/except/README [new file with mode: 0644]
lustre/tests/except/sanity.ex [new file with mode: 0644]
lustre/tests/functions.sh
lustre/tests/runtests
lustre/tests/sanity-pcc.sh
lustre/tests/test-framework.sh