Files
apfstests/130
T
Christoph Hellwig f381f98206 xfstests: move GPL boilerplates to fix lsqa.pl
It turns out lsqa.pl nees the test number and description first in the
file, so move the GPL boilerplates below it.

Also remove acouple of cases where we have one full copyright line + gpl
boilerplate before the description and another copyright line after
the description.

Signed-off-by: Christoph Hellwig <hch@lst.de>
2009-05-28 17:04:15 +02:00

276 lines
7.8 KiB
Bash
Executable File

#! /bin/sh
# 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
#
#-----------------------------------------------------------------------
#
# creator
owner=allanr@sgi.com
seq=`basename $0`
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
common_line_filter()
{
perl -ne 'if (/.*:(.*)/) {
if ( "$last_line" ne "$1" ) { print "$_"; $first_match=1; }
elsif ( $first_match==1 ) { print "*\n"; $first_match=0; }
$last_line="$1";
}
else {
print $_; $last_line=$_;
}'
}
_filter_xfs_io()
{
common_line_filter | sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([inf0-9/.]* [EPGMKiBbytes]*\/sec and [inf0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
}
# real QA test starts here
_supported_fs xfs
_supported_os Linux IRIX
_setup_testdir
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
echo "End-of-file zeroing with direct I/O"
xfs_io -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
echo
echo "Basic Block Hole test"
xfs_io -f -t -c "truncate 8192" \
-c "pread -v 5000 3000" \
$SCRATCH_MNT/blackhole | _filter_xfs_io
echo
echo "Test buffered and direct IO coherency"
xfs_io -f -t -c "pwrite -S 0x41 8000 1000" \
-c "pwrite -S 0x57 4000 1000" \
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io
xfs_io -d -c "pwrite -S 0x78 20480 4096"\
-c "pwrite -S 0x79 4096 4096"\
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io
xfs_io -c "pread -v 0 9000"\
$SCRATCH_MNT/buff_direct_coherency | _filter_xfs_io
echo
echo "Test direct read and write"
xfs_io -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
xfs_io -d -c "pread -v 0 6619136"\
$SCRATCH_MNT/direct_io | _filter_xfs_io
xfs_io -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
xfs_io -d -c "pread -v 0 131072"\
$SCRATCH_MNT/async_direct_io | _filter_xfs_io
echo
echo "FSB Edge test"
xfs_io -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
echo
echo "Open Trunk test (O_TRUNC)"
for n in 0 1 2 3 4
do
xfs_io -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io
echo "Test" > $SCRATCH_MNT/$n
xfs_io -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io
cat $SCRATCH_MNT/$n
done
echo "DONE"
echo
echo "Append test"
echo "append to me" > $SCRATCH_MNT/append
xfs_io -a -c "pwrite -S 0x61 0 10" \
-c "pread -v 0 24"\
$SCRATCH_MNT/append | _filter_xfs_io
echo
echo "Small Vector Async"
echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
xfs_io -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
echo
echo "Small Vector Sync"
echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
xfs_io -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
status=0
exit