2 # FSQA Test No. btrfs/068
4 # Run btrfs subvolume create/mount/umount/delete and remount with
5 # different compress algorithms simultaneously, with fsstress running
8 #-----------------------------------------------------------------------
9 # Copyright (C) 2014 Red Hat Inc. All rights reserved.
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
34 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # real QA test starts here
49 # we check scratch dev after each loop
50 _require_scratch_nocheck
51 _require_scratch_dev_pool 4
52 _btrfs_get_profile_configs
59 local subvol_mnt=$TEST_DIR/$seq.mnt
60 local stop_file=$TEST_DIR/$seq.stop.$$
62 echo "Test $mkfs_opts with $with_compress" >>$seqres.full
64 _scratch_pool_mkfs $mkfs_opts >>$seqres.full 2>&1
65 # make sure we created btrfs with desired options
67 echo "mkfs $mkfs_opts failed"
70 _scratch_mount >>$seqres.full 2>&1
72 args=`_scale_fsstress_args -p 20 -n 100 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir`
73 echo "Run fsstress $args" >>$seqres.full
74 $FSSTRESS_PROG $args >/dev/null 2>&1 &
77 # make sure the stop sign is not there
79 echo -n "Start subvolume worker: " >>$seqres.full
80 _btrfs_stress_subvolume $SCRATCH_DEV $SCRATCH_MNT subvol_$$ $subvol_mnt $stop_file >/dev/null 2>&1 &
82 echo "$subvol_pid" >>$seqres.full
84 echo -n "Start remount worker: " >>$seqres.full
85 _btrfs_stress_remount_compress $SCRATCH_MNT >/dev/null 2>&1 &
87 echo "$remount_pid" >>$seqres.full
89 echo "Wait for fsstress to exit and kill all background workers" >>$seqres.full
95 # wait for the remount loop process to finish
96 while ps aux | grep "mount.*$SCRATCH_MNT" | grep -qv grep; do
100 echo "Scrub the filesystem" >>$seqres.full
101 $BTRFS_UTIL_PROG scrub start -B $SCRATCH_MNT >>$seqres.full 2>&1
102 if [ $? -ne 0 ]; then
103 echo "Scrub find errors in \"$mkfs_opts\" test" | tee -a $seqres.full
106 # in case the subvolume is still mounted
107 $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1
109 # we called _require_scratch_nocheck instead of _require_scratch
110 # do check after test for each profile config
114 echo "Silence is golden"
115 for t in "${_btrfs_profile_configs[@]}"; do