fstests: move test group info to test files
[xfstests-dev.git] / tests / xfs / 295
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 295
6 #
7 # Test xfs_logprint w/ multiply-logged inodes & continued transactions
8 #
9 . ./common/preamble
10 _begin_fstest auto logprint quick
11
12 # Import common functions.
13 . ./common/filter
14 . ./common/attr
15
16 # real QA test starts here
17
18 # Modify as appropriate.
19 _supported_fs xfs
20 _require_scratch
21 _require_attrs
22
23 logblks=$(_scratch_find_xfs_min_logblocks)
24 _scratch_mkfs -l size=${logblks}b >/dev/null 2>&1
25
26 # Should yield a multiply-logged inode, thanks to xattr
27 # Old logprint says this, then coredumps:
28 #       xlog_print_trans_inode: illegal inode type
29 _scratch_mount
30 echo hello > $SCRATCH_MNT/hello; setfattr -n user.name -v value $SCRATCH_MNT/hello
31 _scratch_unmount
32 _scratch_xfs_logprint 2>&1 >> $seqres.full
33
34 # Now go for a continued transaction
35 # The trick here is to get a transaction which is exactly the size of a
36 # xfs_inode_log_format_32_t or xfs_inode_log_format_64_t
37 # Prior to the bugfix, this was parsed like an inode due to the size
38 # match, not as a continued transaction.  If that happens we'll see:
39 #       xfs_logprint: unknown log operation type (494e)
40
41 _scratch_mkfs -l size=${logblks}b >/dev/null 2>&1
42 _scratch_mount
43 for I in `seq 0 8192`; do
44         echo a >> $SCRATCH_MNT/cat
45         touch $SCRATCH_MNT/tmp$I
46 done
47 _scratch_unmount
48 _scratch_xfs_logprint 2>&1 >> $seqres.full
49
50 # success, all done
51 status=0
52 exit