generic/520: Remove sync in clean_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 _supported_os Linux
25
26 _require_scratch
27 rm -f $seqres.full
28
29 _scratch_unmount >/dev/null 2>&1
30
31 echo "*** mkfs"
32 _scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
33
34 echo "*** mount FS"
35 _scratch_mount
36
37 cd $SCRATCH_MNT
38
39 sizes="1 20 300 40000 3000000 12345"
40 for size in $sizes ; do
41         $here/src/append_writer $size &
42         echo $! $size >> pids
43 done
44
45 cd $here
46
47 wait
48 ls -lh $SCRATCH_MNT >> $seqres.full
49 echo "*** PIDs file" >> $seqres.full
50 cat $SCRATCH_MNT/pids >> $seqres.full
51
52 cat $SCRATCH_MNT/pids | while read pid size
53 do
54         echo "*** checking file with $size integers"
55         echo checking pid=$pid size=$size >> $seqres.full
56         $here/src/append_reader $SCRATCH_MNT/testfile.$pid
57         status=$?
58         [ $status -ne 0 ] && \
59                 echo "maybe corrupt O_APPEND to $SCRATCH_MOUNT/testfile.$pid!"
60         echo status: $status >> $seqres.full
61 done
62
63 # success, all done
64 exit