fsx/fsstress: round blocksize properly
[xfstests-dev.git] / tests / generic / 461
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
4 # Copyright (c) 2017 Google, Inc.  All Rights Reserved.
5 #
6 # FS QA Test No. 461
7 #
8 # Shutdown stress test - exercise shutdown codepath with fsstress,
9 # make sure we don't BUG/WARN. Coverage for all fs with shutdown.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18
19 # get standard environment, filters and checks
20 . ./common/rc
21 . ./common/filter
22
23 _cleanup()
24 {
25         cd /
26         _scratch_unmount 2>/dev/null
27         rm -f $tmp.*
28 }
29 trap "_cleanup; exit \$status" 0 1 2 3 15
30
31 # real QA test starts here
32 _supported_fs generic
33
34 _require_scratch_nocheck
35 _require_scratch_shutdown
36 _require_command "$KILLALL_PROG" killall
37
38 rm -f $seqres.full
39
40 _scratch_mkfs > $seqres.full 2>&1
41 _scratch_mount
42
43 SLEEP_TIME=$((10 * $TIME_FACTOR))
44 PROCS=$((4 * LOAD_FACTOR))
45
46 load_dir=$SCRATCH_MNT/test
47
48 $FSSTRESS_PROG $FSSTRESS_AVOID -n10000000 -p $PROCS -d $load_dir >> $seqres.full 2>&1 &
49 sleep $SLEEP_TIME
50 sync
51
52 # now shutdown and unmount
53 sleep 5
54 _scratch_shutdown
55 $KILLALL_PROG -q $FSSTRESS_PROG
56 wait
57
58 # for some reason fsstress processes manage to live on beyond the wait?
59 sleep 5
60
61 _scratch_unmount
62
63 echo "Silence is golden"
64
65 status=0
66 exit