mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
7e98d41a6e
Refactor every test in the entire test suite to use the new boilerplate functions. This also migrates all the test group information into the test files. This patch has been autogenerated via the command: ./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
53 lines
1.2 KiB
Bash
Executable File
53 lines
1.2 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
# Copyright (c) 2021 Oracle. All Rights Reserved.
|
|
#
|
|
# FS QA Test No. 162
|
|
#
|
|
# Make sure that attrs are handled properly when repair has to reset the root
|
|
# directory.
|
|
#
|
|
. ./common/preamble
|
|
_begin_fstest auto quick attr repair
|
|
|
|
_register_cleanup "_cleanup" BUS
|
|
|
|
# Import common functions.
|
|
. ./common/filter
|
|
. ./common/populate
|
|
. ./common/fuzzy
|
|
|
|
# real QA test starts here
|
|
_supported_fs xfs
|
|
_require_scratch_nocheck
|
|
_require_populate_commands
|
|
_require_xfs_db_command "fuzz"
|
|
|
|
echo "Format and populate btree attr root dir"
|
|
_scratch_mkfs > "$seqres.full" 2>&1
|
|
_scratch_mount
|
|
|
|
blksz="$(stat -f -c '%s' "${SCRATCH_MNT}")"
|
|
__populate_create_attr "${SCRATCH_MNT}" "$((64 * blksz / 40))" true
|
|
_scratch_unmount
|
|
|
|
echo "Break the root directory"
|
|
_scratch_xfs_fuzz_metadata_field core.mode zeroes 'sb 0' 'addr rootino' >> $seqres.full 2>&1
|
|
|
|
echo "Detect bad root directory"
|
|
_scratch_xfs_repair -n >> $seqres.full 2>&1 && \
|
|
echo "Should have detected bad root dir"
|
|
|
|
echo "Fix bad root directory"
|
|
_scratch_xfs_repair >> $seqres.full 2>&1
|
|
|
|
echo "Detect fixed root directory"
|
|
_scratch_xfs_repair -n >> $seqres.full 2>&1
|
|
|
|
echo "Mount test"
|
|
_scratch_mount
|
|
|
|
# success, all done
|
|
status=0
|
|
exit
|