From: Bruno Faccini Date: Thu, 31 Oct 2013 23:50:27 +0000 (+0100) Subject: LU-3973 tests: use -P option of df to avoid line breaks X-Git-Tag: 2.5.51~5 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ee3fa324a331f1aff1c42e900170944756f5a725;hp=4b9e64aec7cfdf859f1f931e1ee44056db050bb9 LU-3973 tests: use -P option of df to avoid line breaks Sometimes df command output requires to break lines to allow for columns alignement. This causes fields parsing to fail. Use -P option to select compatibility output and ensure one single line format per file-system is used. Signed-off-by: Bruno Faccini Change-Id: Ibc9d4b8f50857e680a5590dbbfe312fce137bcb6 Reviewed-on: http://review.whamcloud.com/7915 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: James Nunez --- diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index ee25dcb..04bcd65 100644 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -400,7 +400,8 @@ make_small() { } cleanup_large_files() { - local ratio=$(df $MOUNT |awk '{print $5}' |sed 's/%//g' |grep -v Use) + local ratio=$(df -P $MOUNT | tail -1 | awk '{print $5}' | + sed 's/%//g') [ $ratio -gt 50 ] && find $MOUNT -size +10M -exec rm -f {} \; }