xfstests: move xfs specific tests out of top directory
[xfstests-dev.git] / tests / xfs / 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
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35
36 # get standard environment, filters and checks
37 . ./common.rc
38 . ./common.filter
39 . ./common.log
40
41 # real QA test starts here
42 _supported_fs xfs
43 _supported_os IRIX Linux
44
45 rm -f $seq.full
46 rm -f $tmp.log
47
48 _require_scratch
49
50 echo "mkfs"
51 _scratch_mkfs_xfs >>$seq.full 2>&1 \
52     || _fail "mkfs scratch failed"
53
54 echo "mount"
55 _scratch_mount >>$seq.full 2>&1 \
56     || _fail "mount failed: $MOUNT_OPTIONS"
57
58 echo "touch files"
59 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
60
61 echo "godown"
62 src/godown -v -f $SCRATCH_MNT >> $seq.full
63
64 echo "unmount"
65 umount $SCRATCH_MNT
66
67 echo "logprint after going down..."
68 _print_logstate
69
70 # curious if FS consistent at start
71 if false; then
72     if $XFS_CHECK_PROG $SCRATCH_DEV; then
73        echo "*** checked ok ***"
74     fi
75 fi
76
77 echo "mount with replay"
78 _scratch_mount $mnt >>$seq.full 2>&1 \
79     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
80
81 echo "ls SCRATCH_MNT"
82 ls $SCRATCH_MNT
83
84 echo "unmount"
85 umount $SCRATCH_MNT
86
87 echo "logprint after mount and replay..."
88 _print_logstate
89
90 if _check_scratch_fs; then
91     echo "filesystem is checked ok"
92 else
93     echo "filesystem is NOT ok"
94 fi
95
96 # success, all done
97 status=0
98 exit