[PATCH] xfstests: tests/generic: added -P option to df

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/generic/251 |    2 +-
 tests/generic/260 |    2 +-
 tests/generic/273 |    2 +-
 tests/generic/275 |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/generic/251 b/tests/generic/251
index 4126f15..eca3b0d 100755
--- a/tests/generic/251
+++ b/tests/generic/251
@@ -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 -P | grep $SCRATCH_MNT | grep $SCRATCH_DEV  | awk '{print $2}')
 	mmlen=$(_guess_max_minlen)
 
 	while true ; do
diff --git a/tests/generic/260 b/tests/generic/260
index dc8b822..ad11d4f 100755
--- a/tests/generic/260
+++ b/tests/generic/260
@@ -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 -k -P | grep "$SCRATCH_MNT" | grep "$SCRATCH_DEV"  | awk '{print $2}')
 
 beyond_eofs=$(_math "$fssize*2048")
 max_64bit=$(_math "2^64 - 1")
diff --git a/tests/generic/273 b/tests/generic/273
index d149808..3f46320 100755
--- a/tests/generic/273
+++ b/tests/generic/273
@@ -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 --block-size=1 -P $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
diff --git a/tests/generic/275 b/tests/generic/275
index f83a644..5758878 100755
--- a/tests/generic/275
+++ b/tests/generic/275
@@ -76,7 +76,7 @@ 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}'`
+_freespace=`df -k -P $SCRATCH_MNT | tail -n 1 | awk '{print $4}'`
 [ $_freespace -gt 1024 ] && _fail "could not sufficiently fill filesystem"
 
 # Try a write larger than available space
-- 
1.7.1

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux