2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
10 _begin_fstest rw auto quick
12 # Override the default cleanup function.
16 umount $SCRATCH_MNT/test2 > /dev/null 2>&1
17 umount $SCRATCH_MNT/test > /dev/null 2>&1
20 if [ -w $seqres.full ]
22 echo "--- mounts at end (after cleanup)" >> $seqres.full
27 # Import common functions.
30 # real QA test starts here
36 echo "--- $*" >> $seqres.full
40 _require_scratch_nocheck
41 _require_no_large_scratch_dev
43 _require_extra_fs ext2
45 echo "(dev=$SCRATCH_DEV, mount=$SCRATCH_MNT)" >> $seqres.full
46 echo "" >> $seqres.full
48 echo "--- mounts" >> $seqres.full
51 _log "Create ext2 fs on scratch"
52 mkfs -t ext2 -F $SCRATCH_DEV >> $seqres.full 2>&1 \
53 || _fail "!!! failed to mkfs ext2"
55 _log "Mount ext2 fs on scratch"
56 mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seqres.full 2>&1 \
57 || _fail "!!! failed to mount"
59 _log "Create xfs fs in file on scratch"
60 ${MKFS_XFS_PROG} -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
61 >> $seqres.full 2>&1 \
62 || _fail "!!! failed to mkfs xfs"
64 _log "Make mount points"
65 mkdir $SCRATCH_MNT/test $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
66 || _fail "!!! failed to make mount points"
68 _log "Mount xfs via loop"
69 mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seqres.full 2>&1 \
70 || _fail "!!! failed to loop mount xfs"
73 $FSSTRESS_PROG -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
74 || _fail "!!! stress failed"
77 rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \
78 || _fail "!!! clean failed"
80 _log "create file for ext2 fs"
81 dd if=/dev/zero of=$SCRATCH_MNT/test/test.ext2 bs=1024 count=10240 >> $seqres.full 2>&1 \
82 || _fail "!!! create file failed"
84 _log "Create ext2 fs in file on looped xfs"
85 echo y | mkfs -t ext2 $SCRATCH_MNT/test/test.ext2 >> $seqres.full 2>&1 \
86 || _fail "!!! failed to mkfs ext2 on xfs"
88 _log "Mount ext2 on xfs via loop"
89 mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
90 || _fail "!!! failed to loop mount xfs"
92 _log "stress ext2 on xfs via loop"
93 $FSSTRESS_PROG -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
94 || _fail "!!! stress ext2 failed"
97 rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \
98 || _fail "!!! clean failed"
100 _log "umount ext2 on xfs"
101 umount $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
102 || _fail "!!! umount ext2 failed"
105 umount $SCRATCH_MNT/test >> $seqres.full 2>&1 \
106 || _fail "!!! umount xfs failed"
108 echo "--- mounts at end (before cleanup)" >> $seqres.full
109 mount >> $seqres.full