From d776c30b06be93897bd91992f2927bcb1a753bc1 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 30 Jul 2016 16:08:45 +0200 Subject: [PATCH] [AUTH-9406] - Readability and code style changes --- include/tests_authentication | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/include/tests_authentication b/include/tests_authentication index afaccd24..084f0eab 100644 --- a/include/tests_authentication +++ b/include/tests_authentication @@ -1209,22 +1209,23 @@ Register --test-no AUTH-9406 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Query LDAP servers in client configuration" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: checking ldap.conf options" - for I in ${LDAP_CONF_LOCATIONS}; do - LogText "Test: checking ${I}" - if [ -f ${I} ]; then - LogText "Result: file ${I} exists, LDAP being used" - LDAP_CLIENT_CONFIG_FILE="${I}" - LogText "Test: checking LDAP servers in file ${I}" - FIND2=`egrep "^host " ${I} | awk '{ print $2 }'` - for I in ${FIND2}; do - Display --indent 6 --text "LDAP server: ${I}" - LogText "Result: found LDAP server ${I}" - Report "ldap_server[]=${I}" + for FILE in ${LDAP_CONF_LOCATIONS}; do + LogText "Test: checking ${FILE}" + if [ -f ${FILE} ]; then + LogText "Result: file ${FILE} exists, LDAP being used" + LDAP_CLIENT_CONFIG_FILE="${FILE}" + LogText "Test: checking LDAP servers in file ${FILE}" + FIND=$(egrep "^host " ${FILE} | awk '{ print $2 }') + for SERVER in ${FIND}; do + Display --indent 6 --text "LDAP server: ${SERVER}" + LogText "Result: found LDAP server ${SERVER}" + Report "ldap_server[]=${SERVER}" done - else - LogText "Result: ${I} does NOT exist" + else + LogText "Result: ${FILE} does NOT exist" fi done + unset FILE FIND SERVER fi # #################################################################################