Blame tests/p_grub2/01_grub2_secureboot_signed.sh

25c93a
#!/bin/bash
25c93a
# This test will verify that grub2-efi is correctly signed with correct cert in the CA chain
25c93a
25c93a
t_Log "Running $0 -  Verifying that grub2-efi is correctly signed with correct cert"
25c93a
9a1e76
arch=$(uname -m)
9a1e76
Pablo Greco c024c4
if [[ "$centos_ver" -ge 7 && "$arch" = "x86_64" ]] ; then
Pablo Greco c024c4
  if [ ! -f /boot/efi/EFI/centos/grubx64.efi ];then
Pablo Greco c024c4
    t_Log "grub2-efi not installed, can't test... skipping"
Pablo Greco c024c4
    exit 0
Pablo Greco c024c4
  fi
25c93a
  t_InstallPackage pesign grub2-efi
b5f579
  pesign --show-signature --in /boot/efi/EFI/centos/grubx64.efi|egrep -q 'Red Hat Inc.|CentOS Secure Boot \(key 1\)'
9bd632
  t_CheckExitStatus $?
25c93a
else
9a1e76
  t_Log "previous versions than CentOS 7 - or not x86_64 arch - aren't using secureboot ... skipping"
25c93a
  exit 0
25c93a
fi
25c93a