| # SPDX-License-Identifier: GPL-2.0+ |
| # Runs an individual test module. |
| # kselftest expects a separate executable for each test, this can be |
| # created by adding a script like this: |
| # SPDX-License-Identifier: GPL-2.0+ |
| # $(dirname $0)/../kselftest_module.sh "description" module_name |
| # Example: tools/testing/selftests/lib/printf.sh |
| module="" # Filename (without the .ko). |
| args="" # modprobe arguments. |
| modprobe="/sbin/modprobe" |
| echo "Usage: $script <description> <module_name> [FAIL]" |
| skip "please run as root" |
| if ! $modprobe -q -n $module; then |
| skip "module $module is not found" |
| if $modprobe -q $module $args; then |
| # Kselftest framework requirement - SKIP code is 4. |