mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
updates to run (more) cleanly with quota mount option(s). expanded
notrun messages for those tests which are skipped with more details.
This commit is contained in:
@@ -45,7 +45,14 @@ echo "QA output created by $seq"
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
umount $SCRATCH_DEV 2>/dev/null
|
||||
rm -f $tmp.*
|
||||
}
|
||||
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common.rc
|
||||
@@ -74,17 +81,22 @@ size="-d size=100m"
|
||||
mkfs -t xfs -f $size $SCRATCH_DEV >/dev/null 2>&1
|
||||
if [ $? -ne 0 ] # probably don't have a big enough scratch
|
||||
then
|
||||
size=""
|
||||
src/devzero -v -1 $SCRATCH_DEV >/dev/null
|
||||
_notrun "SCRATCH_DEV too small, results would be non-deterministic"
|
||||
else
|
||||
clear=""
|
||||
eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne '
|
||||
if (/byte offset (\d+), length (\d+)/) {
|
||||
print "clear=", $1 / 512, "\n"; exit
|
||||
}'`
|
||||
[ -z "$clear" ] && echo "Cannot calculate length to clear"
|
||||
src/devzero -v -1 -n "$clear" $SCRATCH_DEV >/dev/null
|
||||
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
|
||||
src/feature -U $SCRATCH_DEV && \
|
||||
_notrun "Quota are enabled, test needs controlled sb recovery"
|
||||
src/feature -G $SCRATCH_DEV && \
|
||||
_notrun "Quota are enabled, test needs controlled sb recovery"
|
||||
umount $SCRATCH_DEV
|
||||
fi
|
||||
clear=""
|
||||
eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne '
|
||||
if (/byte offset (\d+), length (\d+)/) {
|
||||
print "clear=", $1 / 512, "\n"; exit
|
||||
}'`
|
||||
[ -z "$clear" ] && echo "Cannot calculate length to clear"
|
||||
src/devzero -v -1 -n "$clear" $SCRATCH_DEV >/dev/null
|
||||
|
||||
# now kick off the real repair test...
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user