Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH] lib/tst_test.sh: add TST_MIN_KVER variable check
@ 2018-04-16 11:17 Alexey Kodanev
  2018-04-17 11:26 ` Cyril Hrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kodanev @ 2018-04-16 11:17 UTC (permalink / raw)
  To: ltp

Add the same behavior as in LTP C library with 'min_kver'.

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 testcases/lib/tst_test.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index b7aa4a7..4ac09ef 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -251,7 +251,7 @@ tst_run()
 	if [ -n "$TST_TEST_PATH" ]; then
 		for tst_i in $(grep TST_ "$TST_TEST_PATH" | sed 's/.*TST_//; s/[="} \t\/:`].*//'); do
 			case "$tst_i" in
-			SETUP|CLEANUP|TESTFUNC|ID|CNT);;
+			SETUP|CLEANUP|TESTFUNC|ID|CNT|MIN_KVER);;
 			OPTS|USAGE|PARSE_ARGS|POS_ARGS);;
 			NEEDS_ROOT|NEEDS_TMPDIR|NEEDS_DEVICE|DEVICE);;
 			NEEDS_CMDS|NEEDS_MODULE|MODPATH|DATAROOT);;
@@ -290,6 +290,11 @@ tst_run()
 
 	tst_check_cmds $TST_NEEDS_CMDS
 
+	if [ -n "$TST_MIN_KVER" ]; then
+		tst_kvcmp -lt "$TST_MIN_KVER" && \
+			tst_brk TCONF "test requires kernel $TST_MIN_KVER+"
+	fi
+
 	if [ "$TST_NEEDS_TMPDIR" = 1 ]; then
 		if [ -z "$TMPDIR" ]; then
 			export TMPDIR="/tmp"
-- 
1.7.1


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

end of thread, other threads:[~2018-04-17 15:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-16 11:17 [LTP] [PATCH] lib/tst_test.sh: add TST_MIN_KVER variable check Alexey Kodanev
2018-04-17 11:26 ` Cyril Hrubis
2018-04-17 15:38   ` Alexey Kodanev

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