common: kill _supported_os
[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 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16
17 # get standard environment, filters and checks
18 . ./common/rc
19 . ./common/filter
20 . ./common/repair
21
22 # real QA test starts here
23 _supported_fs xfs
24
25 # single AG will cause default xfs_repair to fail. This test is actually
26 # testing the special corner case option needed to repair a single AG fs.
27 _require_scratch_nocheck
28
29 #
30 # The AG size is limited to 1TB (or even less with historic xfsprogs),
31 # so chose a small enough filesystem to make sure we can actually create
32 # a single AG filesystem.
33 #
34 echo "== Creating single-AG filesystem =="
35 _scratch_mkfs_xfs -d agcount=1 -d size=$((1024*1024*1024)) >/dev/null 2>&1 \
36  || _fail "!!! failed to make filesystem with single AG"
37
38 echo "== Trying to repair it (should fail) =="
39 _scratch_xfs_repair
40
41 echo "== Trying to repair it with -o force_geometry =="
42 _scratch_xfs_repair -o force_geometry 2>&1 | _filter_repair
43
44 # success, all done
45 echo "*** done"
46 rm -f $seqres.full
47 status=0