public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes
@ 2023-01-03 17:50 Petr Vorel
  2023-01-03 17:50 ` [LTP] [PATCH 1/3] doc/c-test-api.txt: Update tst_kvercmp{2, }() use Petr Vorel
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Petr Vorel @ 2023-01-03 17:50 UTC (permalink / raw)
  To: ltp

Petr Vorel (3):
  doc/c-test-api.txt: Update tst_kvercmp{2,}() use
  doc/shell-test-api.txt: Improve tst_kvcmp doc
  doc/API: Link to minimal supported kernel version

 doc/c-test-api.txt     | 20 ++++++++++++++++++--
 doc/shell-test-api.txt | 13 +++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

-- 
2.39.0


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

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

* [LTP] [PATCH 1/3] doc/c-test-api.txt: Update tst_kvercmp{2, }() use
  2023-01-03 17:50 [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes Petr Vorel
@ 2023-01-03 17:50 ` Petr Vorel
  2023-01-03 17:54   ` Petr Vorel
  2023-01-03 17:50 ` [LTP] [PATCH 2/3] doc/shell-test-api.txt: Improve tst_kvcmp doc Petr Vorel
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2023-01-03 17:50 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/c-test-api.txt | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt
index bc2d479452..a3ee9cab47 100644
--- a/doc/c-test-api.txt
+++ b/doc/c-test-api.txt
@@ -584,8 +584,21 @@ positive means that it's newer.
 
 The second function 'tst_kvercmp2()' allows for specifying per-vendor table of
 kernel versions as vendors typically backport fixes to their kernels and the
-test may be relevant even if the kernel version does not suggests so. See
-'testcases/kernel/syscalls/inotify/inotify04.c' for example usage.
+test may be relevant even if the kernel version does not suggests so.
+
+[source,c]
+-------------------------------------------------------------------------------
+if (tst_kvercmp(5, 19, 0) >= 0)
+	tst_res(TCONF, "Test valid only for kernel < 5.19");
+
+static struct tst_kern_exv kvers[] = {
+	{ "UBUNTU", "4.4.0-48.69" },
+	{ NULL, NULL},
+};
+
+if (tst_kvercmp2(4, 4, 27, kvers) < 0)
+	/* code for kernel < v4.4.27 or ubuntu kernel < 4.4.0-48.69 */
+-------------------------------------------------------------------------------
 
 WARNING: The shell 'tst_kvercmp' maps the result into unsigned integer - the
          process exit value.
-- 
2.39.0


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

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

