generic/382: Make test independent of fs allocation
authorJan Kara <jack@suse.cz>
Fri, 1 Nov 2019 11:00:45 +0000 (12:00 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Nov 2019 15:18:15 +0000 (23:18 +0800)
Test generic/382 depends on filesystem allocating exactly 30M of blocks
when writing 30M file. This is not true for some filesystems - e.g. for
ext2 due to indirect blocks - while leads to false positive failures.
In this case, the test is not actually interested in comparing exact
usage, rather in verifying the ability to write 30M worth of data. So
instead of comparing 'xfs_quota report' output, just depend on detecting
error when writing files.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/382
tests/generic/382.out

index 50816f69a9159a11649bb0d1a125fd06778bf653..02bb5111923743cff24e1b16feb3b72c8416a802 100755 (executable)
@@ -68,8 +68,6 @@ do_test()
 
        ## blocks default quota test ##
        _user_do "$XFS_IO_PROG -f -c \"pwrite 0 30M\" -c \"fsync\" $SCRATCH_MNT/data" | _filter_xfs_io
-       echo "$qname blocks quota after write 30M data"
-       $XFS_QUOTA_PROG -x -c "report $type -N -b" $SCRATCH_MNT | grep -v ^root | _filter_spaces
 
        rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
 
@@ -79,9 +77,6 @@ do_test()
        done
        sync
 
-       echo "$qname inode quota after creating 30 inodes"
-       $XFS_QUOTA_PROG -x -c "report $type -N -i" $SCRATCH_MNT | grep -v ^root | _filter_spaces
-
        rm -f ${SCRATCH_MNT}/* >/dev/null 2>&1
 }
 
index ad32ccd334bdf6877e7ddf862a64366d38f222c1..a538ca67368c9c7d4b39609aad767863933696a1 100644 (file)
@@ -5,21 +5,9 @@ fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
 
 wrote 31457280/31457280 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-user blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-user inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-
 === group quota test ===
 group blocks and inode limit
 fsgqa 0 40960 40960 00 [--------] 0 40 40 00 [--------]
 
 wrote 31457280/31457280 bytes at offset 0
 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-group blocks quota after write 30M data
-fsgqa 30720 40960 40960 00 [--------]
-
-group inode quota after creating 30 inodes
-fsgqa 30 40 40 00 [--------]
-