fstests: move test group info to test files
[xfstests-dev.git] / tests / xfs / 202
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Christoph Hellwig.
4 #
5 # FS QA Test No. 202
6 #
7 # Test out the xfs_repair -o force_geometry option on single-AG filesystems.
8 #
9 . ./common/preamble
10 _begin_fstest repair auto quick
11
12 # Import common functions.
13 . ./common/filter
14 . ./common/repair
15
16 # real QA test starts here
17 _supported_fs xfs
18
19 # single AG will cause default xfs_repair to fail. This test is actually
20 # testing the special corner case option needed to repair a single AG fs.
21 _require_scratch_nocheck
22
23 #
24 # The AG size is limited to 1TB (or even less with historic xfsprogs),
25 # so chose a small enough filesystem to make sure we can actually create
26 # a single AG filesystem.
27 #
28 echo "== Creating single-AG filesystem =="
29 _scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 \
30  || _fail "!!! failed to make filesystem with single AG"
31
32 echo "== Trying to repair it (should fail) =="
33 _scratch_xfs_repair
34
35 echo "== Trying to repair it with -o force_geometry =="
36 _scratch_xfs_repair -o force_geometry 2>&1 | _filter_repair
37
38 # success, all done
39 echo "*** done"
40 status=0