generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / generic / 249
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2011 Red Hat, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 249
6 #
7 # simple splice(2) test.
8 #
9 . ./common/preamble
10 _begin_fstest auto quick rw
11
12 # Override the default cleanup function.
13 _cleanup()
14 {
15         cd /
16         rm -f $tmp.*
17         rm -f $SRC $DST
18 }
19
20 # Import common functions.
21 . ./common/filter
22
23 # real QA test starts here
24 _supported_fs generic
25 _require_test
26
27 echo "Feel the serenity."
28
29 SRC=$TEST_DIR/$seq.src
30 DST=$TEST_DIR/$seq.dst
31
32 $XFS_IO_PROG -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seqres.full 2>&1
33 [ $? -ne 0 ] && _fail "xfs_io pwrite failed"
34 $XFS_IO_PROG -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST >> $seqres.full 2>&1
35 [ $? -ne 0 ] && _fail "xfs_io sendfile failed"
36
37 diff -q $SRC $DST
38 status=$?
39 [ $status -ne 0 ] && _fail "$SRC and $DST differ"
40
41 exit