Files
apfstests/tests/generic/130
T
Eric Sandeen 96fce07867 xfstests: automatically add -F to xfs_io on non-xfs
The -F flag to xfs_io originally enabled it to operate on non-xfs
filesystems.  This restriction was removed upstream in favor of
gracefully failing on the handful of operations that actually
required xfs, and the option was deprecated.

However, xfstests is still used on distros with older xfsprogs, and
so "xfs_io -F" was necessary throughout xfstests.

Simplify this by appending -F to XFS_IO_PROG when it's needed -
i.e. if we're using old xfsprogs on a non-xfs filesystem.

This will eliminate errors when new tests leave out the -F, and
if and when -F is finally removed, there will be one central
location in xfstests to update.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
2013-05-14 08:33:44 -05:00

260 lines
7.5 KiB
Bash
Executable File

#! /bin/bash
# FSQA Test No. 130
#
# xfs_io vector read/write and trunc tests. modified from cxfsqa tests
# - unixfile_basic_block_hole
# - unixfile_buffer_direct_coherency
# - unixfile_direct_rw
# - unixfile_eof_direct
# - unixfile_fsb_edge
# - unixfile_open_append
# - unixfile_open_trunc
# - unixfile_small_vector_async_rw
# - unixfile_small_vector_sync_rw
#
#-----------------------------------------------------------------------
# Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#-----------------------------------------------------------------------
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
_cleanup_testdir
}
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
# real QA test starts here
_supported_fs generic
_supported_os Linux IRIX
_require_scratch
_require_sparse_files
_setup_testdir
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
echo "End-of-file zeroing with direct I/O"
$XFS_IO_PROG -f -d -t -c "pwrite -S 0x63 0 65536" \
-c "truncate 1" \
-c "pwrite -S 0x41 65536 65536" \
-c "pread -v 0 131072" \
$SCRATCH_MNT/eof-zeroing_direct | _filter_xfs_io_unique
echo
echo "Basic Block Hole test"
$XFS_IO_PROG -f -t -c "truncate 8192" \
-c "pread -v 5000 3000" \
$SCRATCH_MNT/blackhole | _filter_xfs_io_unique
echo
echo "Test buffered and direct IO coherency"
$XFS_IO_PROG -f -t -c "pwrite -S 0x41 8000 1000" \
-c "pwrite -S 0x57 4000 1000" \
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
$XFS_IO_PROG -d -c "pwrite -S 0x78 20480 4096"\
-c "pwrite -S 0x79 4096 4096"\
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
$XFS_IO_PROG -c "pread -v 0 9000"\
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io_unique
echo
echo "Test direct read and write"
$XFS_IO_PROG -f -d -t -c "pwrite -S 0x78 0 65536"\
-c "pread -v 0 65536"\
-c "pwrite -S 0x46 65536 6553600"\
-c "pread -v 0 6619136"\
$SCRATCH_MNT/direct_io | _filter_xfs_io_unique
$XFS_IO_PROG -d -c "pread -v 0 6619136"\
$SCRATCH_MNT/direct_io | _filter_xfs_io_unique
$XFS_IO_PROG -f -d -t -c "pwrite -S 0x61 0 65536"\
-c "pread -v 0 65536"\
-c "pwrite -S 0x62 65536 131072"\
-c "pread -v 0 131072"\
$SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
$XFS_IO_PROG -d -c "pread -v 0 131072"\
$SCRATCH_MNT/async_direct_io | _filter_xfs_io_unique
echo
echo "FSB Edge test"
$XFS_IO_PROG -f -t -c "truncate 131072"\
-c "pwrite -S 0x5F 0 131072"\
-c "truncate 0"\
-c "truncate 131072"\
-c "pwrite -S 0x61 65535 2"\
-c "pread -v 0 131072"\
$SCRATCH_MNT/fsb_edge_test | _filter_xfs_io_unique
echo
echo "Open Trunk test (O_TRUNC)"
for n in 0 1 2 3 4
do
$XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
echo "Test" > $SCRATCH_MNT/$n
$XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
cat $SCRATCH_MNT/$n
done
echo "DONE"
echo
echo "Append test"
echo "append to me" > $SCRATCH_MNT/append
$XFS_IO_PROG -a -c "pwrite -S 0x61 0 10" \
-c "pread -v 0 24"\
$SCRATCH_MNT/append | _filter_xfs_io_unique
echo
echo "Small Vector Async"
echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
$XFS_IO_PROG -f -c "pread -v 0 1"\
-c "pread -v 1 1"\
-c "pread -v 2 1"\
-c "pread -v 3 1"\
-c "pread -v 4 1"\
-c "pread -v 5 1"\
-c "pread -v 6 1"\
-c "pread -v 7 1"\
-c "pread -v 8 1"\
-c "pread -v 9 1"\
-c "pread -v 10 1"\
-c "pread -v 11 1"\
-c "pread -v 12 1"\
-c "pread -v 13 13"\
-c "pwrite -S 0x61 4090 1"\
-c "pwrite -S 0x62 4091 1"\
-c "pwrite -S 0x63 4092 1"\
-c "pwrite -S 0x64 4093 1"\
-c "pwrite -S 0x65 4094 1"\
-c "pwrite -S 0x66 4095 1"\
-c "pwrite -S 0x67 4096 1"\
-c "pwrite -S 0x68 4097 1"\
-c "pwrite -S 0x69 4098 1"\
-c "pwrite -S 0x6A 4099 1"\
-c "pwrite -S 0x6B 4100 1"\
-c "pwrite -S 0x6C 4101 1"\
-c "pwrite -S 0x6D 4102 1"\
-c "pwrite -S 0x6E 4103 1"\
-c "pwrite -S 0x6F 4104 1"\
-c "pwrite -S 0x70 4105 1"\
-c "pread -v 4090 4"\
-c "pread -v 4094 4"\
-c "pread -v 4098 4"\
-c "pread -v 4102 4"\
-c "pwrite -S 0x61 10000000000 1"\
-c "pwrite -S 0x62 10000000001 1"\
-c "pwrite -S 0x63 10000000002 1"\
-c "pwrite -S 0x64 10000000003 1"\
-c "pwrite -S 0x65 10000000004 1"\
-c "pwrite -S 0x66 10000000005 1"\
-c "pwrite -S 0x67 10000000006 1"\
-c "pwrite -S 0x68 10000000007 1"\
-c "pwrite -S 0x69 10000000008 1"\
-c "pwrite -S 0x6A 10000000009 1"\
-c "pwrite -S 0x6B 10000000010 1"\
-c "pwrite -S 0x6C 10000000011 1"\
-c "pwrite -S 0x6D 10000000012 1"\
-c "pwrite -S 0x6E 10000000013 1"\
-c "pwrite -S 0x6F 10000000014 1"\
-c "pwrite -S 0x70 10000000015 1"\
-c "pread -v 10000000000 4"\
-c "pread -v 10000000004 4"\
-c "pread -v 10000000008 4"\
-c "pread -v 10000000012 4"\
$SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique
echo
echo "Small Vector Sync"
echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
$XFS_IO_PROG -f -s -c "pread -v 0 1"\
-c "pread -v 1 1"\
-c "pread -v 2 1"\
-c "pread -v 3 1"\
-c "pread -v 4 1"\
-c "pread -v 5 1"\
-c "pread -v 6 1"\
-c "pread -v 7 1"\
-c "pread -v 8 1"\
-c "pread -v 9 1"\
-c "pread -v 10 1"\
-c "pread -v 11 1"\
-c "pread -v 12 1"\
-c "pread -v 13 13"\
-c "pwrite -S 0x61 4090 1"\
-c "pwrite -S 0x62 4091 1"\
-c "pwrite -S 0x63 4092 1"\
-c "pwrite -S 0x64 4093 1"\
-c "pwrite -S 0x65 4094 1"\
-c "pwrite -S 0x66 4095 1"\
-c "pwrite -S 0x67 4096 1"\
-c "pwrite -S 0x68 4097 1"\
-c "pwrite -S 0x69 4098 1"\
-c "pwrite -S 0x6A 4099 1"\
-c "pwrite -S 0x6B 4100 1"\
-c "pwrite -S 0x6C 4101 1"\
-c "pwrite -S 0x6D 4102 1"\
-c "pwrite -S 0x6E 4103 1"\
-c "pwrite -S 0x6F 4104 1"\
-c "pwrite -S 0x70 4105 1"\
-c "pread -v 4090 4"\
-c "pread -v 4094 4"\
-c "pread -v 4098 4"\
-c "pread -v 4102 4"\
-c "pwrite -S 0x61 10000000000 1"\
-c "pwrite -S 0x62 10000000001 1"\
-c "pwrite -S 0x63 10000000002 1"\
-c "pwrite -S 0x64 10000000003 1"\
-c "pwrite -S 0x65 10000000004 1"\
-c "pwrite -S 0x66 10000000005 1"\
-c "pwrite -S 0x67 10000000006 1"\
-c "pwrite -S 0x68 10000000007 1"\
-c "pwrite -S 0x69 10000000008 1"\
-c "pwrite -S 0x6A 10000000009 1"\
-c "pwrite -S 0x6B 10000000010 1"\
-c "pwrite -S 0x6C 10000000011 1"\
-c "pwrite -S 0x6D 10000000012 1"\
-c "pwrite -S 0x6E 10000000013 1"\
-c "pwrite -S 0x6F 10000000014 1"\
-c "pwrite -S 0x70 10000000015 1"\
-c "pread -v 10000000000 4"\
-c "pread -v 10000000004 4"\
-c "pread -v 10000000008 4"\
-c "pread -v 10000000012 4"\
$SCRATCH_MNT/small_vector_async | _filter_xfs_io_unique
status=0
exit