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
43 echo "--- $*" >> $seqres.full
47 _require_scratch_nocheck
48 _require_no_large_scratch_dev
54 echo "(dev=$SCRATCH_DEV, mount=$SCRATCH_MNT)" >> $seqres.full
55 echo "" >> $seqres.full
57 echo "--- mounts" >> $seqres.full
60 _log "Create ext2 fs on scratch"
61 mkfs -t ext2 -F $SCRATCH_DEV >> $seqres.full 2>&1 \
62 || _fail "!!! failed to mkfs ext2"
64 _log "Mount ext2 fs on scratch"
65 mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seqres.full 2>&1 \
66 || _fail "!!! failed to mount"
68 _log "Create xfs fs in file on scratch"
69 ${MKFS_XFS_PROG} -f -dfile,name=$SCRATCH_MNT/test.xfs,size=40m \
70 >> $seqres.full 2>&1 \
71 || _fail "!!! failed to mkfs xfs"
73 _log "Make mount points"
74 mkdir $SCRATCH_MNT/test $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
75 || _fail "!!! failed to make mount points"
77 _log "Mount xfs via loop"
78 mount -t xfs -o loop $SCRATCH_MNT/test.xfs $SCRATCH_MNT/test >> $seqres.full 2>&1 \
79 || _fail "!!! failed to loop mount xfs"
82 $FSSTRESS_PROG -d $SCRATCH_MNT/test -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
83 || _fail "!!! stress failed"
86 rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \
87 || _fail "!!! clean failed"
89 _log "create file for ext2 fs"
90 dd if=/dev/zero of=$SCRATCH_MNT/test/test.ext2 bs=1024 count=10240 >> $seqres.full 2>&1 \
91 || _fail "!!! create file failed"
93 _log "Create ext2 fs in file on looped xfs"
94 echo y | mkfs -t ext2 $SCRATCH_MNT/test/test.ext2 >> $seqres.full 2>&1 \
95 || _fail "!!! failed to mkfs ext2 on xfs"
97 _log "Mount ext2 on xfs via loop"
98 mount -t ext2 -o loop $SCRATCH_MNT/test/test.ext2 $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
99 || _fail "!!! failed to loop mount xfs"
101 _log "stress ext2 on xfs via loop"
102 $FSSTRESS_PROG -d $SCRATCH_MNT/test2 -n 1000 $FSSTRESS_AVOID >> $seqres.full 2>&1 \
103 || _fail "!!! stress ext2 failed"
106 rm -rf $SCRATCH_MNT/test/* >> $seqres.full 2>&1 \
107 || _fail "!!! clean failed"
109 _log "umount ext2 on xfs"
110 umount $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
111 || _fail "!!! umount ext2 failed"
114 umount $SCRATCH_MNT/test >> $seqres.full 2>&1 \
115 || _fail "!!! umount xfs failed"
117 echo "--- mounts at end (before cleanup)" >> $seqres.full
118 mount >> $seqres.full