[LTP] [PATCH 2/3] doc/shell-test-api.txt: Improve tst_kvcmp doc

Petr Vorel pvorel@suse.cz
Tue Jan 3 18:50:58 CET 2023


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



More information about the ltp mailing list