xfstests 050: ignore duplicates reported by repquota
authorAlex Elder <aelder@sgi.com>
Tue, 19 Jan 2010 20:26:20 +0000 (14:26 -0600)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 19 Jan 2010 20:26:20 +0000 (14:26 -0600)
Arrange to ignore duplicate entries reported by the "repquota"
xfs_quota command.  This can happen if an id is used more than once
(such as when two user names are assigned the same uid).

Since we are already sorting the output we can accomplish this by
adding the "-u" (unique) option to the sort command.  Shorten some
long lines while we're at it.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
050

diff --git a/050 b/050
index 306a7b5326e8d198a94d157b6105a482e67a6a52..785c10856ed881e078248b44d9c1fea4ac8f77bf 100755 (executable)
--- a/050
+++ b/050
@@ -118,7 +118,9 @@ _exercise()
 
        echo
        echo "*** report no quota settings" | tee -a $seq.full
-       xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report | LC_COLLATE=POSIX sort -r
+       xfs_quota -D $tmp.projects -P $tmp.projid -x \
+               -c "repquota -birnN -$type" $SCRATCH_DEV |
+               _filter_report | LC_COLLATE=POSIX sort -ru
 
        echo
        echo "*** report initial settings" | tee -a $seq.full
@@ -129,20 +131,26 @@ _exercise()
                -c "limit -$type bsoft=${bsoft}k bhard=${bhard}k $id" \
                -c "limit -$type isoft=$isoft ihard=$ihard $id" \
                $SCRATCH_DEV
-       xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report | LC_COLLATE=POSIX sort -r
+       xfs_quota -D $tmp.projects -P $tmp.projid -x \
+               -c "repquota -birnN -$type" $SCRATCH_DEV |
+               _filter_report | LC_COLLATE=POSIX sort -ru
 
        echo
        echo "*** push past the soft inode limit" | tee -a $seq.full
        _file_as_id $SCRATCH_MNT/softie1 $id $type 1024 0
        _file_as_id $SCRATCH_MNT/softie2 $id $type 1024 0
        _qmount
-       xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report | LC_COLLATE=POSIX sort -r
+       xfs_quota -D $tmp.projects -P $tmp.projid -x \
+               -c "repquota -birnN -$type" $SCRATCH_DEV |
+               _filter_report | LC_COLLATE=POSIX sort -ru
 
        echo
        echo "*** push past the soft block limit" | tee -a $seq.full
        _file_as_id $SCRATCH_MNT/softie $id $type 1024 140
        _qmount
-       xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report | LC_COLLATE=POSIX sort -r
+       xfs_quota -D $tmp.projects -P $tmp.projid -x \
+               -c "repquota -birnN -$type" $SCRATCH_DEV |
+               _filter_report | LC_COLLATE=POSIX sort -ru
 
        echo
        # Note: for quota accounting (not enforcement), EDQUOT is not expected
@@ -152,7 +160,9 @@ _exercise()
                _file_as_id $SCRATCH_MNT/hard$i $id $type 1024 0
        done
        _qmount
-       xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_report | LC_COLLATE=POSIX sort -r
+       xfs_quota -D $tmp.projects -P $tmp.projid -x \
+               -c "repquota -birnN -$type" $SCRATCH_DEV |
+               _filter_report | LC_COLLATE=POSIX sort -ru
 
        echo
        # Note: for quota accounting (not enforcement), EDQUOT is not expected
@@ -161,7 +171,9 @@ _exercise()
        echo "ls -l $SCRATCH_MNT" >>$seq.full
        ls -l $SCRATCH_MNT >>$seq.full
        _qmount
-       xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -birnN -$type" $SCRATCH_DEV | _filter_and_check_blks | LC_COLLATE=POSIX sort -r
+       xfs_quota -D $tmp.projects -P $tmp.projid -x \
+               -c "repquota -birnN -$type" $SCRATCH_DEV |
+               _filter_and_check_blks | LC_COLLATE=POSIX sort -ru
 
        echo
        echo "*** unmount"