From ee3fa324a331f1aff1c42e900170944756f5a725 Mon Sep 17 00:00:00 2001 From: Bruno Faccini Date: Fri, 1 Nov 2013 00:50:27 +0100 Subject: [PATCH 1/1] 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 --- lustre/tests/sanity-hsm.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {} \; } -- 1.8.3.1