xref: /linux/tools/testing/selftests/static_keys/test_static_keys.sh (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
12bf9e0abSIngo Molnar#!/bin/sh
2b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
32bf9e0abSIngo Molnar# Runs static keys kernel module tests
42bf9e0abSIngo Molnar
587815780SShuah Khan (Samsung OSG)# Kselftest framework requirement - SKIP code is 4.
687815780SShuah Khan (Samsung OSG)ksft_skip=4
787815780SShuah Khan (Samsung OSG)
887815780SShuah Khan (Samsung OSG)if ! /sbin/modprobe -q -n test_static_key_base; then
9*1c71a121SJavier Carrasco	echo "static_keys: module test_static_key_base is not found [SKIP]"
1087815780SShuah Khan (Samsung OSG)	exit $ksft_skip
1187815780SShuah Khan (Samsung OSG)fi
1287815780SShuah Khan (Samsung OSG)
1387815780SShuah Khan (Samsung OSG)if ! /sbin/modprobe -q -n test_static_keys; then
14*1c71a121SJavier Carrasco	echo "static_keys: module test_static_keys is not found [SKIP]"
1587815780SShuah Khan (Samsung OSG)	exit $ksft_skip
1687815780SShuah Khan (Samsung OSG)fi
1787815780SShuah Khan (Samsung OSG)
182bf9e0abSIngo Molnarif /sbin/modprobe -q test_static_key_base; then
192bf9e0abSIngo Molnar	if /sbin/modprobe -q test_static_keys; then
20*1c71a121SJavier Carrasco		echo "static_keys: ok"
212bf9e0abSIngo Molnar		/sbin/modprobe -q -r test_static_keys
222bf9e0abSIngo Molnar		/sbin/modprobe -q -r test_static_key_base
232bf9e0abSIngo Molnar	else
242bf9e0abSIngo Molnar		echo "static_keys: [FAIL]"
252bf9e0abSIngo Molnar		/sbin/modprobe -q -r test_static_key_base
262bf9e0abSIngo Molnar	fi
272bf9e0abSIngo Molnarelse
28*1c71a121SJavier Carrasco	echo "static_keys: [FAIL]"
292bf9e0abSIngo Molnar	exit 1
302bf9e0abSIngo Molnarfi
31