Files
apfstests/tests/xfs/132
T
Darrick J. Wong 89985c90ea misc: force the exact quota options coded into the test
Several tests require setting exactly the quota mount options that are
encoded in the test.  Unfortunately, quota mount options set by the user
in MOUNT_OPTIONS can turn on other quota types, which causes the golden
outputs to be off for various reasons (quota report output, behavior
changes, etc.)

So use _qmount_option to delete all the quota mount options in these
tests so that the test itself can run with exactly the config for which
it was written.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2018-11-05 00:42:49 +08:00

64 lines
1.5 KiB
Bash
Executable File

#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Red Hat, Inc. All Rights Reserved.
#
# FS QA Test No. 132
#
# Catch inobt/on disk inode free state mismatches on V4 filesystems
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -f $tmp.*
}
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
. ./common/quota
# remove previous $seqres.full before test
rm -f $seqres.full
# real QA test starts here
_supported_fs xfs
_supported_os Linux
# we intentionally corrupt the filesystem, so don't check it after the test
_require_scratch_nocheck
# on success, we'll get a shutdown filesystem with a really noisy log message
# due to transaction cancellation. Hence we don't want to check dmesg here.
_disable_dmesg_check
_require_xfs_mkfs_crc
_scratch_mkfs -m crc=0 > $seqres.full 2>&1
# The files that EIO in the golden output changes if we have quotas enabled
# so leave it off.
_qmount_option "defaults"
# corrupt an inode in the root inode chunk
root_ino=$(_scratch_xfs_get_metadata_field 'rootino' 'sb 0')
corrupt_ino=$((root_ino + 15))
_scratch_xfs_set_metadata_field 'core.mode' 0100644 "inode $corrupt_ino"
_scratch_mount
# The corrupt inode should be tripped over during these initial file creates.
touch $SCRATCH_MNT/file{0,1,2,3,4,5}{0,1,2,3,4,5} 2>&1 | _filter_scratch
# success, all done
status=0
exit