2011-01-11 10:31:33 +11:00
|
|
|
#! /bin/bash
|
2018-06-09 11:35:42 +10:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
# Copyright (c) 2011 Red Hat, Inc. All Rights Reserved.
|
|
|
|
|
#
|
2011-01-11 10:31:33 +11:00
|
|
|
# FS QA Test No. 249
|
|
|
|
|
#
|
|
|
|
|
# simple splice(2) test.
|
|
|
|
|
#
|
|
|
|
|
seq=`basename $0`
|
2013-03-15 12:28:02 +00:00
|
|
|
seqres=$RESULT_DIR/$seq
|
2011-01-11 10:31:33 +11:00
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
|
|
|
|
here=`pwd`
|
2016-11-13 02:12:33 +08:00
|
|
|
tmp=/tmp/$$
|
2011-01-11 10:31:33 +11:00
|
|
|
status=1 # failure is the default!
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
|
|
|
|
cd /
|
|
|
|
|
rm -f $tmp.*
|
|
|
|
|
rm -f $SRC $DST
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
2013-03-15 12:28:04 +00:00
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
2011-01-11 10:31:33 +11:00
|
|
|
|
|
|
|
|
# real QA test starts here
|
|
|
|
|
_supported_fs generic
|
|
|
|
|
_supported_os Linux
|
2014-08-13 11:08:41 +10:00
|
|
|
_require_test
|
2011-01-11 10:31:33 +11:00
|
|
|
|
|
|
|
|
echo "Feel the serenity."
|
|
|
|
|
|
|
|
|
|
SRC=$TEST_DIR/$seq.src
|
|
|
|
|
DST=$TEST_DIR/$seq.dst
|
2013-03-15 12:28:02 +00:00
|
|
|
rm -f $seqres.full
|
2011-01-11 10:31:33 +11:00
|
|
|
|
2013-05-14 08:33:44 -05:00
|
|
|
$XFS_IO_PROG -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seqres.full 2>&1
|
2011-04-04 13:46:10 -05:00
|
|
|
[ $? -ne 0 ] && _fail "xfs_io pwrite failed"
|
2013-05-14 08:33:44 -05:00
|
|
|
$XFS_IO_PROG -f -c "sendfile -i $SRC 0 32768k" -c fsync $DST >> $seqres.full 2>&1
|
2011-04-04 13:46:10 -05:00
|
|
|
[ $? -ne 0 ] && _fail "xfs_io sendfile failed"
|
2011-01-11 10:31:33 +11:00
|
|
|
|
2011-04-04 13:46:10 -05:00
|
|
|
diff -q $SRC $DST
|
2011-01-11 10:31:33 +11:00
|
|
|
status=$?
|
2011-04-04 13:46:10 -05:00
|
|
|
[ $status -ne 0 ] && _fail "$SRC and $DST differ"
|
|
|
|
|
|
2011-01-11 10:31:33 +11:00
|
|
|
exit
|