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>
This commit is contained in:
Eric Sandeen
2013-05-14 08:33:44 -05:00
committed by Rich Johnston
parent 2941898570
commit 96fce07867
30 changed files with 142 additions and 138 deletions
+15 -15
View File
@@ -63,7 +63,7 @@ _scratch_mkfs >/dev/null 2>&1
_scratch_mount
echo "End-of-file zeroing with direct I/O"
xfs_io -F -f -d -t -c "pwrite -S 0x63 0 65536" \
$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" \
@@ -71,46 +71,46 @@ xfs_io -F -f -d -t -c "pwrite -S 0x63 0 65536" \
echo
echo "Basic Block Hole test"
xfs_io -F -f -t -c "truncate 8192" \
$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 -F -f -t -c "pwrite -S 0x41 8000 1000" \
$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 -F -d -c "pwrite -S 0x78 20480 4096"\
$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 -F -c "pread -v 0 9000"\
$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 -F -f -d -t -c "pwrite -S 0x78 0 65536"\
$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 -F -d -c "pread -v 0 6619136"\
$XFS_IO_PROG -d -c "pread -v 0 6619136"\
$SCRATCH_MNT/direct_io | _filter_xfs_io_unique
xfs_io -F -f -d -t -c "pwrite -S 0x61 0 65536"\
$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 -F -d -c "pread -v 0 131072"\
$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 -F -f -t -c "truncate 131072"\
$XFS_IO_PROG -f -t -c "truncate 131072"\
-c "pwrite -S 0x5F 0 131072"\
-c "truncate 0"\
-c "truncate 131072"\
@@ -122,10 +122,10 @@ echo
echo "Open Trunk test (O_TRUNC)"
for n in 0 1 2 3 4
do
xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
$XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
echo "Test" > $SCRATCH_MNT/$n
xfs_io -F -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
$XFS_IO_PROG -f -t -c "pread -v 0 100" $SCRATCH_MNT/$n | _filter_xfs_io_unique
cat $SCRATCH_MNT/$n
done
echo "DONE"
@@ -133,14 +133,14 @@ echo "DONE"
echo
echo "Append test"
echo "append to me" > $SCRATCH_MNT/append
xfs_io -F -a -c "pwrite -S 0x61 0 10" \
$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 -F -f -c "pread -v 0 1"\
$XFS_IO_PROG -f -c "pread -v 0 1"\
-c "pread -v 1 1"\
-c "pread -v 2 1"\
-c "pread -v 3 1"\
@@ -199,7 +199,7 @@ xfs_io -F -f -c "pread -v 0 1"\
echo
echo "Small Vector Sync"
echo "abcdefghijklmnopqrstuvwxyz" > $SCRATCH_MNT/small_vector_async
xfs_io -F -f -s -c "pread -v 0 1"\
$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"\