xfstests: handle xfs_quota output w/ long devicenames
PATCH 1/1 xfstests: handle xfs_quota output w/ long devicenames
Long device names may be split onto their own line on quota output:
Filesystem Blocks Quota Limit Warn/Time Mounted on/dev/mapper/my-very-very-very-long-devicename
48M 0 0 00 [------] /mnt/scratch
which breaks tests that capture quota output - currently, only xfs/108.
Add a _filter_quota() which fixes this.
---
common/filter +9 -0
@@ -240,6 +240,15 @@ _filter_spaces() sed -e 's/ [ ]*/ /g' } +_filter_quota() +{ + # Long dev name might be split onto its own line; last + # seds remove that newline if present + _filter_scratch | _filter_test_dir | _filter_spaces | \ + sed -e 'N;s/SCRATCH_DEV\n/SCRATCH_DEV/g' | \ + sed -e 'N;s/TEST_DEV\n/TEST_DEV/g' +} + # Account for different "ln" failure messages _filter_ln() {
tests/xfs/108 +3 -3
@@ -71,9 +71,9 @@ test_accounting() for file in $SCRATCH_MNT/{buffer,direct,mmap}; do $here/src/lstat64 $file | head -3 | _filter_scratch done - xfs_quota -c "quota -hnb -$type $id" $QARGS | _filter_scratch | _filter_spaces - xfs_quota -c "quota -hni -$type $id" $QARGS | _filter_scratch | _filter_spaces - xfs_quota -c "quota -hnr -$type $id" $QARGS | _filter_scratch | _filter_spaces + xfs_quota -c "quota -hnb -$type $id" $QARGS | _filter_quota + xfs_quota -c "quota -hni -$type $id" $QARGS | _filter_quota + xfs_quota -c "quota -hnr -$type $id" $QARGS | _filter_quota } export MOUNT_OPTIONS="-opquota"
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Eric Sandeen
Long device names may be split onto their own line on quota output:
Filesystem Blocks Quota Limit Warn/Time Mounted on
/dev/mapper/my-very-very-very-long-devicename48M 0 0 00 [------] /mnt/scratchwhich breaks tests that capture quota output - currently, only xfs/107.
xfs/108?
Quoted 1 line
Add a
_filter_quota()which fixes this.
Is this necessary for any other tests? I notice some have their own filters (e.g. xfs/106), but AFAICT none of them handle wraped lines...
Quoted 10 lines
Signed-off-by Eric Sandeen <[email protected]>---
common/filter +0
-0
common/filter _filter_spaces() · line 249
Quoted 10 lines
common/filter +7
-0@@ -240,6 +240,15 @@ _filter_spaces() sed -e 's/ [ ]*/ /g' } +_filter_quota() +{ + # Long dev name might be split onto its own line; last + # seds remove that newline if present + _filter_scratch | _filter_test_dir | _filter_spaces | \ + sed -e 'N;s/SCRATCH_DEV\n/SCRATCH_DEV/g' | \ + sed -e 'N;s/TEST_DEV\n/TEST_DEV/g'
A bit messy, but given that we need to filter SCRATCH_MNT and TEST_DIR as well I can't see a much more obvious way to do it. I can think of plenty of line noise equivalents that are much shorter and more concise, but the comments explaining it would be longer than the above method. ;) So:
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
This has been committed.
Thanks
--Rich
commit cd7eb340dd2eded93f41bc096954017e2f9fa58d
Author: Eric Sandeen <[email protected]> Date: Sun Oct 6 22:46:19 2013 +0000
xfstests: handle xfs_quota output w/ long devicenames
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs