Show only unique files for deleted files [LOGG-2190]

This commit is contained in:
mboelen 2014-11-13 00:57:36 +01:00
parent 5b1c4a44c7
commit f50595d4e2
1 changed files with 5 additions and 7 deletions

View File

@ -33,7 +33,6 @@
# #
################################################################################# #################################################################################
# #
InsertSection "Logging and files" InsertSection "Logging and files"
# Test : LOGG-2130 # Test : LOGG-2130
@ -230,7 +229,6 @@
else else
Display --indent 2 --text "- Checking logrotate presence" --result WARNING --color RED Display --indent 2 --text "- Checking logrotate presence" --result WARNING --color RED
logtext "Result: No logrotate configuration found" logtext "Result: No logrotate configuration found"
ReportWarning ${TEST_NO} "L" "No logrotate configuration has been found"
ReportSuggestion ${TEST_NO} "Check if files are properly rotated by a some tool instead of logrotate" ReportSuggestion ${TEST_NO} "Check if files are properly rotated by a some tool instead of logrotate"
fi fi
fi fi
@ -448,7 +446,7 @@
Register --test-no LOGG-2190 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking deleted files in file table" Register --test-no LOGG-2190 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking deleted files in file table"
if [ ${SKIPTEST} -eq 0 ]; then if [ ${SKIPTEST} -eq 0 ]; then
logtext "Test: checking deleted files but are still in use" logtext "Test: checking deleted files but are still in use"
FIND=`${LSOFBINARY} -n +L 1 2>&1 | egrep -v "WARNING|Output information" | awk '{ if ($5=="REG") { print $10 } }' | grep -v "^$"` FIND=`${LSOFBINARY} -n +L 1 2>&1 | egrep -v "WARNING|Output information" | awk '{ if ($5=="REG") { print $10 } }' | grep -v "^$" | sort | uniq`
if [ ! "${FIND}" = "" ]; then if [ ! "${FIND}" = "" ]; then
logtext "Result: found one or more files which are deleted, but still in use" logtext "Result: found one or more files which are deleted, but still in use"
for I in ${FIND}; do for I in ${FIND}; do