diff options
| author | Mimi Zohar <zohar@linux.ibm.com> | 2019-03-12 14:53:54 -0400 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2019-04-17 17:32:34 -0400 |
| commit | 7cea0b9227dcfd632fea1ee6a89f279da64fdd9d (patch) | |
| tree | 978b7e274bc42d6776daaf1b57de54cfc2ac816b | |
| parent | a4df92adcacdee9c21a076cfda41194621939a59 (diff) | |
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>
| -rwxr-xr-x | tools/testing/selftests/kexec/test_kexec_file_load.sh | 5 | ||||
| -rwxr-xr-x | tools/testing/selftests/kexec/test_kexec_load.sh | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/kexec/test_kexec_file_load.sh b/tools/testing/selftests/kexec/test_kexec_file_load.sh index 4603282dd8b6..fa7c24e8eefb 100755 --- a/tools/testing/selftests/kexec/test_kexec_file_load.sh +++ b/tools/testing/selftests/kexec/test_kexec_file_load.sh | |||
| @@ -163,6 +163,11 @@ require_root_privileges | |||
| 163 | # get the kernel config | 163 | # get the kernel config |
| 164 | get_kconfig | 164 | get_kconfig |
| 165 | 165 | ||
| 166 | kconfig_enabled "CONFIG_KEXEC_FILE=y" "kexec_file_load is enabled" | ||
| 167 | if [ $? -eq 0 ]; then | ||
| 168 | log_skip "kexec_file_load is not enabled" | ||
| 169 | fi | ||
| 170 | |||
| 166 | # Determine which kernel config options are enabled | 171 | # Determine which kernel config options are enabled |
| 167 | kconfig_enabled "CONFIG_IMA_APPRAISE=y" "IMA enabled" | 172 | kconfig_enabled "CONFIG_IMA_APPRAISE=y" "IMA enabled" |
| 168 | ima_appraise=$? | 173 | ima_appraise=$? |
diff --git a/tools/testing/selftests/kexec/test_kexec_load.sh b/tools/testing/selftests/kexec/test_kexec_load.sh index afd440ee23cb..2a66c8897f55 100755 --- a/tools/testing/selftests/kexec/test_kexec_load.sh +++ b/tools/testing/selftests/kexec/test_kexec_load.sh | |||
| @@ -10,6 +10,14 @@ TEST="$0" | |||
| 10 | # kexec requires root privileges | 10 | # kexec requires root privileges |
| 11 | require_root_privileges | 11 | require_root_privileges |
| 12 | 12 | ||
| 13 | # get the kernel config | ||
| 14 | get_kconfig | ||
| 15 | |||
| 16 | kconfig_enabled "CONFIG_KEXEC=y" "kexec_load is enabled" | ||
| 17 | if [ $? -eq 0 ]; then | ||
| 18 | log_skip "kexec_load is not enabled" | ||
| 19 | fi | ||
| 20 | |||
| 13 | get_secureboot_mode | 21 | get_secureboot_mode |
| 14 | secureboot=$? | 22 | secureboot=$? |
| 15 | 23 | ||
