Ordered test and golden output files as test was failing due to sizeof( xfs_alloctype...
[xfstests-dev.git] / 121
1 #! /bin/sh
2 # FS QA Test No. 121
3 #
4 # To test log replay for the unlinked list.
5 # So we create unlinked and still referenced inodes
6 # and make sure that no clearing of the unlinked AGI buckets
7 # are happening. 
8 # See pv#953263.
9 #
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
12 #-----------------------------------------------------------------------
13 #
14 # creator
15 owner=tes@sgi.com
16
17 seq=`basename $0`
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=1        # failure is the default!
23 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
24
25 # get standard environment, filters and checks
26 . ./common.rc
27 . ./common.filter
28 . ./common.log
29
30 # real QA test starts here
31 _supported_fs xfs
32 _supported_os IRIX Linux
33
34 rm -f $seq.full
35 rm -f $tmp.log
36
37 _require_scratch
38
39 echo "mkfs"
40 _scratch_mkfs_xfs >>$seq.full 2>&1 \
41     || _fail "mkfs scratch failed"
42
43 echo "mount"
44 _scratch_mount >>$seq.full 2>&1 \
45     || _fail "mount failed: $MOUNT_OPTIONS"
46
47 # num_files must be greater than 64 (XFS_AGI_UNLINKED_BUCKETS)
48 # so that there will be at least one linked list from one of
49 # the 64 buckets, so that we can decode a di_next_unlinked field 
50 num_files=200
51 delay=5
52 echo "open and unlink $num_files files"
53 src/multi_open_unlink $SCRATCH_MNT/test_file $num_files $delay &
54
55 # time to create and unlink all the files
56 sleep 3
57
58 echo "godown"
59 src/godown -v -f $SCRATCH_MNT >> $seq.full
60
61 # time for multi_open_unlink to exit out after its delay
62 # so we have no references and can unmount
63 sleep 3
64
65 echo "unmount"
66 umount $SCRATCH_MNT
67
68 echo "logprint after going down..."
69 _print_logstate
70
71 echo "mount with replay"
72 _scratch_mount $mnt >>$seq.full 2>&1 \
73     || _fail "mount failed: $mnt $MOUNT_OPTIONS"
74
75 echo "godown"
76 src/godown -v -f $SCRATCH_MNT >> $seq.full
77
78 echo "unmount"
79 umount $SCRATCH_MNT
80
81 echo "logprint after going down..."
82 _print_logstate
83
84 echo "logprint to check for CLEAR_AGI_BUCKET..."
85 xfs_logprint -t $SCRATCH_DEV | grep CLEAR
86
87 # success, all done
88 status=0
89 exit