mirror of https://github.com/CISOfy/lynis.git
Add possibility to define an array of allowed operating systems for a test
This commit is contained in:
parent
25faab8428
commit
1bf789861d
|
@ -2143,11 +2143,15 @@
|
|||
if [ ${SKIPTEST} -eq 0 -a "${TEST_WEIGHT}" = "H" -a "${SCAN_TEST_HEAVY}" = "NO" ]; then SKIPTEST=1; SKIPREASON="Test to system intensive for scan mode (H)"; fi
|
||||
if [ ${SKIPTEST} -eq 0 -a "${TEST_WEIGHT}" = "M" -a "${SCAN_TEST_MEDIUM}" = "NO" ]; then SKIPTEST=1; SKIPREASON="Test to system intensive for scan mode (M)"; fi
|
||||
|
||||
# Skip test if OS is different than requested
|
||||
if [ ${SKIPTEST} -eq 0 -a ! -z "${TEST_NEED_OS}" -a ! "${OS}" = "${TEST_NEED_OS}" ]; then
|
||||
SKIPTEST=1; SKIPREASON="Incorrect guest OS (${TEST_NEED_OS} only)"
|
||||
if [ ${LOG_INCORRECT_OS} -eq 0 ]; then
|
||||
SKIPLOGTEST=1
|
||||
# Test if our OS is the same as the requested OS (can be multiple values)
|
||||
if [ ${SKIPTEST} -eq 0 -a ! -z "${TEST_NEED_OS}" ]; then
|
||||
HASMATCH=0
|
||||
for I in ${TEST_NEED_OS}; do
|
||||
if [ "${I}" = "${OS}" ]; then HASMATCH=1; fi
|
||||
done
|
||||
if [ ${HASMATCH} -eq 0 ]; then
|
||||
SKIPTEST=1; SKIPREASON="Incorrect guest OS (${TEST_NEED_OS} only)"
|
||||
if [ ${LOG_INCORRECT_OS} -eq 0 ]; then SKIPLOGTEST=1; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue