2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
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
29 status=1 # failure is the default!
30 trap "_cleanup ; exit \$status" 0 1 2 3 15
32 # get standard environment, filters and checks
36 # real QA test starts here
42 echo "--- $*" >> $seqres.full
46 _require_scratch_nocheck
47 _require_no_large_scratch_dev
49 _require_extra_fs ext2
53 echo "(dev=$SCRATCH_DEV, mount=$SCRATCH_MNT)" >> $seqres.full
54 echo "" >> $seqres.full
56 echo "--- mounts" >> $seqres.full
59 _log "Create ext2 fs on scratch"
60 mkfs -t ext2 -F $SCRATCH_DEV >> $seqres.full 2>&1 \
61 || _fail "!!! failed to mkfs ext2"
63 _log "Mount ext2 fs on scratch"
64 mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seqres.full 2>&1 \
65 || _fail "!!! failed to mount"
67 _log "Create xfs fs in file on scratch"
68 ${MKFS_XFS_PROG} -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
69 >> $seqres.full 2>&1 \
70 || _fail "!!! failed to mkfs xfs"
72 _log "Make mount points"
73 mkdir $SCRATCH_MNT/test $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
74 || _fail "!!! failed to make mount points"
76 _log "Mount xfs via loop"
77 mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seqres.full 2>&1 \
78 || _fail "!!! failed to loop mount xfs"
81 $FSSTRESS_PROG -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
82 || _fail "!!! stress failed"
85 rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \
86 || _fail "!!! clean failed"
88 _log "create file for ext2 fs"
89 dd if=/dev/zero of=$SCRATCH_MNT/test/test.ext2 bs=1024 count=10240 >> $seqres.full 2>&1 \
90 || _fail "!!! create file failed"
92 _log "Create ext2 fs in file on looped xfs"
93 echo y | mkfs -t ext2 $SCRATCH_MNT/test/test.ext2 >> $seqres.full 2>&1 \
94 || _fail "!!! failed to mkfs ext2 on xfs"
96 _log "Mount ext2 on xfs via loop"
97 mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
98 || _fail "!!! failed to loop mount xfs"
100 _log "stress ext2 on xfs via loop"
101 $FSSTRESS_PROG -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
102 || _fail "!!! stress ext2 failed"
105 rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \
106 || _fail "!!! clean failed"
108 _log "umount ext2 on xfs"
109 umount $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
110 || _fail "!!! umount ext2 failed"
113 umount $SCRATCH_MNT/test >> $seqres.full 2>&1 \
114 || _fail "!!! umount xfs failed"
116 echo "--- mounts at end (before cleanup)" >> $seqres.full
117 mount >> $seqres.full