generic/235: Fix false failure on ext2
authorJan Kara <jack@suse.cz>
Fri, 1 Nov 2019 11:00:46 +0000 (12:00 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Nov 2019 15:26:11 +0000 (23:26 +0800)
The test gives false failure on ext2 filesystem as 64k file already
has indirect block and so space usage does not exactly match
expectation.

The test really needs to verify only whether quota accounting got
reenabled so just test using creating another empty file which is
not prone to these problems.

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/235
tests/generic/235.out

index 6adc803c04b7aa0f7fd429b145e353f342c5951f..01db4711a0ecef810dfef1babba00c248904e3bf 100755 (executable)
@@ -55,8 +55,9 @@ _try_scratch_mount "-o remount,ro" 2>&1 | tee -a $seqres.full | _filter_scratch
 touch $SCRATCH_MNT/failed 2>&1 | tee -a $seqres.full | _filter_scratch
 _try_scratch_mount "-o remount,rw" 2>&1 | tee -a $seqres.full | _filter_scratch
 
-$XFS_IO_PROG -c 'pwrite 0 64k' -c 'fsync' \
-                       $SCRATCH_MNT/testfile >>$seqres.full 2>&1
+touch $SCRATCH_MNT/testfile2
+chown $qa_user:$qa_user $SCRATCH_MNT/testfile2
+
 do_repquota
 
 _scratch_unmount 2>/dev/null
index abcb47a69d063c15adc1f95e3db7858700efcf8d..87b16e0acf6da36e4689594d5bba609732717cc2 100644 (file)
@@ -17,10 +17,10 @@ Block grace time: 7days; Inode grace time: 7days
                         Block limits                File limits
 User            used    soft    hard  grace    used  soft  hard  grace
 ----------------------------------------------------------------------
-fsgqa     --      64       0       0              1     0     0       
+fsgqa     --       0       0       0              2     0     0       
 *** Report for group quotas on device SCRATCH_DEV
 Block grace time: 7days; Inode grace time: 7days
                         Block limits                File limits
 Group           used    soft    hard  grace    used  soft  hard  grace
 ----------------------------------------------------------------------
-fsgqa     --      64       0       0              1     0     0       
+fsgqa     --       0       0       0              2     0     0