4 # Shutdown stress test - exercise shutdown codepath with fsstress,
5 # make sure we don't BUG/WARN. Coverage for all fs with shutdown.
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2013 Red Hat, Inc. All Rights Reserved.
9 # Copyright (c) 2017 Google, 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"
33 status=1 # failure is the default!
35 # get standard environment, filters and checks
42 _scratch_unmount 2>/dev/null
45 trap "_cleanup; exit \$status" 0 1 2 3 15
47 # real QA test starts here
51 _require_scratch_nocheck
52 _require_scratch_shutdown
53 _require_command "$KILLALL_PROG" killall
57 _scratch_mkfs > $seqres.full 2>&1
60 SLEEP_TIME=$((10 * $TIME_FACTOR))
61 PROCS=$((4 * LOAD_FACTOR))
63 load_dir=$SCRATCH_MNT/test
65 $FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
69 # now shutdown and unmount
72 $KILLALL_PROG -q $FSSTRESS_PROG
75 # for some reason fsstress processes manage to live on beyond the wait?
80 echo "Silence is golden"