[PATCH v4 0/6] Add support for .max_kver

Petr Vorel <[email protected]> Wed, 5 Aug 2026 17:14:42 +0200
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi all,

[RFC]
Li suggested [1] to .min_kver > .max_kver should be rejected, or at
least reported as broken test metadata.

I decided to add check to metadata parser (that required to link
metaparse.c against libltp.a). Runtime check with TWARN would be also
good, but let's discuss that first (if not, I'll remove TODO from
tst_test.c). Hence this part is [RFC].

Hopefully it's the last version :).

Kind regards,
Petr

[1] https://lore.kernel.org/ltp/[email protected]/

Changes v3->v4:
* creat07: execve04: does not use max_kver, instead:
  creat07: execve04: Remove version check, add linux-git
* New commits:
  - tst_kvercmp: Factor out error handling
  - tst_kvercmp: Factor out 2 kernels integer comparison
  - [RFC] make: Allow to add LTP library as a dependency for host
  - [RFC] metaparse: Check {min,max}_kver validity

Changes in 3rd commit
* Mention flag in doc/developers/writing_tests.rst
* Fix doc (agent):
- * on any stable release (test with ``min_kver = "7.1"`` runs also on kernel
+ * on any stable release (test with ``max_kver = "7.1"`` runs also on kernel
* Fix checkpatch style (agent):
-       for (i=0, dots=0; max_kver[i]; i++)
+       for (i = 0, dots = 0; max_kver[i]; i++)

Link to v3:
https://patchwork.kernel.org/project/ltp/list/?series=1138093&state=*
https://lore.kernel.org/ltp/[email protected]/T/#t

Link to v2:
https://lore.kernel.org/ltp/6a6a2091.9b80fa5d.4e4ae.7aac-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org/T/#t

Link to v1:
https://lore.kernel.org/ltp/[email protected]/T/#t
https://patchwork.ozlabs.org/project/ltp/list/?series=516120&state=*

Petr Vorel (9):
  tst_kvercmp: Factor out error handling
  lib: Rename function check_kver() => check_min_kver()
  lib: Add support for max_kver to struct tst_test and tst_fs
  creat07: execve04: Remove version check, add linux-git
  fanotify20: Skip on v7.2
  lib: Add basic test for .min_kver && .max_kver
  tst_kvercmp: Factor out 2 kernels integer comparison
  [RFC] make: Allow to add LTP library as a dependency for host
  [RFC] metaparse: Check {min,max}_kver validity

 doc/developers/writing_tests.rst              |  3 +
 include/mk/generic_leaf_target.inc            |  5 +-
 include/tst_kvercmp.h                         | 12 ++++
 include/tst_test.h                            | 13 +++-
 lib/newlib_tests/.gitignore                   |  1 +
 lib/newlib_tests/runtest.sh                   |  1 +
 lib/newlib_tests/tst_min_kver_max_kver.c      | 21 +++++++
 lib/tst_kvercmp.c                             | 35 ++++++++---
 lib/tst_test.c                                | 61 ++++++++++++++++---
 metadata/Makefile                             |  6 +-
 metadata/metaparse.c                          | 33 ++++++++++
 testcases/kernel/syscalls/creat/creat07.c     | 20 +++---
 testcases/kernel/syscalls/execve/execve04.c   | 24 ++++----
 .../kernel/syscalls/fanotify/fanotify20.c     |  4 ++
 14 files changed, 194 insertions(+), 45 deletions(-)
 create mode 100644 lib/newlib_tests/tst_min_kver_max_kver.c

-- 
2.55.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp