overlay: run unionmount testsuite test cases
[xfstests-dev.git] / tests / generic / 240
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 240
6 #
7 # Test that non-block-aligned aio+dio into holes does not leave
8 # zero'd out portions of the file
9 #
10 # QEMU IO to a file-backed device with misaligned partitions
11 # can send this sort of IO
12 #
13 # This test need only be run in the case where the logical block size
14 # of the device can be smaller than the file system block size.
15 #
16 seq=`basename $0`
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=1        # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
24
25 _cleanup()
26 {
27     cd /
28     rm -f $tmp.*
29 }
30
31 # get standard environment, filters and checks
32 . ./common/rc
33 . ./common/filter
34
35 _supported_fs generic
36 _supported_os Linux
37
38 _require_test
39 _require_sparse_files
40 _require_aiodio aiodio_sparse2
41
42 echo "Silence is golden."
43
44 # real QA test starts here
45 rm -f $seqres.full
46
47 rm -f $TEST_DIR/aiodio_sparse
48
49 logical_block_size=`_min_dio_alignment $TEST_DEV`
50 fs_block_size=`_get_block_size $TEST_DIR`
51 file_size=$((8 * $fs_block_size))
52
53 if [ $fs_block_size -le $logical_block_size ]; then
54         _notrun "fs block size must be larger than the device block size.  fs block size: $fs_block_size, device block size: $logical_block_size"
55 fi
56
57 # 2 threads, fs block sized writes, filesize, stride through file by
58 # fs block size, start at logical block size offset
59 $AIO_TEST -i 2 -w $fs_block_size -s $file_size -n $fs_block_size -o $logical_block_size "$TEST_DIR/aiodio_sparse"
60
61 status=$?
62 exit