xref: /openbmc/linux/tools/testing/selftests/user/test_user_copy.sh (revision 3eb66e91a25497065c5322b1268cbc3953642227)
13c25fa14SShuah Khan#!/bin/sh
2b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
33c25fa14SShuah Khan# Runs copy_to/from_user infrastructure using test_user_copy kernel module
43c25fa14SShuah Khan
5*d7d5311dSShuah Khan (Samsung OSG)# Kselftest framework requirement - SKIP code is 4.
6*d7d5311dSShuah Khan (Samsung OSG)ksft_skip=4
7*d7d5311dSShuah Khan (Samsung OSG)
8*d7d5311dSShuah Khan (Samsung OSG)if ! /sbin/modprobe -q -n test_user_copy; then
9*d7d5311dSShuah Khan (Samsung OSG)	echo "user: module test_user_copy is not found [SKIP]"
10*d7d5311dSShuah Khan (Samsung OSG)	exit $ksft_skip
11*d7d5311dSShuah Khan (Samsung OSG)fi
123c25fa14SShuah Khanif /sbin/modprobe -q test_user_copy; then
133c25fa14SShuah Khan	/sbin/modprobe -q -r test_user_copy
143c25fa14SShuah Khan	echo "user_copy: ok"
153c25fa14SShuah Khanelse
163c25fa14SShuah Khan	echo "user_copy: [FAIL]"
173c25fa14SShuah Khan	exit 1
183c25fa14SShuah Khanfi
19