generic/520: Remove sync in clean_dir
[xfstests-dev.git] / tests / generic / 525
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017, Oracle and/or its affiliates.
4 # Copyright (C) 2019, CTERA Networks.
5 # All Rights Reserved.
6 #
7 # FS QA Test No. 525
8 #
9 # Check that high-offset reads and writes work.
10 #
11 # This is a variant of test generic/466 for filesystems that
12 # do not support mkfs_sized.
13 #
14 seq=`basename $0`
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
17
18 here=`pwd`
19 tmp=/tmp/$$
20 status=1    # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
22
23 _cleanup()
24 {
25         cd /
26         rm -f $tmp.*
27 }
28
29 # get standard environment, filters and checks
30 . ./common/rc
31 . ./common/filter
32
33 # real QA test starts here
34 _supported_os Linux
35 _supported_fs generic
36 _require_scratch
37
38 rm -f $seqres.full
39
40 _scratch_mkfs >>$seqres.full 2>&1
41 _scratch_mount
42
43 testdir=$SCRATCH_MNT
44
45 echo "++ Create the original files" >> $seqres.full
46 bigoff=$(echo "2^63 - 2" | $BC_PROG)
47 len=$(echo "2^63 - 1" | $BC_PROG)
48 $XFS_IO_PROG -f -c "truncate $len" $testdir/file0 >> $seqres.full 2>&1
49 if [ ! -s $testdir/file0 ]; then
50         # If we can't set a large file size then don't bother
51         # with read/write tests, because fs doesn't support it.
52         _notrun "filesystem does not support huge file size"
53 fi
54 _pwrite_byte 0x61 $bigoff 1 $testdir/file1 >> $seqres.full
55
56 echo "++ Check file creation" >> $seqres.full
57 _scratch_cycle_mount
58
59 $XFS_IO_PROG -c "pread -v -q $bigoff 1" $testdir/file1
60
61 # success, all done
62 status=0
63 exit