[AUTH-9278] style change, description, allow different root directory

This commit is contained in:
Michael Boelen 2019-03-29 12:30:12 +01:00
parent f9bcf26f25
commit 8a9edeb40b
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04

View File

@ -698,27 +698,28 @@
# #
# Test : AUTH-9278 # Test : AUTH-9278
# Description : Search LDAP support in PAM files # Description : Search LDAP support in PAM files
Register --test-no AUTH-9278 --weight L --network NO --category security --description "Checking LDAP pam status" Register --test-no AUTH-9278 --weight L --network NO --category security --description "Determine LDAP support in PAM files"
if [ ${SKIPTEST} -eq 0 ]; then if [ ${SKIPTEST} -eq 0 ]; then
AUTH_FILES="/etc/pam.d/common-auth /etc/pam.d/system-auth" AUTH_FILES="${ROOTDIR}etc/pam.d/common-auth ${ROOTDIR}etc/pam.d/system-auth"
for FILE in ${AUTH_FILES}; do for FILE in ${AUTH_FILES}; do
LogText "Test: checking presence ${FILE}" LogText "Test: checking presence ${FILE}"
if [ -f ${FILE} ]; then if [ -f ${FILE} ]; then
LogText "Result: file ${FILE} exists" LogText "Result: file ${FILE} exists"
LogText "Test: checking presence LDAP module" LogText "Test: checking presence LDAP module"
FIND=$(${GREPBINARY} "^auth.*ldap" ${FILE}) FIND=$(${GREPBINARY} "^auth.*ldap" ${FILE})
if [ ! "${FIND}" = "" ]; then if [ ! -z "${FIND}" ]; then
LogText "Result: LDAP module present" LogText "Result: LDAP module present"
LogText "Output: ${FIND}" LogText "Output: ${FIND}"
LDAP_AUTH_ENABLED=1 LDAP_AUTH_ENABLED=1
LDAP_PAM_ENABLED=1 LDAP_PAM_ENABLED=1
else else
LogText "Result: LDAP module not found" LogText "Result: LDAP module not found"
fi fi
else else
LogText "Result: file ${FILE} not found, skipping test" LogText "Result: file ${FILE} not found, skipping test"
fi fi
done done
if [ ${LDAP_PAM_ENABLED} -eq 1 ]; then if [ ${LDAP_PAM_ENABLED} -eq 1 ]; then
Display --indent 2 --text "- LDAP module in PAM" --result "${STATUS_FOUND}" --color GREEN Display --indent 2 --text "- LDAP module in PAM" --result "${STATUS_FOUND}" --color GREEN
else else