generic: convert tests to SPDX license tags
[xfstests-dev.git] / tests / generic / 465
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Alibaba Group.  All Rights Reserved.
4 # Copyright (c) 2017 Red Hat Inc. All Rights Reserved.
5 #
6 # FS QA Test No. 465
7 #
8 # Test i_size is updated properly under dio read/write
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 _cleanup()
20 {
21         cd /
22         rm -f $tmp.* $testfile.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28
29 # real QA test starts here
30 _supported_fs generic
31 _supported_os Linux
32
33 _require_aiodio aio-dio-append-write-read-race
34 _require_test_program "feature"
35
36 testfile=$TEST_DIR/$seq.$$
37 min_dio_align=`_min_dio_alignment $TEST_DEV`
38 page_size=`$here/src/feature -s`
39
40 rm -f $seqres.full
41
42 echo "non-aio dio test"
43 align=$min_dio_align
44 while [ $align -le $page_size ]; do
45         echo "$AIO_TEST -a $align -d $testfile.$align" >> $seqres.full
46         $AIO_TEST -a $align -d $testfile.$align 2>&1 | tee -a $seqres.full
47         align=$((align * 2))
48 done
49
50 echo "aio-dio test"
51 align=$min_dio_align
52 while [ $align -le $page_size ]; do
53         echo "$AIO_TEST -a $align $testfile.$align" >> $seqres.full
54         $AIO_TEST -a $align $testfile.$align 2>&1 | tee -a $seqres.full
55         align=$((align * 2))
56 done
57
58 # success, all done
59 status=0
60 exit