Merge pull request #1548 from teoberi/teoberi-KRNL-5622

Update tests_kernel -> KRNL-5622
This commit is contained in:
Michael Boelen 2024-10-04 10:12:57 +02:00 committed by GitHub
commit f08fadb7f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,11 +39,9 @@
# Description : Check default run level on Linux machines
Register --test-no KRNL-5622 --os Linux --weight L --network NO --category security --description "Determine Linux default run level"
if [ ${SKIPTEST} -eq 0 ]; then
# Only run if systemctl binary is available
if [ -n "${SYSTEMCTLBINARY}" ]; then
# Checking if we can find the systemd default target
LogText "Test: Checking for systemd default.target"
if [ $(${SYSTEMCTLBINARY} get-default) ]; then
if [ $( [ ! -z ${SYSTEMCTLBINARY} ] && ${SYSTEMCTLBINARY} get-default) ]; then
FIND=$(${SYSTEMCTLBINARY} get-default)
FIND2=$(${ECHOCMD} ${FIND} | ${EGREPBINARY} "runlevel5|graphical")
if HasData "${FIND2}"; then
@ -86,9 +84,6 @@
fi
fi
fi
else
LogText "Result: test skipped, as systemctl binary could not be found"
fi
fi
#
#################################################################################