xfs/044: Remove useless _filter_logprint
[xfstests-dev.git] / tests / xfs / 044
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 044
6 #
7 # external log uuid/format tests (TODO - version 2 log format)
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 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/filter
21
22 # real QA test starts here
23 _supported_fs xfs
24 _supported_os Linux
25
26 _require_logdev
27
28 _check_mount()
29 {
30     echo "    *** mount (expect success)"
31     if ! _try_scratch_mount
32     then
33         echo "        !!! mount failed (expecting success)"
34         status=1
35         exit
36     fi
37
38     echo "    *** umount"
39     if ! _scratch_unmount
40     then
41         echo "        !!! umount failed (expecting success)"
42         status=1
43         exit
44     fi
45 }
46
47 _check_no_mount()
48 {
49     echo "    *** mount (expect failure)"
50     if _try_scratch_mount >$tmp.err 2>&1
51     then
52         cat $tmp.err
53         echo "        !!! mount succeeded (expecting failure)"
54         status=1
55         exit
56     fi
57 }
58
59 _check_require_logdev()
60 {
61     echo "    *** mount without logdev (expect failure)"
62     if mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >$tmp.err 2>&1
63     then
64         cat $tmp.err
65         echo "        !!! mount succeeded (expecting failure)"
66         status=1
67         exit
68     fi
69 }
70
71 _unexpected()
72 {
73     echo "        !!! unexpected XFS command failure"
74     status=1
75     exit
76 }
77
78 # real QA test starts here
79
80 _require_scratch
81
82 echo "*** mkfs"
83
84 # this test only works for version 1 logs currently
85 lversion=1
86 lsize=16777216
87 _scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1
88 [ $? -ne 0 ] && \
89     _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
90 _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
91 . $tmp.mkfs1
92 [ $lversion -ne 1 ] && \
93     _notrun "Cannot run this test yet using MKFS_OPTIONS specified"
94
95 _require_test_program "loggen"
96
97 _check_mount
98 _check_require_logdev
99
100 echo "*** set uuid"
101 _scratch_xfs_db -x  -l $SCRATCH_LOGDEV -c "uuid 02020202-0202-0202-0202-020202020202"
102 [ $? -ne 0 ] && _unexpected
103 _check_mount
104
105 echo "*** zero log"
106 $here/src/loggen -z 100 >$SCRATCH_LOGDEV
107 _check_mount
108
109 echo "*** write clean log"
110 $here/src/loggen -u 2 -f 1 -m 1 -z 100 >$SCRATCH_LOGDEV
111 _check_mount
112
113 echo "*** write clean log (different format)"
114 $here/src/loggen -u 2 -f 99 -m 1 -z 100 >$SCRATCH_LOGDEV
115 _check_mount
116
117 echo "*** write clean log (different uuid)"
118 $here/src/loggen -u 7 -m 1 -z 100 >$SCRATCH_LOGDEV
119 _check_no_mount
120
121 echo "*** write clean log (different uuid & format)"
122 $here/src/loggen -u 7 -f 99 -m 1 -z 100 >$SCRATCH_LOGDEV
123 _check_no_mount
124
125 echo "*** write dirty log"
126 $here/src/loggen -u 2 -e 1 -z 100 >$SCRATCH_LOGDEV
127 _check_mount
128
129 echo "*** write dirty log (different format)"
130 $here/src/loggen -u 2 -f 99 -e 1 -z 100 >$SCRATCH_LOGDEV
131 _check_no_mount
132
133 echo "*** write dirty log (irix style)"
134 $here/src/loggen -u 0 -f 0 -e 1 -z 100 >$SCRATCH_LOGDEV
135 _check_no_mount
136
137 echo "*** write large dirty log"
138 $here/src/loggen -u 2 -e 16000 -z 100 >$SCRATCH_LOGDEV
139 _check_mount
140
141 echo -e -n "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console
142
143 status=0
144 # if error
145 exit