2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc. All Rights Reserved.
7 # Race fio and xfs_scrub for a while to see if we crash or livelock.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 7 15
24 # get standard environment, filters and checks
30 # real QA test starts here
33 _require_test_program "feature"
34 _require_command "$KILLALL_PROG" killall
35 _require_command "$TIMEOUT_PROG" timeout
39 echo "Format and populate"
40 _scratch_mkfs > "$seqres.full" 2>&1
43 STRESS_DIR="$SCRATCH_MNT/testdir"
46 cpus=$(( $(src/feature -o) * 4 * LOAD_FACTOR))
47 $FSSTRESS_PROG -d $STRESS_DIR -p $cpus -n $((cpus * 100000)) $FSSTRESS_AVOID >/dev/null 2>&1 &
48 $XFS_SCRUB_PROG -d -T -v -n $SCRATCH_MNT >> $seqres.full
51 sleep $(( 60 * TIME_FACTOR ))
52 $KILLALL_PROG -q $FSSTRESS_PROG
55 echo "Concurrent scrub"
57 end=$((start + (60 * TIME_FACTOR) ))
59 echo "Scrub started at $(date --date="@${start}"), ending at $(date --date="@${end}")" >> $seqres.full
60 while [ "$(date +%s)" -lt "$end" ]; do
61 $TIMEOUT_PROG -s TERM $(( end - $(date +%s) + 2 )) $XFS_SCRUB_PROG -d -T -v -n $SCRATCH_MNT >> $seqres.full 2>&1
65 echo "Scrub finished at $(date)" >> $seqres.full
66 $KILLALL_PROG -q $FSSTRESS_PROG