aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kexec
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.ibm.com>2021-11-24 12:38:00 +0530
committerMimi Zohar <zohar@linux.ibm.com>2021-12-31 13:16:02 -0500
commitcef5cd25a453805237f0c4e789218d987d674290 (patch)
tree608a2bf7e88470ef9c458a60c230cbd432daf908 /tools/testing/selftests/kexec
parentintegrity: Do not load MOK and MOKx when secure boot be disabled (diff)
downloadlinux-dev-cef5cd25a453805237f0c4e789218d987d674290.tar.xz
linux-dev-cef5cd25a453805237f0c4e789218d987d674290.zip
selftest/kexec: fix "ignored null byte in input" warning
Instead of assigning the string to a variable, which might contain a null character, redirect the output and grep for the string directly. Reviewed-by: Petr Vorel <pvorel@suse.cz> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'tools/testing/selftests/kexec')
-rwxr-xr-xtools/testing/selftests/kexec/test_kexec_file_load.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/kexec/test_kexec_file_load.sh b/tools/testing/selftests/kexec/test_kexec_file_load.sh
index 2ff600388c30..99f6fc23ee31 100755
--- a/tools/testing/selftests/kexec/test_kexec_file_load.sh
+++ b/tools/testing/selftests/kexec/test_kexec_file_load.sh
@@ -97,10 +97,11 @@ check_for_imasig()
check_for_modsig()
{
local module_sig_string="~Module signature appended~"
- local sig="$(tail --bytes $((${#module_sig_string} + 1)) $KERNEL_IMAGE)"
local ret=0
- if [ "$sig" == "$module_sig_string" ]; then
+ tail --bytes $((${#module_sig_string} + 1)) $KERNEL_IMAGE | \
+ grep -q "$module_sig_string"
+ if [ $? -eq 0 ]; then
ret=1
log_info "kexec kernel image modsig signed"
else