* [LTP] [PATCH 2/3] doc/shell-test-api.txt: Improve tst_kvcmp doc
  2023-01-03 17:50 [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes Petr Vorel
  2023-01-03 17:50 ` [LTP] [PATCH 1/3] doc/c-test-api.txt: Update tst_kvercmp{2, }() use Petr Vorel
@ 2023-01-03 17:50 ` Petr Vorel
  2023-01-03 17:50 ` [LTP] [PATCH 3/3] doc/API: Link to minimal supported kernel version Petr Vorel
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2023-01-03 17:50 UTC (permalink / raw)
  To: ltp

Add examples which use tst_kvercmp2() functionality + link to C API.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/shell-test-api.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt
index 6ad7ed6803..b1e6c1b1dd 100644
--- a/doc/shell-test-api.txt
+++ b/doc/shell-test-api.txt
@@ -665,6 +665,10 @@ fi
 if tst_kvcmp -gt 3.16 -a -lt 4.0.1; then
 	tst_brk TCONF "Kernel must be older than 3.16 or newer than 4.0.1"
 fi
+
+if tst_kvcmp -lt "6.1 RHEL9:5.14.0-191"; then
+	# code for kernel < 6.1 or RHEL9 kernel < 5.14.0-191
+fi
 -------------------------------------------------------------------------------
 
 [options="header"]
@@ -683,6 +687,12 @@ fi
 The format for kernel version has to either be with one dot e.g. '2.6' or with
 two dots e.g. '4.8.1'.
 
+Kernel version can also be followed by a space separated list of extra versions
+prefixed by distribution which when matched take precedence, e.g. '6.1 RHEL9:5.14.0-191'.
+
+For more info see 'tst_kvercmp()' and 'tst_kvercmp2()' in
+https://github.com/linux-test-project/ltp/wiki/C-Test-API#16-runtime-kernel-version-detection[C Test API].
+
 tst_fs_has_free
 +++++++++++++++
 
-- 
2.39.0


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

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

* [LTP] [PATCH 3/3] doc/API: Link to minimal supported kernel version
  2023-01-03 17:50 [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes Petr Vorel
  2023-01-03 17:50 ` [LTP] [PATCH 1/3] doc/c-test-api.txt: Update tst_kvercmp{2, }() use Petr Vorel
  2023-01-03 17:50 ` [LTP] [PATCH 2/3] doc/shell-test-api.txt: Improve tst_kvcmp doc Petr Vorel
@ 2023-01-03 17:50 ` Petr Vorel
  2023-01-04  5:03 ` [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes xuyang2018.jy
  2023-01-10  9:54 ` Richard Palethorpe
  4 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2023-01-03 17:50 UTC (permalink / raw)
  To: ltp

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 doc/c-test-api.txt     | 3 +++
 doc/shell-test-api.txt | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/doc/c-test-api.txt b/doc/c-test-api.txt
index a3ee9cab47..a7dd59dac5 100644
--- a/doc/c-test-api.txt
+++ b/doc/c-test-api.txt
@@ -603,6 +603,9 @@ if (tst_kvercmp2(4, 4, 27, kvers) < 0)
 WARNING: The shell 'tst_kvercmp' maps the result into unsigned integer - the
          process exit value.
 
+NOTE: See also LTP
+      https://github.com/linux-test-project/ltp/wiki/Supported-kernel,-libc,-toolchain-versions#13-minimal-supported-kernel-version[minimal supported kernel version].
+
 1.7 Fork()-ing
 ~~~~~~~~~~~~~~
 
diff --git a/doc/shell-test-api.txt b/doc/shell-test-api.txt
index b1e6c1b1dd..e5c9186605 100644
--- a/doc/shell-test-api.txt
+++ b/doc/shell-test-api.txt
@@ -693,6 +693,9 @@ prefixed by distribution which when matched take precedence, e.g. '6.1 RHEL9:5.1
 For more info see 'tst_kvercmp()' and 'tst_kvercmp2()' in
 https://github.com/linux-test-project/ltp/wiki/C-Test-API#16-runtime-kernel-version-detection[C Test API].
 
+NOTE: See also LTP
+      https://github.com/linux-test-project/ltp/wiki/Supported-kernel,-libc,-toolchain-versions#13-minimal-supported-kernel-version[minimal supported kernel version].
+
 tst_fs_has_free
 +++++++++++++++
 
-- 
2.39.0


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

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

* Re: [LTP] [PATCH 1/3] doc/c-test-api.txt: Update tst_kvercmp{2, }() use
  2023-01-03 17:50 ` [LTP] [PATCH 1/3] doc/c-test-api.txt: Update tst_kvercmp{2, }() use Petr Vorel
@ 2023-01-03 17:54   ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2023-01-03 17:54 UTC (permalink / raw)
  To: ltp

Hi,

Suggested-by: Yang Xu <xuyang2018.jy@fujitsu.com>

Kind regards,
Petr


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

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

* Re: [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes
  2023-01-03 17:50 [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes Petr Vorel
                   ` (2 preceding siblings ...)
  2023-01-03 17:50 ` [LTP] [PATCH 3/3] doc/API: Link to minimal supported kernel version Petr Vorel
@ 2023-01-04  5:03 ` xuyang2018.jy
  2023-01-10  9:54 ` Richard Palethorpe
  4 siblings, 0 replies; 8+ messages in thread
From: xuyang2018.jy @ 2023-01-04  5:03 UTC (permalink / raw)
  To: Petr Vorel, ltp@lists.linux.it

Hi Petr

For this patchset, you can add

Reviewed-by: Yang Xu <xuyang2018.jy@fujitsu.com>

Best Regards
Yang Xu

> Petr Vorel (3):
>    doc/c-test-api.txt: Update tst_kvercmp{2,}() use
>    doc/shell-test-api.txt: Improve tst_kvcmp doc
>    doc/API: Link to minimal supported kernel version
> 
>   doc/c-test-api.txt     | 20 ++++++++++++++++++--
>   doc/shell-test-api.txt | 13 +++++++++++++
>   2 files changed, 31 insertions(+), 2 deletions(-)
> 

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

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

* Re: [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes
  2023-01-03 17:50 [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes Petr Vorel
                   ` (3 preceding siblings ...)
  2023-01-04  5:03 ` [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes xuyang2018.jy
@ 2023-01-10  9:54 ` Richard Palethorpe
  2023-01-10 16:26   ` Petr Vorel
  4 siblings, 1 reply; 8+ messages in thread
From: Richard Palethorpe @ 2023-01-10  9:54 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hello,

Please merge.

Acked-by: Richard Palethorpe <rpalethorpe@suse.com>

Petr Vorel <pvorel@suse.cz> writes:

> Petr Vorel (3):
>   doc/c-test-api.txt: Update tst_kvercmp{2,}() use
>   doc/shell-test-api.txt: Improve tst_kvcmp doc
>   doc/API: Link to minimal supported kernel version
>
>  doc/c-test-api.txt     | 20 ++++++++++++++++++--
>  doc/shell-test-api.txt | 13 +++++++++++++
>  2 files changed, 31 insertions(+), 2 deletions(-)
>
> -- 
> 2.39.0


-- 
Thank you,
Richard.

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

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

* Re: [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes
  2023-01-10  9:54 ` Richard Palethorpe
@ 2023-01-10 16:26   ` Petr Vorel
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2023-01-10 16:26 UTC (permalink / raw)
  To: Richard Palethorpe; +Cc: ltp

Hi all,

merged. Thanks for your review!

Kind regards,
Petr

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

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

end of thread, other threads:[~2023-01-10 16:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-03 17:50 [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes Petr Vorel
2023-01-03 17:50 ` [LTP] [PATCH 1/3] doc/c-test-api.txt: Update tst_kvercmp{2, }() use Petr Vorel
2023-01-03 17:54   ` Petr Vorel
2023-01-03 17:50 ` [LTP] [PATCH 2/3] doc/shell-test-api.txt: Improve tst_kvcmp doc Petr Vorel
2023-01-03 17:50 ` [LTP] [PATCH 3/3] doc/API: Link to minimal supported kernel version Petr Vorel
2023-01-04  5:03 ` [LTP] [PATCH 0/3] doc: tst_kvercmp2 related fixes xuyang2018.jy
2023-01-10  9:54 ` Richard Palethorpe
2023-01-10 16:26   ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox