2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
7 # Multi-threads freeze/unfreeze testing. This's a stress test case,
8 # it won't do functional check.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
22 # Make sure $SCRATCH_MNT is unfreezed
23 xfs_freeze -u $SCRATCH_MNT 2>/dev/null
27 # get standard environment, filters and checks
31 # remove previous $seqres.full before test
34 # real QA test starts here
35 echo "Silence is golden"
37 # Modify as appropriate.
41 _require_test_program "feature"
43 _scratch_mkfs >>$seqres.full 2>&1
44 # We don't want to freeze/unfreeze root fs if mount scratch dev failed
47 num_cpus=`$here/src/feature -o`
49 # Start fsstress in background
51 if [ $procs -gt 20 ]; then
53 elif [ $procs -le 1 ]; then
57 stress_dir="$SCRATCH_MNT/fsstress_test_dir"
59 fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops $FSSTRESS_AVOID`
60 $FSSTRESS_PROG $fsstress_args >>$seqres.full 2>&1 &
63 # Start multi-threads freeze/unfreeze
64 for ((i=0; i<$procs; i++)); do
65 while kill -0 $fsstress_pid 2>/dev/null; do
66 xfs_freeze -f $SCRATCH_MNT 2>/dev/null
67 xfs_freeze -u $SCRATCH_MNT 2>/dev/null
69 freeze_pids="$! $freeze_pids"
76 # Exit with fsstress return value