* [PATCH] xfstests: tests/generic: added -P option to df
@ 2013-10-22 12:13 Stanislav Kholmanskikh
2013-10-28 7:25 ` Stanislav Kholmanskikh
2013-10-28 21:44 ` Dave Chinner
0 siblings, 2 replies; 7+ messages in thread
From: Stanislav Kholmanskikh @ 2013-10-22 12:13 UTC (permalink / raw)
To: xfs; +Cc: vasily.isaenko
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>
---
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@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] xfstests: tests/generic: added -P option to df
2013-10-22 12:13 [PATCH] xfstests: tests/generic: added -P option to df Stanislav Kholmanskikh
@ 2013-10-28 7:25 ` Stanislav Kholmanskikh
2013-10-28 21:44 ` Dave Chinner
1 sibling, 0 replies; 7+ messages in thread
From: Stanislav Kholmanskikh @ 2013-10-28 7:25 UTC (permalink / raw)
To: xfs; +Cc: vasily.isaenko
On 10/22/2013 04:13 PM, Stanislav Kholmanskikh wrote:
> 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>
> ---
Hi!
Could anybody review it?
Thanks.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] xfstests: tests/generic: added -P option to df
2013-10-22 12:13 [PATCH] xfstests: tests/generic: added -P option to df Stanislav Kholmanskikh
2013-10-28 7:25 ` Stanislav Kholmanskikh
@ 2013-10-28 21:44 ` Dave Chinner
2013-10-29 9:25 ` [PATCH V2] xfstests: added -P option to $DF_PROG Stanislav Kholmanskikh
1 sibling, 1 reply; 7+ messages in thread
From: Dave Chinner @ 2013-10-28 21:44 UTC (permalink / raw)
To: Stanislav Kholmanskikh; +Cc: vasily.isaenko, xfs
On Tue, Oct 22, 2013 at 04:13:55PM +0400, Stanislav Kholmanskikh wrote:
> 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>
> ---
> 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}')
Convert to $DF_PROG and add the -P flag to that variable, please.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH V2] xfstests: added -P option to $DF_PROG
2013-10-28 21:44 ` Dave Chinner
@ 2013-10-29 9:25 ` Stanislav Kholmanskikh
2013-11-05 12:42 ` Stanislav Kholmanskikh
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Stanislav Kholmanskikh @ 2013-10-29 9:25 UTC (permalink / raw)
To: xfs; +Cc: vasily.isaenko
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>
---
common/config | 2 +-
tests/generic/251 | 2 +-
tests/generic/260 | 2 +-
tests/generic/273 | 2 +-
tests/generic/275 | 6 +++---
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/common/config b/common/config
index db086fb..21ce833 100644
--- a/common/config
+++ b/common/config
@@ -150,7 +150,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`"
diff --git a/tests/generic/251 b/tests/generic/251
index 4126f15..d88c48b 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_PROG | grep $SCRATCH_MNT | grep $SCRATCH_DEV | awk '{print $3}')
mmlen=$(_guess_max_minlen)
while true ; do
diff --git a/tests/generic/260 b/tests/generic/260
index dc8b822..2150cb0 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_PROG -k | grep "$SCRATCH_MNT" | grep "$SCRATCH_DEV" | awk '{print $3}')
beyond_eofs=$(_math "$fssize*2048")
max_64bit=$(_math "2^64 - 1")
diff --git a/tests/generic/273 b/tests/generic/273
index d149808..4caa109 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_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
diff --git a/tests/generic/275 b/tests/generic/275
index f83a644..7382edb 100755
--- a/tests/generic/275
+++ b/tests/generic/275
@@ -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
--
1.7.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH V2] xfstests: added -P option to $DF_PROG
2013-10-29 9:25 ` [PATCH V2] xfstests: added -P option to $DF_PROG Stanislav Kholmanskikh
@ 2013-11-05 12:42 ` Stanislav Kholmanskikh
2013-11-10 1:20 ` Rich Johnston
2013-11-11 16:10 ` Rich Johnston
2 siblings, 0 replies; 7+ messages in thread
From: Stanislav Kholmanskikh @ 2013-11-05 12:42 UTC (permalink / raw)
To: xfs; +Cc: vasily.isaenko
On 10/29/2013 01:25 PM, Stanislav Kholmanskikh wrote:
> 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>
> ---
>
Hi!
Please, review.
Thanks.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2] xfstests: added -P option to $DF_PROG
2013-10-29 9:25 ` [PATCH V2] xfstests: added -P option to $DF_PROG Stanislav Kholmanskikh
2013-11-05 12:42 ` Stanislav Kholmanskikh
@ 2013-11-10 1:20 ` Rich Johnston
2013-11-11 16:10 ` Rich Johnston
2 siblings, 0 replies; 7+ messages in thread
From: Rich Johnston @ 2013-11-10 1:20 UTC (permalink / raw)
To: Stanislav Kholmanskikh, xfs; +Cc: vasily.isaenko
Changes look good.
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V2] xfstests: added -P option to $DF_PROG
2013-10-29 9:25 ` [PATCH V2] xfstests: added -P option to $DF_PROG Stanislav Kholmanskikh
2013-11-05 12:42 ` Stanislav Kholmanskikh
2013-11-10 1:20 ` Rich Johnston
@ 2013-11-11 16:10 ` Rich Johnston
2 siblings, 0 replies; 7+ messages in thread
From: Rich Johnston @ 2013-11-11 16:10 UTC (permalink / raw)
To: Stanislav Kholmanskikh, xfs; +Cc: vasily.isaenko
This has been committed.
Thanks
--Rich
commit bfdd1e72b358c6eba9584988d599aa3857461eb4
Author: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Date: Tue Oct 29 09:25:24 2013 +0000
xfstests: added -P option to $DF_PROG
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-11-11 16:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-22 12:13 [PATCH] xfstests: tests/generic: added -P option to df Stanislav Kholmanskikh
2013-10-28 7:25 ` Stanislav Kholmanskikh
2013-10-28 21:44 ` Dave Chinner
2013-10-29 9:25 ` [PATCH V2] xfstests: added -P option to $DF_PROG Stanislav Kholmanskikh
2013-11-05 12:42 ` Stanislav Kholmanskikh
2013-11-10 1:20 ` Rich Johnston
2013-11-11 16:10 ` Rich Johnston
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.