generic: test for creating duplicate filenames in encrypted dir
[xfstests-dev.git] / tests / generic / 069
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2002 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 069
6 #
7 # Test out writes with O_APPEND flag sets.
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=0        # success is the default!
16 trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/filter
21
22 # real QA test starts here
23 _supported_fs generic
24
25 _require_scratch
26 rm -f $seqres.full
27
28 _scratch_unmount >/dev/null 2>&1
29
30 echo "*** mkfs"
31 _scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
32
33 echo "*** mount FS"
34 _scratch_mount
35
36 cd $SCRATCH_MNT
37
38 sizes="1 20 300 40000 3000000 12345"
39 for size in $sizes ; do
40         $here/src/append_writer $size &
41         echo $! $size >> pids
42 done
43
44 cd $here
45
46 wait
47 ls -lh $SCRATCH_MNT >> $seqres.full
48 echo "*** PIDs file" >> $seqres.full
49 cat $SCRATCH_MNT/pids >> $seqres.full
50
51 cat $SCRATCH_MNT/pids | while read pid size
52 do
53         echo "*** checking file with $size integers"
54         echo checking pid=$pid size=$size >> $seqres.full
55         $here/src/append_reader $SCRATCH_MNT/testfile.$pid
56         status=$?
57         [ $status -ne 0 ] && \
58                 echo "maybe corrupt O_APPEND to $SCRATCH_MOUNT/testfile.$pid!"
59         echo status: $status >> $seqres.full
60 done
61
62 # success, all done
63 exit