xfstests: handle xfs_quota output w/ long devicenames
authorEric Sandeen <sandeen@redhat.com>
Sun, 6 Oct 2013 22:46:19 +0000 (22:46 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 16 Oct 2013 20:19:35 +0000 (15:19 -0500)
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.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/filter
tests/xfs/108

index e9cb09aa4f74868443a9b8e7f1c832a347ffec4f..2390ec0dca9e46c26649ca99a3c06d7f57f6c40e 100644 (file)
@@ -248,6 +248,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()
 {
index 5a470097ba843444c47d9391d5b01ad23d122b9d..5030f63bba41e4ac006f1eeebb29820cec18edff 100755 (executable)
@@ -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"