xfstests: Automatic build dependency calculations
[xfstests-dev.git] / 085
1 #! /bin/bash
2 # FS QA Test No. 085
3 #
4 # To test log replay by shutdown of file system
5 # This is the first simple initial test to ensure that
6 # the goingdown ioctl is working and recovery of
7 # create transactions is working.
8 #
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 #
25 #-----------------------------------------------------------------------
26 #
27 # creator
28 owner=tes@melbourne.sgi.com
29
30 seq=`basename $0`
31 echo "QA output created by $seq"
32
33 here=`pwd`
34 tmp=/tmp/$$
35 status=1        # failure is the default!
36 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
37
38 # get standard environment, filters and checks
39 . ./common.rc
40 . ./common.filter
41 . ./common.log
42
43 # real QA test starts here
44 _supported_fs xfs
45 _supported_os IRIX Linux
46
47 rm -f $seq.full
48 rm -f $tmp.log
49
50 _require_scratch
51
52 echo "mkfs"
53 _scratch_mkfs_xfs >>$seq.full 2>&1 \
54     || _fail "mkfs scratch failed"
55
56 echo "mount"
57 _scratch_mount >>$seq.full 2>&1 \
58     || _fail "mount failed: $MOUNT_OPTIONS"
59
60 echo "touch files"
61 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
62
63 echo "godown"
64 src/godown -v -f $SCRATCH_MNT >> $seq.full
65
66 echo "unmount"
67 umount $SCRATCH_MNT
68
69 echo "logprint after going down..."
70 _print_logstate
71
72 # curious if FS consistent at start
73 if false; then
74     if /usr/sbin/xfs_check $SCRATCH_DEV; then
75        echo "*** checked ok ***"
76     fi
77 fi
78
79 echo "mount with replay"
80 _scratch_mount $mnt >>$seq.full 2>&1 \
81     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
82
83 echo "ls SCRATCH_MNT"
84 ls $SCRATCH_MNT
85
86 echo "unmount"
87 umount $SCRATCH_MNT
88
89 echo "logprint after mount and replay..."
90 _print_logstate
91
92 if _check_scratch_fs; then
93     echo "filesystem is checked ok"
94 else
95     echo "filesystem is NOT ok"
96 fi
97
98 # success, all done
99 status=0
100 exit