selftests/kexec: check kexec_load and kexec_file_load are enabled

Skip the kexec_load and kexec_file_load tests, if they aren't configured
in the kernel.  This change adds a new requirement that ikconfig is
configured in the kexec_load test.

Suggested-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Mimi Zohar 2019-03-12 14:53:54 -04:00 committed by Shuah Khan
parent a4df92adca
commit 7cea0b9227
2 changed files with 13 additions and 0 deletions

View File

@ -163,6 +163,11 @@ require_root_privileges
# get the kernel config
get_kconfig
kconfig_enabled "CONFIG_KEXEC_FILE=y" "kexec_file_load is enabled"
if [ $? -eq 0 ]; then
log_skip "kexec_file_load is not enabled"
fi
# Determine which kernel config options are enabled
kconfig_enabled "CONFIG_IMA_APPRAISE=y" "IMA enabled"
ima_appraise=$?

View File

@ -10,6 +10,14 @@ TEST="$0"
# kexec requires root privileges
require_root_privileges
# get the kernel config
get_kconfig
kconfig_enabled "CONFIG_KEXEC=y" "kexec_load is enabled"
if [ $? -eq 0 ]; then
log_skip "kexec_load is not enabled"
fi
get_secureboot_mode
secureboot=$?