generic/611: Use _getfattr instead of GETFATTR_PROG
[xfstests-dev.git] / tests / generic / 117
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 117
6 #
7 # Attempt to cause filesystem corruption with serial fsstresses doing
8 # extended attributes writes - pv 940655
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 # seed and options for fsstress known to cause curruptions
20 seed=1122413794
21 fss_ops=" -z \
22     -f attr_remove=100 \
23     -f attr_set=100 \
24     -f chown=3 \
25     -f creat=4 \
26     -f dread=4 \
27     -f dwrite=4 \
28     -f fdatasync=1 \
29     -f fsync=1 \
30     -f getdents=1 \
31     -f link=1 \
32     -f mkdir=2 \
33     -f mknod=2 \
34     -f read=1 \
35     -f readlink=1 \
36     -f rename=2 \
37     -f rmdir=1 \
38     -f setxattr=1 \
39     -f stat=1 \
40     -f symlink=2 \
41     -f sync=1 \
42     -f truncate=2 \
43     -f unlink=1 \
44     -f write=4 \
45     -s $seed \
46     -m 31 -n 1000 -p 1"
47
48 ITERATIONS=10
49
50 _cleanup()
51 {
52     cd /
53     rm -f $tmp.*
54 }
55
56 # get standard environment, filters and checks
57 . ./common/rc
58 . ./common/filter
59 . ./common/attr
60
61 # real QA test starts here
62 _supported_fs generic
63
64 _require_scratch
65 _require_attrs
66
67 rm -f $seqres.full
68 _scratch_unmount >/dev/null 2>&1
69 echo "*** MKFS ***"                         >>$seqres.full
70 echo ""                                     >>$seqres.full
71 _scratch_mkfs                               >>$seqres.full 2>&1 \
72     || _fail "mkfs failed"
73 _scratch_mount
74
75 mkdir -p $SCRATCH_MNT/fsstress
76
77 echo
78 echo Running fsstress in serial:
79 i=0
80 while [ $i -lt $ITERATIONS ]; do
81     echo fsstress iteration: $i | tee -a $seqres.full
82     $FSSTRESS_PROG \
83         -d $SCRATCH_MNT/fsstress \
84         $fss_ops -S c >>$seqres.full 2>&1
85
86     let i=$i+1
87 done
88
89 cd /
90 _scratch_unmount
91 echo 
92 echo Checking filesystem
93
94 status=$?
95 exit