]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: filter spaces in xfs_quota output in test case 108
authorBoris Ranto <branto@redhat.com>
Wed, 15 Dec 2010 19:10:57 +0000 (20:10 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 15 Dec 2010 19:10:57 +0000 (20:10 +0100)
xfs_quota can output different amounts of spaces when it is trying to align
its output. This can cause output mismatch on several systems in test case 108.

Filter all the consecutive spaces in xfs_quota output to just one space,
making the test case independent of the alignment.

Signed-off-by: Boris Ranto <branto@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
108
108.out
common.filter

diff --git a/108 b/108
index 9e9bdba1d79fd935115c1b922cf92ab45b3bfe5e..638cea9db81db1175205b655d5c01a1ff5cb12b0 100755 (executable)
--- a/108
+++ b/108
@@ -72,9 +72,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
-       xfs_quota -c "quota -hni -$type $id" $QARGS | _filter_scratch
-       xfs_quota -c "quota -hnr -$type $id" $QARGS | _filter_scratch
+       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
 }
 
 export MOUNT_OPTIONS="-opquota"
diff --git a/108.out b/108.out
index 12bbceea18e8367e473d6101853cb6dcfe8659cc..def0ccaf5cbf1b43e9cb9034c362bd67bfe70bde 100644 (file)
--- a/108.out
+++ b/108.out
@@ -32,11 +32,11 @@ projid = 3
   Size: 16777216     Filetype: Regular File
   Mode: (0600/-rw-------)         Uid: (1)  Gid: (2)
 Disk quotas for User #1 (1)
-Filesystem   Blocks  Quota  Limit Warn/Time    Mounted on
-SCRATCH_DEV        48M      0      0  00 [------] SCRATCH_MNT
+Filesystem Blocks Quota Limit Warn/Time Mounted on
+SCRATCH_DEV 48M 0 0 00 [------] SCRATCH_MNT
 Disk quotas for User #1 (1)
-Filesystem    Files  Quota  Limit Warn/Time    Mounted on
-SCRATCH_DEV          3      0      0  00 [------] SCRATCH_MNT
+Filesystem Files Quota Limit Warn/Time Mounted on
+SCRATCH_DEV 3 0 0 00 [------] SCRATCH_MNT
 
 ### test group accounting
 
@@ -64,11 +64,11 @@ projid = 3
   Size: 16777216     Filetype: Regular File
   Mode: (0600/-rw-------)         Uid: (1)  Gid: (2)
 Disk quotas for Group #2 (2)
-Filesystem   Blocks  Quota  Limit Warn/Time    Mounted on
-SCRATCH_DEV        48M      0      0  00 [------] SCRATCH_MNT
+Filesystem Blocks Quota Limit Warn/Time Mounted on
+SCRATCH_DEV 48M 0 0 00 [------] SCRATCH_MNT
 Disk quotas for Group #2 (2)
-Filesystem    Files  Quota  Limit Warn/Time    Mounted on
-SCRATCH_DEV          3      0      0  00 [------] SCRATCH_MNT
+Filesystem Files Quota Limit Warn/Time Mounted on
+SCRATCH_DEV 3 0 0 00 [------] SCRATCH_MNT
 
 ### create files, setting up ownership (type=p)
   File: "SCRATCH_MNT/buffer"
@@ -94,8 +94,8 @@ projid = 3
   Size: 16777216     Filetype: Regular File
   Mode: (0600/-rw-------)         Uid: (1)  Gid: (2)
 Disk quotas for Project #3 (3)
-Filesystem   Blocks  Quota  Limit Warn/Time    Mounted on
-SCRATCH_DEV        48M      0      0  00 [------] SCRATCH_MNT
+Filesystem Blocks Quota Limit Warn/Time Mounted on
+SCRATCH_DEV 48M 0 0 00 [------] SCRATCH_MNT
 Disk quotas for Project #3 (3)
-Filesystem    Files  Quota  Limit Warn/Time    Mounted on
-SCRATCH_DEV          3      0      0  00 [------] SCRATCH_MNT
+Filesystem Files Quota Limit Warn/Time Mounted on
+SCRATCH_DEV 3 0 0 00 [------] SCRATCH_MNT
index 7de0774cb1281c90e6e09bb1858e87e79e535a78..f0f60763070ecc0e979d1eff616bc3c064b07b2b 100644 (file)
@@ -224,5 +224,10 @@ _filter_scratch()
        sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+_filter_spaces()
+{
+       sed -e 's/ [ ]*/ /g'
+}
+
 # make sure this script returns success
 /bin/true