]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: added -P option to $DF_PROG
authorStanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Tue, 29 Oct 2013 09:25:24 +0000 (09:25 +0000)
committerRich Johnston <rjohnston@sgi.com>
Mon, 11 Nov 2013 15:47:31 +0000 (09:47 -0600)
Added -P option to $DF_PROG and changed the invocation of
'df' command in generic/{251,260,273,275} testcases
with $DF_PROG.

Otherwise the testcases will fail if the scratch
device has a long name (for example, if it's an LVM volume).
Because df outputs its usage stats with two lines:

/dev/mapper/xfstests-disk1
                       3030800      4608   2868908   1% /tmp/mnt/disk1

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/config
tests/generic/251
tests/generic/260
tests/generic/273
tests/generic/275

index 5dd7c7d221ce6b8c05d10ec8ceb32c681a1086db..3a0208a677191bff07a42986d1ad9273dce4dcd3 100644 (file)
@@ -151,7 +151,7 @@ export PS_ALL_FLAGS="-ef"
 
 export DF_PROG="`set_prog_path df`"
 [ "$DF_PROG" = "" ] && _fatal "df not found"
-[ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T"
+[ "$HOSTOS" = "Linux" ] && export DF_PROG="$DF_PROG -T -P"
 
 export XFS_LOGPRINT_PROG="`set_prog_path xfs_logprint`"
 export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
index 4126f152f44364174260342677ae963cea880750..d88c48b9abbb35812a6da06cbc89bd1a4c1083ed 100755 (executable)
@@ -89,7 +89,7 @@ _guess_max_minlen()
 fstrim_loop()
 {
        trap "_destroy_fstrim; exit \$status" 2 15
-       fsize=$(df | grep $SCRATCH_MNT | grep $SCRATCH_DEV  | awk '{print $2}')
+       fsize=$($DF_PROG | grep $SCRATCH_MNT | grep $SCRATCH_DEV  | awk '{print $3}')
        mmlen=$(_guess_max_minlen)
 
        while true ; do
index a003a7f9141b9832fc11971b4f8b4ba0e17f547a..23ea40fbbba1c4bc5960481f777b1c721e281197 100755 (executable)
@@ -48,7 +48,7 @@ _scratch_mount
 
 _test_batched_discard $SCRATCH_MNT || _notrun "FITRIM not supported on $SCRATCH_DEV"
 
-fssize=$(df -k | grep "$SCRATCH_MNT" | grep "$SCRATCH_DEV"  | awk '{print $2}')
+fssize=$($DF_PROG -k | grep "$SCRATCH_MNT" | grep "$SCRATCH_DEV"  | awk '{print $3}')
 
 beyond_eofs=$(_math "$fssize*2048")
 max_64bit=$(_math "2^64 - 1")
index ab04dfa34c94d700440f83ef1ba36dbd2b166eb7..63bbf9bbb0b6db674930a950ba16c62c85e8e118 100755 (executable)
@@ -68,7 +68,7 @@ _file_create()
 
        cd $SCRATCH_MNT/origin
 
-       _disksize=`df --block-size=1 $SCRATCH_DEV | awk -v sd=$SCRATCH_DEV 'BEGIN{c=0}{for(i=1;i<=NF;++i){a[c]=$i;++c}}END{for(entry in a){if(a[entry] ~ sd){print a[entry + 3]; break}}}'`
+       _disksize=`$DF_PROG --block-size=1 $SCRATCH_DEV | awk -v sd=$SCRATCH_DEV 'BEGIN{c=0}{for(i=1;i<=NF;++i){a[c]=$i;++c}}END{for(entry in a){if(a[entry] ~ sd){print a[entry + 3]; break}}}'`
        _disksize=$(($_disksize / 3))
        _num=$(($_disksize / $count / $threads / 4096))
        _count=$count
index f83a644ce3a9261aae25ef62622d167f9487bd8e..7382edb673e33f7e7d75bf740cef966eb4292b3f 100755 (executable)
@@ -69,14 +69,14 @@ sync
 dd if=/dev/zero of=$SCRATCH_MNT/tmp4 bs=4K oflag=sync >>$seqres.full 2>&1
 # Save space usage info to the full file
 echo "Pre rm space:" >> $seqres.full
-df $SCRATCH_MNT >>$seqres.full 2>&1
+$DF_PROG $SCRATCH_MNT >>$seqres.full 2>&1
 
 # Should leave approx 256k free
 rm -f $SCRATCH_MNT/tmp1
 sync
 echo "Post rm space:" >> $seqres.full
-df $SCRATCH_MNT >>$seqres.full 2>&1
-_freespace=`df -k $SCRATCH_MNT | tail -n 1 | awk '{print $4}'`
+$DF_PROG $SCRATCH_MNT >>$seqres.full 2>&1
+_freespace=`$DF_PROG -k $SCRATCH_MNT | tail -n 1 | awk '{print $5}'`
 [ $_freespace -gt 1024 ] && _fail "could not sufficiently fill filesystem"
 
 # Try a write larger than available space