generic/520: Remove sync in clean_dir
[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 _supported_os Linux
64
65 _require_scratch
66 _require_attrs
67
68 rm -f $seqres.full
69 _scratch_unmount >/dev/null 2>&1
70 echo "*** MKFS ***"                         >>$seqres.full
71 echo ""                                     >>$seqres.full
72 _scratch_mkfs                               >>$seqres.full 2>&1 \
73     || _fail "mkfs failed"
74 _scratch_mount
75
76 mkdir -p $SCRATCH_MNT/fsstress
77
78 echo
79 echo Running fsstress in serial:
80 i=0
81 while [ $i -lt $ITERATIONS ]; do
82     echo fsstress iteration: $i | tee -a $seqres.full
83     $FSSTRESS_PROG \
84         -d $SCRATCH_MNT/fsstress \
85         $fss_ops -S c >>$seqres.full 2>&1
86
87     let i=$i+1
88 done
89
90 cd /
91 _scratch_unmount
92 echo 
93 echo Checking filesystem
94
95 status=$?
96 exit