Fix test 128 to work when sh is not the fsgqa login shell.
[xfstests-dev.git] / 018
1 #! /bin/sh
2 # FS QA Test No. 018
3 #
4 # xfs_logprint test - test v2 logs of different LR sizes
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=tes@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19
20 # get standard environment, filters and checks
21 . ./common.rc
22 . ./common.filter
23 . ./common.log
24
25 _cleanup()
26 {
27     cd /
28     _cleanup_logfiles
29     rm -f $tmp.*
30     umount $SCRATCH_MNT 2>/dev/null
31 }
32 trap "_cleanup; exit \$status" 0 1 2 3 15
33
34 # real QA test starts here
35 _supported_fs xfs
36 _supported_os IRIX Linux
37 # prelim
38 rm -f $seq.full $tmp.*
39 _require_scratch
40 _require_v2log
41
42 # link correct .out file
43 _link_out_file $seq.op
44
45
46 echo "*** init FS"
47 umount $SCRATCH_DEV >/dev/null 2>&1
48
49 cat >$tmp.seq.params <<EOF
50 # mkfs-opt        mount-opt
51   version=1     logbsize=32k
52   version=2     logbsize=32k
53   version=2     logbsize=64k
54   version=2     logbsize=128k
55   version=2     logbsize=256k
56 EOF
57
58 if [ "$HOSTOS" = "IRIX" ]; then
59     start_blk=0
60 else
61     start_blk=2
62 fi
63
64 # do the work for various log params which
65 # should not effect the data content of the log
66 cat $tmp.seq.params \
67 | while read mkfs mnt
68 do
69     if [ "$mkfs" = "#" ]; then
70         continue
71     fi
72     export MKFS_OPTIONS="-l $mkfs"
73     export MOUNT_OPTIONS="-o noalign,$mnt"
74     _mkfs_log
75     _create_log
76     _check_log
77
78     _print_operation
79     _cmp_op_output $seq.op $filtered
80
81     _print_transaction_inode $start_blk
82     _cmp_output $seq.trans_inode $filtered
83
84     _print_transaction_buf $start_blk
85     _cmp_output $seq.trans_buf $filtered
86 done
87
88 # got thru it all so we may have success
89 status=0
90
91 exit