xfs: force file creation to the data device for certain layout tests
[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 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1  # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20         cd /
21         rm -f $tmp.*
22         rm -f $SRC $DST
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 _require_test
32
33 echo "Feel the serenity."
34
35 SRC=$TEST_DIR/$seq.src
36 DST=$TEST_DIR/$seq.dst
37 rm -f $seqres.full
38
39 $XFS_IO_PROG -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seqres.full 2>&1
40 [ $? -ne 0 ] && _fail "xfs_io pwrite failed"
41 $XFS_IO_PROG -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST >> $seqres.full 2>&1
42 [ $? -ne 0 ] && _fail "xfs_io sendfile failed"
43
44 diff -q $SRC $DST
45 status=$?
46 [ $status -ne 0 ] && _fail "$SRC and $DST differ"
47
48 exit