Whamcloud - gitweb
LU-3973 tests: use -P option of df to avoid line breaks 15/7915/5
authorBruno Faccini <bruno.faccini@intel.com>
Thu, 31 Oct 2013 23:50:27 +0000 (00:50 +0100)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 6 Nov 2013 06:58:43 +0000 (06:58 +0000)
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 <bruno.faccini@intel.com>
Change-Id: Ibc9d4b8f50857e680a5590dbbfe312fce137bcb6
Reviewed-on: http://review.whamcloud.com/7915
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
lustre/tests/sanity-hsm.sh

index ee25dcb..04bcd65 100644 (file)
@@ -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 {} \;
 }