selftests/kexec: define "require_root_privileges"
Many tests require root privileges. Define a common function. Suggested-by: Petr Vorel <pvorel@suse.cz> 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:
Родитель
6038c81526
Коммит
c660a81796
|
@ -66,3 +66,10 @@ get_secureboot_mode()
|
|||
log_info "secure boot mode not enabled"
|
||||
return 0;
|
||||
}
|
||||
|
||||
require_root_privileges()
|
||||
{
|
||||
if [ $(id -ru) -ne 0 ]; then
|
||||
log_skip "requires root privileges"
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -8,9 +8,7 @@ TEST="$0"
|
|||
. ./kexec_common_lib.sh
|
||||
|
||||
# kexec requires root privileges
|
||||
if [ $(id -ru) -ne 0 ]; then
|
||||
log_skip "requires root privileges"
|
||||
fi
|
||||
require_root_privileges
|
||||
|
||||
get_secureboot_mode
|
||||
secureboot=$?
|
||||
|
|
Загрузка…
Ссылка в новой задаче