GNU Linux-libre 4.14.266-gnu1
[releases.git] / tools / testing / selftests / user / test_user_copy.sh
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # Runs copy_to/from_user infrastructure using test_user_copy kernel module
4
5 # Kselftest framework requirement - SKIP code is 4.
6 ksft_skip=4
7
8 if ! /sbin/modprobe -q -n test_user_copy; then
9         echo "user: module test_user_copy is not found [SKIP]"
10         exit $ksft_skip
11 fi
12 if /sbin/modprobe -q test_user_copy; then
13         /sbin/modprobe -q -r test_user_copy
14         echo "user_copy: ok"
15 else
16         echo "user_copy: [FAIL]"
17         exit 1
18 fi