test 030 clone using xfs_prepair64
[xfstests-dev.git] / 085
1 #! /bin/sh
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 #
13 # creator
14 owner=tes@melbourne.sgi.com
15
16 seq=`basename $0`
17 echo "QA output created by $seq"
18
19 here=`pwd`
20 tmp=/tmp/$$
21 status=1        # failure is the default!
22 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
23
24 # get standard environment, filters and checks
25 . ./common.rc
26 . ./common.filter
27 . ./common.log
28
29 # real QA test starts here
30 _supported_fs xfs
31 _supported_os IRIX Linux
32
33 rm -f $seq.full
34 rm -f $tmp.log
35
36 _require_scratch
37
38 echo "mkfs"
39 _scratch_mkfs_xfs >>$seq.full 2>&1 \
40     || _fail "mkfs scratch failed"
41
42 echo "mount"
43 _scratch_mount >>$seq.full 2>&1 \
44     || _fail "mount failed: $MOUNT_OPTIONS"
45
46 echo "touch files"
47 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
48
49 echo "godown"
50 src/godown -v -f $SCRATCH_MNT >> $seq.full
51
52 echo "unmount"
53 umount $SCRATCH_MNT
54
55 echo "logprint after going down..."
56 _print_logstate
57
58 # curious if FS consistent at start
59 if false; then
60     if /usr/sbin/xfs_check $SCRATCH_DEV; then
61        echo "*** checked ok ***"
62     fi
63 fi
64
65 echo "mount with replay"
66 _scratch_mount $mnt >>$seq.full 2>&1 \
67     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
68
69 echo "ls SCRATCH_MNT"
70 ls $SCRATCH_MNT
71
72 echo "unmount"
73 umount $SCRATCH_MNT
74
75 echo "logprint after mount and replay..."
76 _print_logstate
77
78 if _check_scratch_fs; then
79     echo "filesystem is checked ok"
80 else
81     echo "filesystem is NOT ok"
82 fi
83
84 # success, all done
85 status=0
86 exit