generic: test for creating duplicate filenames in encrypted dir
[xfstests-dev.git] / tests / generic / 083
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 083
6 #
7 # Exercise filesystem full behaviour - run numerous fsstress
8 # processes in write mode on a small filesystem.  NB: delayed
9 # allocate flushing is quite deadlock prone at the filesystem
10 # full boundary due to the fact that we will retry allocation
11 # several times after flushing, before giving back ENOSPC.
12 #
13 # Note that this test will intentionally cause console msgs of form:
14 #     dksc0d1s4: Process [fsstress] ran out of disk space
15 #     dksc0d1s4: Process [fsstress] ran out of disk space
16 #     dksc0d1s4: Process [fsstress] ran out of disk space
17 #
18 seq=`basename $0`
19 seqres=$RESULT_DIR/$seq
20 echo "QA output created by $seq"
21
22 here=`pwd`
23 tmp=/tmp/$$
24 status=1
25
26 _cleanup()
27 {
28         echo "*** unmount"
29         _scratch_unmount 2>/dev/null
30         rm -f $tmp.*
31 }
32 trap "_cleanup; exit \$status" 0 1 2 3 15
33
34 # get standard environment, filters and checks
35 . ./common/rc
36 . ./common/filter
37
38 # real QA test starts here
39 _supported_fs generic
40
41 _require_scratch
42 _require_no_large_scratch_dev
43
44 rm -f $seqres.full
45
46 workout()
47 {
48         fsz=$1
49         ags=$2
50         procs=$3
51         nops=$4
52
53         _scratch_unmount >/dev/null 2>&1
54         echo "*** mkfs -dsize=$fsz,agcount=$ags"    >>$seqres.full
55         echo ""                                     >>$seqres.full
56         if [ $FSTYP = xfs ]
57         then
58                 _scratch_mkfs_xfs -dsize=$fsz,agcount=$ags  >>$seqres.full 2>&1 \
59                         || _fail "size=$fsz,agcount=$ags mkfs failed"
60         else
61                 _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
62                         || _fail "size=$fsz mkfs failed"
63         fi
64         _scratch_mount
65
66         # -w ensures that the only ops are ones which cause write I/O
67         FSSTRESS_ARGS=`_scale_fsstress_args -d $SCRATCH_MNT -w -p $procs -n $nops $FSSTRESS_AVOID`
68         $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full
69 }
70
71 echo "*** test out-of-space handling for random write operations"
72
73 filesize=`expr 256 \* 1024 \* 1024`
74 agcount=6
75 numprocs=15
76 numops=1500
77
78 workout $filesize $agcount $numprocs $numops
79
80 echo "*** done"
81 status=0
82 exit