2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
7 # external log uuid/format tests (TODO - version 2 log format)
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
18 # get standard environment, filters and checks
22 # real QA test starts here
30 echo " *** mount (expect success)"
31 if ! _try_scratch_mount
33 echo " !!! mount failed (expecting success)"
41 echo " !!! umount failed (expecting success)"
49 echo " *** mount (expect failure)"
50 if _try_scratch_mount >$tmp.err 2>&1
53 echo " !!! mount succeeded (expecting failure)"
59 _check_require_logdev()
61 echo " *** mount without logdev (expect failure)"
62 if mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >$tmp.err 2>&1
65 echo " !!! mount succeeded (expecting failure)"
73 echo " !!! unexpected XFS command failure"
78 # real QA test starts here
84 # this test only works for version 1 logs currently
87 _scratch_mkfs_xfs -lsize=$lsize,version=$lversion >$tmp.mkfs0 2>&1
89 _notrun "Cannot mkfs for this test using MKFS_OPTIONS specified"
90 _filter_mkfs <$tmp.mkfs0 2>$tmp.mkfs1
92 [ $lversion -ne 1 ] && \
93 _notrun "Cannot run this test yet using MKFS_OPTIONS specified"
95 _require_test_program "loggen"
101 _scratch_xfs_db -x -l $SCRATCH_LOGDEV -c "uuid 02020202-0202-0202-0202-020202020202"
102 [ $? -ne 0 ] && _unexpected
106 $here/src/loggen -z 100 >$SCRATCH_LOGDEV
109 echo "*** write clean log"
110 $here/src/loggen -u 2 -f 1 -m 1 -z 100 >$SCRATCH_LOGDEV
113 echo "*** write clean log (different format)"
114 $here/src/loggen -u 2 -f 99 -m 1 -z 100 >$SCRATCH_LOGDEV
117 echo "*** write clean log (different uuid)"
118 $here/src/loggen -u 7 -m 1 -z 100 >$SCRATCH_LOGDEV
121 echo "*** write clean log (different uuid & format)"
122 $here/src/loggen -u 7 -f 99 -m 1 -z 100 >$SCRATCH_LOGDEV
125 echo "*** write dirty log"
126 $here/src/loggen -u 2 -e 1 -z 100 >$SCRATCH_LOGDEV
129 echo "*** write dirty log (different format)"
130 $here/src/loggen -u 2 -f 99 -e 1 -z 100 >$SCRATCH_LOGDEV
133 echo "*** write dirty log (irix style)"
134 $here/src/loggen -u 0 -f 0 -e 1 -z 100 >$SCRATCH_LOGDEV
137 echo "*** write large dirty log"
138 $here/src/loggen -u 2 -e 16000 -z 100 >$SCRATCH_LOGDEV
141 echo -e -n "\n\r*** XFS QA 044 - done\n\r\n\r" >/dev/console