mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
reflink: fix quota tests to work properly
Fix the reflink quota tests to su to the fsgqa user so that we actually test enforcement of quotas. Seems that XFS enforces user quotas even if root is writing to a user file, whereas everything else lets root writes through. Also clean up some of the variable usage and _require_user. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
committed by
Eryu Guan
parent
3547db8e84
commit
eaa652fbb2
+10
-12
@@ -53,10 +53,8 @@ _require_quota
|
||||
_require_nobody
|
||||
_require_xfs_io_command "cowextsize"
|
||||
_require_odirect
|
||||
_require_user
|
||||
|
||||
_repquota() {
|
||||
repquota $SCRATCH_MNT | egrep '^(fsgqa|root|nobody)'
|
||||
}
|
||||
rm -f $seqres.full
|
||||
|
||||
echo "Format and mount"
|
||||
@@ -79,27 +77,27 @@ _cp_reflink $testdir/file1 $testdir/file3 >> $seqres.full
|
||||
touch $testdir/urk
|
||||
chown nobody $testdir/urk
|
||||
touch $testdir/erk
|
||||
chown fsgqa $testdir/erk
|
||||
_repquota
|
||||
chown $qa_user $testdir/erk
|
||||
_report_quota_blocks $SCRATCH_MNT
|
||||
_scratch_cycle_mount
|
||||
|
||||
echo "Change file ownership"
|
||||
chown fsgqa $testdir/file1
|
||||
chown fsgqa $testdir/file2
|
||||
chown fsgqa $testdir/file3
|
||||
_repquota
|
||||
chown $qa_user $testdir/file1
|
||||
chown $qa_user $testdir/file2
|
||||
chown $qa_user $testdir/file3
|
||||
_report_quota_blocks $SCRATCH_MNT
|
||||
|
||||
echo "CoW one of the files"
|
||||
$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $blksz $((sz - blksz)) $blksz" -c "fsync" $testdir/file2 >> $seqres.full
|
||||
_repquota
|
||||
_report_quota_blocks $SCRATCH_MNT
|
||||
|
||||
echo "Remount the FS to see if accounting changes"
|
||||
_scratch_cycle_mount
|
||||
_repquota
|
||||
_report_quota_blocks $SCRATCH_MNT
|
||||
|
||||
echo "Chown one of the files"
|
||||
chown nobody $testdir/file3
|
||||
_repquota
|
||||
_report_quota_blocks $SCRATCH_MNT
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
|
||||
Reference in New Issue
Block a user