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 _begin_fstest auto freeze stress
13 # Override the default cleanup function.
17 # Make sure $SCRATCH_MNT is unfreezed
18 xfs_freeze -u $SCRATCH_MNT 2>/dev/null
22 # Import common functions.
25 # real QA test starts here
26 echo "Silence is golden"
28 # Modify as appropriate.
32 _require_test_program "feature"
34 _scratch_mkfs >>$seqres.full 2>&1
35 # We don't want to freeze/unfreeze root fs if mount scratch dev failed
38 num_cpus=`$here/src/feature -o`
40 # Start fsstress in background
42 if [ $procs -gt 20 ]; then
44 elif [ $procs -le 1 ]; then
48 stress_dir="$SCRATCH_MNT/fsstress_test_dir"
50 fsstress_args=`_scale_fsstress_args -d $stress_dir -p $procs -n $nops $FSSTRESS_AVOID`
51 $FSSTRESS_PROG $fsstress_args >>$seqres.full 2>&1 &
54 # Start multi-threads freeze/unfreeze
55 for ((i=0; i<$procs; i++)); do
56 while kill -0 $fsstress_pid 2>/dev/null; do
57 xfs_freeze -f $SCRATCH_MNT 2>/dev/null
58 xfs_freeze -u $SCRATCH_MNT 2>/dev/null
60 freeze_pids="$! $freeze_pids"
67 # Exit with fsstress return value