6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or modify it
10 # under the terms of version 2 of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 # Further, this software is distributed without any warranty that it is
18 # free of the rightfullclaim of any third person regarding infringement
19 # or the like. Any license provided herein, whether implied or
20 # otherwise, applies only to this software file. Patent licenses, if
21 # any, provided herein do not apply to combinations of this program with
22 # other software, or any other product whatsoever.
24 # You should have received a copy of the GNU General Public License along
25 # with this program; if not, write the Free Software Foundation, Inc., 59
26 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
28 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
29 # Mountain View, CA 94043, or:
33 # For further information regarding this notice, see:
35 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
36 #-----------------------------------------------------------------------
42 echo "QA output created by $seq"
46 umount $SCRATCH_MNT/test2 > /dev/null 2>&1
47 umount $SCRATCH_MNT/test > /dev/null 2>&1
52 echo "--- mounts at end (after cleanup)" >> $seq.full
59 status=1 # failure is the default!
60 trap "_cleanup ; exit \$status" 0 1 2 3 15
62 # get standard environment, filters and checks
69 echo "--- $*" >> $seq.full
78 # real QA test starts here
82 echo "(dev=$SCRATCH_DEV, mount=$SCRATCH_MNT)" >> $seq.full
85 echo "--- mounts" >> $seq.full
88 _log "Create ext2 fs on scratch"
89 mkfs -t ext2 $SCRATCH_DEV >> $seq.full 2>&1 \
90 || _fail "!!! failed to mkfs ext2"
92 _log "Mount ext2 fs on scratch"
93 mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seq.full 2>&1 \
94 || _fail "!!! failed to mount"
96 _log "Create xfs fs in file on scratch"
97 /sbin/mkfs.xfs -f $MKFS_OPTIONS -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
99 || _fail "!!! failed to mkfs xfs"
101 _log "Make mount points"
102 mkdir $SCRATCH_MNT/test $SCRATCH_MNT/test2 >> $seq.full 2>&1 \
103 || _fail "!!! failed to make mount points"
105 _log "Mount xfs via loop"
106 mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seq.full 2>&1 \
107 || _fail "!!! failed to loop mount xfs"
110 ltp/fsstress -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seq.full 2>&1 \
111 || _fail "!!! stress failed"
114 rm -rf $SCRATCH_MNT/test/* >> $seq.full 2>&1 \
115 || _fail "!!! clean failed"
117 _log "create file for ext2 fs"
118 dd if=/dev/zero of=$SCRATCH_MNT/test/test.ext2 bs=1024 count=10240 >> $seq.full 2>&1 \
119 || _fail "!!! create file failed"
121 _log "Create ext2 fs in file on looped xfs"
122 echo y | mkfs -t ext2 $SCRATCH_MNT/test/test.ext2 >> $seq.full 2>&1 \
123 || _fail "!!! failed to mkfs ext2 on xfs"
125 _log "Mount ext2 on xfs via loop"
126 mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seq.full 2>&1 \
127 || _fail "!!! failed to loop mount xfs"
129 _log "stress ext2 on xfs via loop"
130 ltp/fsstress -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seq.full 2>&1 \
131 || _fail "!!! stress ext2 failed"
134 rm -rf $SCRATCH_MNT/test/* >> $seq.full 2>&1 \
135 || _fail "!!! clean failed"
137 _log "umount ext2 on xfs"
138 umount $SCRATCH_MNT/test2 >> $seq.full 2>&1 \
139 || _fail "!!! umount ext2 failed"
142 umount $SCRATCH_MNT/test >> $seq.full 2>&1 \
143 || _fail "!!! umount xfs failed"
145 echo "--- mounts at end (before cleanup)" >> $seq.full