xfs: test what happens when we reset the root dir and it has xattrs
[xfstests-dev.git] / tests / xfs / 135
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
4 #
5 # FS QA Test No. 135
6 #
7 # This test verifies that the xfsprogs log formatting infrastructure works
8 # correctly for various log stripe unit values. The log is formatted with xfs_db
9 # and verified with xfs_logprint.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22         cd /
23         rm -f $tmp.*
24 }
25
26 rm -f $seqres.full
27
28 # get standard environment, filters and checks
29 . ./common/rc
30 . ./common/log
31
32 # real QA test starts here
33
34 # Modify as appropriate.
35 _supported_fs xfs
36 _require_scratch
37 _require_v2log
38 _require_xfs_db_command "logformat"
39
40 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
41
42 # Reformat the log with various log stripe unit sizes and see if logprint dumps
43 # any errors. Use a cycle value larger than 1 so the log is actually written
44 # (the log is zeroed when cycle == 1).
45 for i in 16 32 64 128 256; do
46         lsunit=$((i * 1024))
47         _scratch_xfs_db -x -c "logformat -c 3 -s $lsunit" | \
48                 tee -a $seqres.full
49         # don't redirect error output so it causes test failure
50         _scratch_xfs_logprint >> $seqres.full
51 done
52
53 # success, all done
54 status=0
55 exit