mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: add aiodio helper functions
For 198, 239 and 240, use _require_aiodio to fail gracefully if required program was not built. For 207-212, use _run_aiodio that includes _require_aiodio and kicks specified aio-dio program, to make code expressly simple. Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
b235a158b1
commit
c61d37c072
@@ -44,6 +44,7 @@ _cleanup()
|
||||
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
_require_aiodio aiodio_sparse2
|
||||
|
||||
echo "Silence is golden."
|
||||
|
||||
@@ -51,7 +52,7 @@ echo "Silence is golden."
|
||||
rm -f $seq.full
|
||||
|
||||
rm -f "$TEST_DIR/aiodio_sparse*"
|
||||
$here/src/aio-dio-regress/aiodio_sparse2 "$TEST_DIR/aiodio_sparse"
|
||||
$AIO_TEST "$TEST_DIR/aiodio_sparse"
|
||||
|
||||
status=$?
|
||||
exit
|
||||
|
||||
@@ -46,11 +46,6 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
AIO_TEST=src/aio-dio-regress/aio-dio-extend-stat
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
$AIO_TEST $TEST_DIR/aio-testfile 2>&1
|
||||
status=$?
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
_run_aiodio aio-dio-extend-stat
|
||||
|
||||
exit $status
|
||||
|
||||
@@ -46,11 +46,6 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
AIO_TEST=src/aio-dio-regress/aio-dio-invalidate-failure
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
$AIO_TEST $TEST_DIR/aio-testfile 2>&1
|
||||
status=$?
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
_run_aiodio aio-dio-invalidate-failure
|
||||
|
||||
exit $status
|
||||
|
||||
@@ -46,11 +46,6 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
AIO_TEST=src/aio-dio-regress/aio-dio-invalidate-readahead
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
$AIO_TEST $TEST_DIR/aio-testfile 2>&1
|
||||
status=$?
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
_run_aiodio aio-dio-invalidate-readahead
|
||||
|
||||
exit $status
|
||||
|
||||
@@ -46,11 +46,6 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
AIO_TEST=src/aio-dio-regress/aio-dio-subblock-eof-read
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
$AIO_TEST $TEST_DIR/aio-testfile 2>&1
|
||||
status=$?
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
_run_aiodio aio-dio-subblock-eof-read
|
||||
|
||||
exit $status
|
||||
|
||||
@@ -46,11 +46,6 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
AIO_TEST=src/aio-dio-regress/aio-free-ring-with-bogus-nr-pages
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
$AIO_TEST $TEST_DIR/aio-testfile 2>&1
|
||||
status=$?
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
_run_aiodio aio-free-ring-with-bogus-nr-pages
|
||||
|
||||
exit $status
|
||||
|
||||
@@ -47,11 +47,6 @@ _cleanup()
|
||||
_supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
AIO_TEST=src/aio-dio-regress/aio-io-setup-with-nonwritable-context-pointer
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
$AIO_TEST $TEST_DIR/aio-testfile 2>&1
|
||||
status=$?
|
||||
rm -f $TEST_DIR/aio-testfile
|
||||
_run_aiodio aio-io-setup-with-nonwritable-context-pointer
|
||||
|
||||
exit $status
|
||||
|
||||
@@ -46,9 +46,7 @@ _supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
_require_sparse_files
|
||||
|
||||
AIO_TEST=src/aio-dio-regress/aio-dio-hole-filling-race
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
_require_aiodio aio-dio-hole-filling-race
|
||||
|
||||
echo "Silence is golden"
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ _supported_fs generic
|
||||
_supported_os Linux
|
||||
|
||||
_require_sparse_files
|
||||
_require_aiodio aiodio_sparse2
|
||||
|
||||
echo "Silence is golden."
|
||||
|
||||
@@ -69,7 +70,7 @@ fi
|
||||
|
||||
# 2 threads, fs block sized writes, 64k filesize, stride through file by
|
||||
# fs block size, start at logical block size offset
|
||||
$here/src/aio-dio-regress/aiodio_sparse2 -i 2 -w $fs_block_size -s 64k -n $fs_block_size -o $logical_block_size "$TEST_DIR/aiodio_sparse"
|
||||
$AIO_TEST -i 2 -w $fs_block_size -s 64k -n $fs_block_size -o $logical_block_size "$TEST_DIR/aiodio_sparse"
|
||||
|
||||
status=$?
|
||||
exit
|
||||
|
||||
@@ -864,6 +864,42 @@ _require_nonexternal()
|
||||
_notrun "External device testing in progress, skipped this test"
|
||||
}
|
||||
|
||||
# this test requires that a (specified) aio-dio executable exists
|
||||
# $1 - command (optional)
|
||||
#
|
||||
_require_aiodio()
|
||||
{
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
AIO_TEST=src/aio-dio-regress/aiodio_sparse2
|
||||
[ -x $AIO_TEST ] || _notrun "aio-dio utilities required"
|
||||
else
|
||||
AIO_TEST=src/aio-dio-regress/$1
|
||||
[ -x $AIO_TEST ] || _notrun "$AIO_TEST not built"
|
||||
fi
|
||||
}
|
||||
|
||||
# run an aio-dio program
|
||||
# $1 - command
|
||||
_run_aiodio()
|
||||
{
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "usage: _run_aiodio command_name" 2>&1
|
||||
status=1; exit 1
|
||||
fi
|
||||
|
||||
_require_aiodio $1
|
||||
|
||||
local testtemp=$TEST_DIR/aio-testfile
|
||||
rm -f $testtemp
|
||||
$AIO_TEST $testtemp 2>&1
|
||||
status=$?
|
||||
rm -f $testtemp
|
||||
|
||||
return $status
|
||||
}
|
||||
|
||||
# indicate whether YP/NIS is active or not
|
||||
#
|
||||
_yp_active()
|
||||
|
||||
Reference in New Issue
Block a user