mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfs: change return value check to golden image check
xfs/133 and xfs/138 use too much code to do "return value" check, it's not necessary. For the code can be more readable and clear, I change "return value" check to golden image check. Signed-off-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
+8
-14
@@ -46,8 +46,6 @@ _cleanup()
|
|||||||
rm -f $seqres.full
|
rm -f $seqres.full
|
||||||
|
|
||||||
# real QA test starts here
|
# real QA test starts here
|
||||||
|
|
||||||
# Modify as appropriate.
|
|
||||||
_supported_fs xfs
|
_supported_fs xfs
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
_require_scratch
|
_require_scratch
|
||||||
@@ -72,22 +70,18 @@ $qa_project:10
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
|
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
|
||||||
-c "project -s $qa_project" $SCRATCH_MNT >>$seqres.full 2>&1
|
-c "project -s $qa_project" $SCRATCH_MNT > /dev/null
|
||||||
[ $? -ne 0 ] && _fail "Initalize project=$qa_project Failed"
|
|
||||||
|
|
||||||
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
|
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
|
||||||
-c "limit -p bsoft=100m bhard=200m $qa_project" $SCRATCH_MNT >>$seqres.full 2>&1
|
-c "limit -p bsoft=100m bhard=200m $qa_project" $SCRATCH_MNT
|
||||||
[ $? -ne 0 ] && _fail "Create limit for project=$qa_project Failed"
|
|
||||||
|
|
||||||
|
echo "=== quota command output ==="
|
||||||
|
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid \
|
||||||
|
-c "quota -p -v -b $qa_project" $SCRATCH_MNT | _filter_quota
|
||||||
|
|
||||||
|
echo "=== report command output ==="
|
||||||
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
|
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
|
||||||
-c "quota -p -v $qa_project" $SCRATCH_MNT 2>>$seqres.full | grep -qw $qa_project
|
-c "report -p -N -b" $SCRATCH_MNT | _filter_quota
|
||||||
[ $? -ne 0 ] && _fail "Query project=$qa_project Failed"
|
|
||||||
|
|
||||||
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
|
|
||||||
-c "report -p" $SCRATCH_MNT 2>>$seqres.full | grep -qw $qa_project
|
|
||||||
[ $? -ne 0 ] && _fail "Report project=$qa_project Failed"
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Test project
|
# Test project
|
||||||
|
|||||||
@@ -1 +1,8 @@
|
|||||||
QA output created by 133
|
QA output created by 133
|
||||||
|
=== quota command output ===
|
||||||
|
Disk quotas for Project 123456-project (10)
|
||||||
|
Filesystem Blocks Quota Limit Warn/Time Mounted on
|
||||||
|
SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
|
||||||
|
=== report command output ===
|
||||||
|
123456-project 0 102400 204800 00 [--------]
|
||||||
|
|
||||||
|
|||||||
+12
-14
@@ -47,8 +47,6 @@ _cleanup()
|
|||||||
rm -f $seqres.full
|
rm -f $seqres.full
|
||||||
|
|
||||||
# real QA test starts here
|
# real QA test starts here
|
||||||
|
|
||||||
# Modify as appropriate.
|
|
||||||
_supported_fs xfs
|
_supported_fs xfs
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
_require_scratch
|
_require_scratch
|
||||||
@@ -63,20 +61,20 @@ _qmount_option "uquota,gquota"
|
|||||||
_qmount
|
_qmount
|
||||||
|
|
||||||
# user test
|
# user test
|
||||||
xfs_quota -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT >>$seqres.full 2>&1
|
echo "== user test =="
|
||||||
[ $? -ne 0 ] && _fail "Create limit for user 123456-fsgqa Failed"
|
$XFS_QUOTA_PROG -x -c "limit -u bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
|
||||||
xfs_quota -x -c "quota -u -v 123456-fsgqa" $SCRATCH_MNT 2>>$seqres.full | grep -qw 123456-fsgqa
|
echo "=== quota command output ==="
|
||||||
[ $? -ne 0 ] && _fail "Query user 123456-fsgqa Failed"
|
$XFS_QUOTA_PROG -c "quota -u -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
|
||||||
xfs_quota -x -c "report -u" $SCRATCH_MNT 2>>$seqres.full | grep -qw 123456-fsgqa
|
echo "=== report command output ==="
|
||||||
[ $? -ne 0 ] && _fail "Report user 123456-fsgqa Failed"
|
$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
|
||||||
|
|
||||||
# group test
|
# group test
|
||||||
xfs_quota -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT >>$seqres.full 2>&1
|
echo "== group test =="
|
||||||
[ $? -ne 0 ] && _fail "Create limit for group 123456-fsgqa Failed"
|
$XFS_QUOTA_PROG -x -c "limit -g bsoft=100m bhard=200m 123456-fsgqa" $SCRATCH_MNT
|
||||||
xfs_quota -x -c "quota -g -v 123456-fsgqa" $SCRATCH_MNT 2>>$seqres.full | grep -qw 123456-fsgqa
|
echo "=== quota command output ==="
|
||||||
[ $? -ne 0 ] && _fail "Query group 123456-fsgqa Failed"
|
$XFS_QUOTA_PROG -c "quota -g -b -N -v 123456-fsgqa" $SCRATCH_MNT | _filter_quota
|
||||||
xfs_quota -x -c "report -u" $SCRATCH_MNT 2>>$seqres.full | grep -qw 123456-fsgqa
|
echo "=== report command output ==="
|
||||||
[ $? -ne 0 ] && _fail "Report group 123456-fsgqa Failed"
|
$XFS_QUOTA_PROG -x -c "report -u -b -N" $SCRATCH_MNT | grep -v "^root " | _filter_quota
|
||||||
|
|
||||||
# success, all done
|
# success, all done
|
||||||
status=0
|
status=0
|
||||||
|
|||||||
@@ -1 +1,13 @@
|
|||||||
QA output created by 138
|
QA output created by 138
|
||||||
|
== user test ==
|
||||||
|
=== quota command output ===
|
||||||
|
SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
|
||||||
|
=== report command output ===
|
||||||
|
123456-fsgqa 0 102400 204800 00 [--------]
|
||||||
|
|
||||||
|
== group test ==
|
||||||
|
=== quota command output ===
|
||||||
|
SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
|
||||||
|
=== report command output ===
|
||||||
|
123456-fsgqa 0 102400 204800 00 [--------]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user