mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
2529c9486a
Fully scripted conversion, see script in initial SPDX license commit message. tests/xfs/044 was hand massaged to remove duplicate copyright and divider lines before running the script. Signed-off-by: Dave Chinner <dchinner@redhat.com>
49 lines
1.2 KiB
Bash
Executable File
49 lines
1.2 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (c) 2009 Christoph Hellwig.
|
|
#
|
|
# FS QA Test No. 202
|
|
#
|
|
# Test out the xfs_repair -o force_geometry option on single-AG filesystems.
|
|
#
|
|
seq=`basename $0`
|
|
seqres=$RESULT_DIR/$seq
|
|
echo "QA output created by $seq"
|
|
|
|
here=`pwd`
|
|
tmp=/tmp/$$
|
|
status=1 # failure is the default!
|
|
|
|
# get standard environment, filters and checks
|
|
. ./common/rc
|
|
. ./common/filter
|
|
. ./common/repair
|
|
|
|
# real QA test starts here
|
|
_supported_fs xfs
|
|
_supported_os Linux
|
|
|
|
# single AG will cause default xfs_repair to fail. This test is actually
|
|
# testing the special corner case option needed to repair a single AG fs.
|
|
_require_scratch_nocheck
|
|
|
|
#
|
|
# The AG size is limited to 1TB (or even less with historic xfsprogs),
|
|
# so chose a small enough filesystem to make sure we can actually create
|
|
# a single AG filesystem.
|
|
#
|
|
echo "== Creating single-AG filesystem =="
|
|
_scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 \
|
|
|| _fail "!!! failed to make filesystem with single AG"
|
|
|
|
echo "== Trying to repair it (should fail) =="
|
|
_scratch_xfs_repair
|
|
|
|
echo "== Trying to repair it with -o force_geometry =="
|
|
_scratch_xfs_repair -o force_geometry 2>&1 | _filter_repair
|
|
|
|
# success, all done
|
|
echo "*** done"
|
|
rm -f $seqres.full
|
|
status=0
|