All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v5 0/7] Add support for .max_kver
@ 2026-08-10 16:00 Petr Vorel
  2026-08-10 16:00 ` [LTP] [PATCH v5 1/7] tst_kvercmp: Factor out error handling Petr Vorel
                   ` (7 more replies)
  0 siblings, 8 replies; 23+ messages in thread
From: Petr Vorel @ 2026-08-10 16:00 UTC (permalink / raw)
  To: ltp

Hi all,

Changes v4->v5:
* Remove code which does metadata validation (3 commits, Cyril).
* Add commit to fix creat07.c timeout on test failure (agent).
* Use proper name for function (underscore at the end)
* Add one more test, increase max_kver in the test added previous
  version.

Link to v4:
https://lore.kernel.org/ltp/20260805151451.648990-1-pvorel@suse.cz/

Link to v3:
https://patchwork.kernel.org/project/ltp/list/?series=1138093&state=*
https://lore.kernel.org/ltp/20260731105132.187177-1-pvorel@suse.cz/T/#t

Link to v2:
https://lore.kernel.org/ltp/6a6a2091.9b80fa5d.4e4ae.7aac@mx.google.com/T/#t

Link to v1:
https://lore.kernel.org/ltp/20260729091717.23042-1-pvorel@suse.cz/T/#t
https://patchwork.ozlabs.org/project/ltp/list/?series=516120&state=*


Petr Vorel (7):
  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: Avoid timeout on the test failure
  creat07: execve04: Remove version check, add linux-git
  fanotify20: Skip on v7.2
  lib: Add 2 basic tests for .min_kver && .max_kver

 doc/developers/writing_tests.rst              |  3 +
 include/tst_test.h                            | 13 +++-
 lib/newlib_tests/.gitignore                   |  2 +
 lib/newlib_tests/runtest.sh                   |  2 +
 lib/newlib_tests/tst_max_kver_old.c           | 21 +++++++
 lib/newlib_tests/tst_min_kver_max_kver.c      | 22 +++++++
 lib/tst_kvercmp.c                             | 23 ++++++--
 lib/tst_test.c                                | 59 +++++++++++++++----
 testcases/kernel/syscalls/creat/creat07.c     | 23 ++++----
 testcases/kernel/syscalls/execve/execve04.c   | 24 ++++----
 .../kernel/syscalls/fanotify/fanotify20.c     |  4 ++
 11 files changed, 156 insertions(+), 40 deletions(-)
 create mode 100644 lib/newlib_tests/tst_max_kver_old.c
 create mode 100644 lib/newlib_tests/tst_min_kver_max_kver.c

-- 
2.55.0


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

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [LTP] [PATCH v4 1/9] tst_kvercmp: Factor out error handling
@ 2026-08-05 15:14 Petr Vorel
  2026-08-05 17:33 ` [LTP] " linuxtestproject.agent
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Petr Vorel @ 2026-08-05 15:14 UTC (permalink / raw)
  To: ltp

Error check was already on 2 places (and possibly more will be added in
the future).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
New in v4.

 lib/tst_kvercmp.c | 23 +++++++++++++++++------
 lib/tst_test.c    |  6 +-----
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/lib/tst_kvercmp.c b/lib/tst_kvercmp.c
index 9e1a511aff..c0714073d4 100644
--- a/lib/tst_kvercmp.c
+++ b/lib/tst_kvercmp.c
@@ -45,7 +45,7 @@ static char *parse_digit(const char *str, int *d)
 	return end;
 }
 
-int tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)
+static int _tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)
 {
 	const char *str = str_kver;
 
@@ -81,17 +81,28 @@ int tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)
 	return 0;
 }
 
-int tst_kvcmp(const char *cur_kver, int r1, int r2, int r3)
+int tst_parse_kver(const char *str_kver, int *v1, int *v2, int *v3)
 {
-	int a1, a2, a3;
-	int testver, currver;
+	int rc;
+
+	rc = _tst_parse_kver(str_kver, v1, v2, v3);
 
-	if (tst_parse_kver(cur_kver, &a1, &a2, &a3)) {
+	if (rc) {
 		tst_resm(TWARN,
 			 "Invalid kernel version %s, expected %%d.%%d.%%d",
-		         cur_kver);
+		         str_kver);
 	}
 
+	return rc;
+}
+
+int tst_kvcmp(const char *cur_kver, int r1, int r2, int r3)
+{
+	int a1, a2, a3;
+	int testver, currver;
+
+	tst_parse_kver(cur_kver, &a1, &a2, &a3);
+
 	testver = (r1 << 20) + (r2 << 10) + r3;
 	currver = (a1 << 20) + (a2 << 10) + a3;
 
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 5c3607016e..351b155700 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -1067,11 +1067,7 @@ static bool check_kver(const char *min_kver, const int brk_nosupp)
 	char *msg;
 	int v1, v2, v3;
 
-	if (tst_parse_kver(min_kver, &v1, &v2, &v3)) {
-		tst_res(TWARN,
-			"Invalid kernel version %s, expected %%d.%%d.%%d",
-			min_kver);
-	}
+	tst_parse_kver(min_kver, &v1, &v2, &v3);
 
 	if (tst_kvercmp(v1, v2, v3) < 0) {
 		msg = "The test requires kernel %s or newer";
-- 
2.55.0


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

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2026-08-11 10:10 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-10 16:00 [LTP] [PATCH v5 0/7] Add support for .max_kver Petr Vorel
2026-08-10 16:00 ` [LTP] [PATCH v5 1/7] tst_kvercmp: Factor out error handling Petr Vorel
2026-08-10 16:57   ` [LTP] " linuxtestproject.agent
2026-08-10 17:03     ` Petr Vorel
2026-08-11  7:01   ` [LTP] [PATCH v5 1/7] " Andrea Cervesato via ltp
2026-08-10 16:00 ` [LTP] [PATCH v5 2/7] lib: Rename function check_kver() => check_min_kver() Petr Vorel
2026-08-10 16:00 ` [LTP] [PATCH v5 3/7] lib: Add support for max_kver to struct tst_test and tst_fs Petr Vorel
2026-08-11  7:04   ` Andrea Cervesato via ltp
2026-08-10 16:00 ` [LTP] [PATCH v5 4/7] creat07: Avoid timeout on the test failure Petr Vorel
2026-08-11  7:04   ` Andrea Cervesato via ltp
2026-08-10 16:00 ` [LTP] [PATCH v5 5/7] creat07: execve04: Remove version check, add linux-git Petr Vorel
2026-08-10 16:00 ` [LTP] [PATCH v5 6/7] fanotify20: Skip on v7.2 Petr Vorel
2026-08-10 16:00 ` [LTP] [PATCH v5 7/7] lib: Add 2 basic tests for .min_kver && .max_kver Petr Vorel
2026-08-11  7:13   ` Andrea Cervesato via ltp
2026-08-11  8:49     ` Petr Vorel
2026-08-11  8:53       ` Andrea Cervesato via ltp
2026-08-11 10:10   ` Avinesh Kumar via ltp
2026-08-11  1:45 ` [LTP] [PATCH v5 0/7] Add support for .max_kver Li Wang
  -- strict thread matches above, loose matches on Subject: below --
2026-08-05 15:14 [LTP] [PATCH v4 1/9] tst_kvercmp: Factor out error handling Petr Vorel
2026-08-05 17:33 ` [LTP] " linuxtestproject.agent
2026-08-05 17:33 ` linuxtestproject.agent
2026-08-05 17:34 ` linuxtestproject.agent
2026-08-05 17:35 ` linuxtestproject.agent
2026-08-10 12:02   ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.