xfstests: remove stale machine configs
[xfstests-dev.git] / 068
1 #! /bin/bash
2 # FSQA Test No. 068
3 #
4 # Test case to reproduce xfs_freeze hang under filsystem load.
5 # The fail case for this test is a hang on an xfs_freeze.
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25
26 seq=`basename $0`
27 echo "QA output created by $seq"
28
29 here=`pwd`
30 tmp=/tmp/$$
31 status=0        # success is the default!
32
33 ITERATIONS=10
34
35 _cleanup()
36 {
37     cd /
38     _cleanup_testdir
39
40     trap 0 1 2 3 15
41     exit $status
42 }
43
44 trap "_cleanup" 0 1 2 3 15
45
46
47 # get standard environment, filters and checks
48 . ./common.rc
49 . ./common.filter
50
51 # real QA test starts here
52 _supported_fs generic
53 _supported_os Linux IRIX
54
55 _require_scratch
56 _require_freeze
57
58 echo "*** init FS"
59
60 rm -f $seq.full
61 umount $SCRATCH_DEV >/dev/null 2>&1
62 echo "*** MKFS ***"                         >>$seq.full
63 echo ""                                     >>$seq.full
64 _scratch_mkfs                               >>$seq.full 2>&1 \
65     || _fail "mkfs failed"
66 _scratch_mount                              >>$seq.full 2>&1 \
67     || _fail "mount failed"
68
69 touch $tmp.running
70
71
72 # start fsstress loop in a background block
73 {
74     STRESS_DIR="$SCRATCH_MNT/fsstress_test_dir"
75     mkdir "$STRESS_DIR"
76
77     procs=2
78     nops=200
79     while [ -f "$tmp.running" ]
80       do
81       # We do both read & write IO - not only is this more realistic,
82       # but it also potentially tests atime updates
83       FSSTRESS_ARGS=`_scale_fsstress_args -d $STRESS_DIR -p $procs -n $nops $FSSTRESS_AVOID`
84       $FSSTRESS_PROG $FSSTRESS_ARGS > /dev/null 2>&1
85     done
86
87     rm -r $STRESS_DIR/*
88     rmdir $STRESS_DIR
89 } &
90
91 # start fstest -m loop in a background block; this gets us mmap coverage
92 {
93     FSTEST_DIR="$SCRATCH_MNT/fstest_test_dir"
94     mkdir "$FSTEST_DIR"
95
96     procs=2
97     while [ -f "$tmp.running" ]
98       do
99       src/fstest -m -p $FSTEST_DIR  -n $procs -f 4 > /dev/null 2>&1
100     done
101
102     rm -rf $FSTEST_DIR/*
103     rmdir $FSTEST_DIR
104 } &
105
106 i=0
107 let ITERATIONS=$ITERATIONS-1
108
109 echo | tee -a $seq.full
110 while [ $i -le $ITERATIONS ]
111 do
112         echo "*** iteration: $i" | tee -a $seq.full
113         echo "*** freezing \$SCRATCH_MNT" | tee -a $seq.full
114         xfs_freeze -f "$SCRATCH_MNT" | tee -a $seq.full
115         [ $? != 0 ] && echo xfs_freeze -f "$SCRATCH_MNT" failed | \
116             tee -a $seq.full
117         sleep 2
118
119         echo "*** thawing  \$SCRATCH_MNT" | tee -a $seq.full
120         xfs_freeze -u "$SCRATCH_MNT" | tee -a $seq.full
121         [ $? != 0 ] && echo xfs_freeze -u "$SCRATCH_MNT" failed | \
122             tee -a $seq.full
123         sleep 2
124
125         echo  | tee -a $seq.full
126         let i=$i+1
127 done
128
129 # stop fsstress iterations
130 rm $tmp.running
131
132 # wait for fsstresses to finish
133 wait
134
135 _check_scratch_fs
136
137 exit 1