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
987815780SShuah Khan (Samsung OSG)	echo "static_key: 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
1487815780SShuah Khan (Samsung OSG)	echo "static_key: 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
202bf9e0abSIngo Molnar		echo "static_key: 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
282bf9e0abSIngo Molnar	echo "static_key: [FAIL]"
292bf9e0abSIngo Molnar	exit 1
302bf9e0abSIngo Molnarfi
31