generic/611: Use _getfattr instead of GETFATTR_PROG
[xfstests-dev.git] / tests / generic / 269
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FSQA Test No. 269
6 #
7 # Run fsstress and ENSPC hitters in parallel, check fs consistency an the end
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/filter
21 # Disable all sync operations to get higher load
22 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
23 _workout()
24 {
25         echo ""
26         echo "Run fsstress"
27         echo ""
28         num_iterations=10
29         enospc_time=2
30         out=$SCRATCH_MNT/fsstress.$$
31         args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out`
32         echo "fsstress $args" >> $seqres.full
33         $FSSTRESS_PROG $args > /dev/null 2>&1 &
34         pid=$!
35         echo "Run dd writers in parallel"
36         for ((i=0; i < num_iterations; i++))
37         do
38                 # File will be opened with O_TRUNC each time
39                 dd if=/dev/zero of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M \
40                         >> $seqres.full 2>&1
41                 sleep $enospc_time
42         done
43         echo "Killing fsstress process..." >> $seqres.full
44         kill $pid >> $seqres.full 2>&1
45         wait $pid
46 }
47
48 # real QA test starts here
49 _supported_fs generic
50 _require_scratch
51
52 rm -f $seqres.full
53 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
54 _scratch_mount
55
56 if ! _workout; then
57         _scratch_unmount 2>/dev/null
58         exit
59 fi
60
61 if ! _scratch_unmount; then
62         echo "failed to umount"
63         status=1
64         exit
65 fi
66 status=0
67 exit