mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
abstract out multiple quota .seq files into a shared common routine.
This commit is contained in:
@@ -128,20 +128,7 @@ _full " mount"
|
||||
mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \
|
||||
|| _fail "mount failed"
|
||||
|
||||
if src/feature -U $SCRATCH_DEV
|
||||
then
|
||||
if src/feature -G $SCRATCH_DEV
|
||||
then
|
||||
ln $seq.ugquota $seq.out
|
||||
else
|
||||
ln $seq.usrquota $seq.out
|
||||
fi
|
||||
elif src/feature -G $SCRATCH_DEV
|
||||
then
|
||||
ln $seq.grpquota $seq.out
|
||||
else
|
||||
ln $seq.noquota $seq.out
|
||||
fi
|
||||
_setup_seq_out
|
||||
|
||||
# generate some log traffic - but not too much - life gets a little
|
||||
# more complicated if the log wraps around. This traffic is
|
||||
|
||||
@@ -159,7 +159,7 @@ timestamp=false
|
||||
|
||||
if [ ! -z "$MOUNT_OPTIONS" ]
|
||||
then
|
||||
echo "check: \$MOUNT_OPTIONS specifed - \"$MOUNT_OPTIONS\""
|
||||
echo "check: \$MOUNT_OPTIONS specified - \"$MOUNT_OPTIONS\""
|
||||
umount $TEST_DEV
|
||||
# call the overridden mount - make sure the FS starts as
|
||||
# the same as we'll set it later.
|
||||
|
||||
@@ -473,6 +473,7 @@ _do_create_dumpdir_fill()
|
||||
_create_dumpdir_fill()
|
||||
{
|
||||
_wipe_fs
|
||||
_setup_seq_out
|
||||
_mk_fillconfig1
|
||||
_do_create_dumpdir_fill
|
||||
_stable_fs
|
||||
@@ -481,6 +482,7 @@ _create_dumpdir_fill()
|
||||
_create_dumpdir_fill2()
|
||||
{
|
||||
_wipe_fs
|
||||
_setup_seq_out
|
||||
_mk_fillconfig2
|
||||
_do_create_dumpdir_fill
|
||||
_stable_fs
|
||||
@@ -489,6 +491,7 @@ _create_dumpdir_fill2()
|
||||
_create_dumpdir_fill_perm()
|
||||
{
|
||||
_wipe_fs
|
||||
_setup_seq_out
|
||||
_mk_fillconfig_perm
|
||||
_do_create_dumpdir_fill
|
||||
_stable_fs
|
||||
@@ -635,6 +638,7 @@ _dump_filter()
|
||||
-e 's/date:[ ].*/date: DATE/' \
|
||||
-e 's/dump begun .*/dump begun DATE/' \
|
||||
-e 's/[0-9][0-9]* seconds/SECS seconds/' \
|
||||
-e 's/restore.[0-9][0-9]*/restore.PID/' \
|
||||
-e '/: dump size/s/[1-9][0-9]*/NUM/' \
|
||||
-e '/dump size:/s/[1-9][0-9]*/NUM/' \
|
||||
-e '/media file size/s/[1-9][0-9]*/NUM/' \
|
||||
|
||||
@@ -419,9 +419,37 @@ _xfs_mounted()
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# setup the .out file link, depending on which form of quota is
|
||||
# enabled as this often influences how the test output appears.
|
||||
# [NB: SCRATCH_DEV must be mounted for this to work]
|
||||
#
|
||||
_setup_seq_out()
|
||||
{
|
||||
# this lets us phase use of this into the dump/restore tests easier...
|
||||
[ -f $seq.ugquota -a -f $seq.noquota -a $seq.usrquota -a $seq.grpquota ] \
|
||||
|| return
|
||||
|
||||
rm -f $seq.out
|
||||
if src/feature -U $SCRATCH_DEV
|
||||
then
|
||||
if src/feature -G $SCRATCH_DEV
|
||||
then
|
||||
ln $seq.ugquota $seq.out
|
||||
else
|
||||
ln $seq.usrquota $seq.out
|
||||
fi
|
||||
elif src/feature -G $SCRATCH_DEV
|
||||
then
|
||||
ln $seq.grpquota $seq.out
|
||||
else
|
||||
ln $seq.noquota $seq.out
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# remount a FS to a new mode (ro or rw)
|
||||
#
|
||||
|
||||
_remount()
|
||||
{
|
||||
if [ $# -ne 2 ]
|
||||
|
||||
Reference in New Issue
Block a user