diff options
author | Alexey Kodanev <alexey.kodanev@oracle.com> | 2018-09-20 14:30:30 +0300 |
---|---|---|
committer | Alexey Kodanev <alexey.kodanev@oracle.com> | 2018-09-20 14:36:04 +0300 |
commit | 223fd705276fe3c78a7034973a8fe6996b4bc4f6 (patch) | |
tree | 94af75b5d29f789289453eefc4eb573eb1927527 /testcases/lib | |
parent | 1f70b0a9cb0607de131c932f6c7041ebbbab4d6d (diff) |
lib/tst_test.sh: add TST_NEEDS_DRIVERS parameter
The drivers are checked with 'tst_check_drivers' command.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Diffstat (limited to 'testcases/lib')
-rw-r--r-- | testcases/lib/tst_test.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index faf3bd5d5..7a4130985 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -302,6 +302,18 @@ tst_check_cmds() return 0 } +tst_test_drivers() +{ + [ $# -eq 0 ] && return 0 + + local drv + + drv="$(tst_check_drivers $@ 2>&1)" + + [ $? -ne 0 ] && tst_brk TCONF "$drv driver not available" + return 0 +} + tst_is_int() { [ "$1" -eq "$1" ] 2>/dev/null @@ -349,6 +361,7 @@ tst_run() OPTS|USAGE|PARSE_ARGS|POS_ARGS);; NEEDS_ROOT|NEEDS_TMPDIR|NEEDS_DEVICE|DEVICE);; NEEDS_CMDS|NEEDS_MODULE|MODPATH|DATAROOT);; + NEEDS_DRIVERS);; IPV6|IPVER|TEST_DATA|TEST_DATA_IFS);; RETRY_FUNC|RETRY_FN_EXP_BACKOFF);; *) tst_res TWARN "Reserved variable TST_$_tst_i used!";; @@ -386,6 +399,7 @@ tst_run() fi tst_test_cmds $TST_NEEDS_CMDS + tst_test_drivers $TST_NEEDS_DRIVERS if [ -n "$TST_MIN_KVER" ]; then tst_kvcmp -lt "$TST_MIN_KVER" && \ |