File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1662,6 +1662,7 @@ simply by setting right '$TST_NEEDS_FOO'.
16621662| 'TST_NEEDS_CMDS' | String with command names that has to be present for
16631663 the test (see below).
16641664| 'TST_NEEDS_MODULE' | Test module name needed for the test (see below).
1665+ | 'TST_NEEDS_DRIVERS'| Checks kernel drivers support for the test.
16651666|=============================================================================
16661667
16671668Checking for presence of commands
Original file line number Diff line number Diff line change @@ -302,6 +302,18 @@ tst_check_cmds()
302302 return 0
303303}
304304
305+ tst_test_drivers ()
306+ {
307+ [ $# -eq 0 ] && return 0
308+
309+ local drv
310+
311+ drv=" $( tst_check_drivers $@ 2>&1 ) "
312+
313+ [ $? -ne 0 ] && tst_brk TCONF " $drv driver not available"
314+ return 0
315+ }
316+
305317tst_is_int ()
306318{
307319 [ " $1 " -eq " $1 " ] 2> /dev/null
@@ -349,6 +361,7 @@ tst_run()
349361 OPTS|USAGE|PARSE_ARGS|POS_ARGS);;
350362 NEEDS_ROOT|NEEDS_TMPDIR|NEEDS_DEVICE|DEVICE);;
351363 NEEDS_CMDS|NEEDS_MODULE|MODPATH|DATAROOT);;
364+ NEEDS_DRIVERS);;
352365 IPV6|IPVER|TEST_DATA|TEST_DATA_IFS);;
353366 RETRY_FUNC|RETRY_FN_EXP_BACKOFF);;
354367 * ) tst_res TWARN " Reserved variable TST_$_tst_i used!" ;;
@@ -386,6 +399,7 @@ tst_run()
386399 fi
387400
388401 tst_test_cmds $TST_NEEDS_CMDS
402+ tst_test_drivers $TST_NEEDS_DRIVERS
389403
390404 if [ -n " $TST_MIN_KVER " ]; then
391405 tst_kvcmp -lt " $TST_MIN_KVER " && \
You can’t perform that action at this time.
0 commit comments