mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic: use xfs_io falloc, not fallocate
generic/315 fails messily if the fallocate command isn't present. generic/299 also uses "fallocate" and "truncate" binaries which may not be present. Switch both to use xfs_io, and we already have the _require for that, because it's what every other test uses... Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
c7aa9d3cb0
commit
ca28228cd6
+5
-3
@@ -110,6 +110,7 @@ filename=buffered-aio-verifier
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
_require_fio $fio_config
|
_require_fio $fio_config
|
||||||
|
_require_xfs_io_command "falloc"
|
||||||
|
|
||||||
_workout()
|
_workout()
|
||||||
{
|
{
|
||||||
@@ -125,12 +126,13 @@ _workout()
|
|||||||
do
|
do
|
||||||
for ((k=1; k <= NUM_JOBS; k++))
|
for ((k=1; k <= NUM_JOBS; k++))
|
||||||
do
|
do
|
||||||
fallocate -l $FILE_SIZE $SCRATCH_MNT/direct_aio.$k.0 \
|
$XFS_IO_PROG -f -c "falloc 0 $FILE_SIZE" \
|
||||||
>> $seqres.full 2>&1
|
$SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
|
||||||
done
|
done
|
||||||
for ((k=1; k <= NUM_JOBS; k++))
|
for ((k=1; k <= NUM_JOBS; k++))
|
||||||
do
|
do
|
||||||
truncate -s 0 $SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
|
$XFS_IO_PROG -c "truncate 0" \
|
||||||
|
$SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
|
||||||
done
|
done
|
||||||
# Following like will check that pid is still run.
|
# Following like will check that pid is still run.
|
||||||
# Once fio exit we can stop fallocate/truncate loop
|
# Once fio exit we can stop fallocate/truncate loop
|
||||||
|
|||||||
+3
-1
@@ -49,6 +49,7 @@ _cleanup()
|
|||||||
_supported_fs generic
|
_supported_fs generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
_require_test
|
_require_test
|
||||||
|
_require_xfs_io_command "falloc"
|
||||||
|
|
||||||
rm -f $seqres.full
|
rm -f $seqres.full
|
||||||
|
|
||||||
@@ -62,7 +63,8 @@ avail_begin=`df -P $TEST_DIR | awk 'END {print $4}'`
|
|||||||
# Preallocate half size of the available disk space to a file
|
# Preallocate half size of the available disk space to a file
|
||||||
# starts from offset 0 with FALLOC_FL_KEEP_SIZE option on the
|
# starts from offset 0 with FALLOC_FL_KEEP_SIZE option on the
|
||||||
# test file system.
|
# test file system.
|
||||||
fallocate -n -o 0 -l $(($avail_begin/2)) $TEST_DIR/testfile.$seq >>$seqres.full 2>&1
|
$XFS_IO_PROG -f -c 'falloc -k 0 $(($avail_begin/2))' \
|
||||||
|
$TEST_DIR/testfile.$seq >>$seqres.full 2>&1
|
||||||
|
|
||||||
# Verify the file size, it should keep unchanged as 0 in this case
|
# Verify the file size, it should keep unchanged as 0 in this case
|
||||||
fsize=`ls -l $TEST_DIR/testfile.$seq | awk '{print $5}'`
|
fsize=`ls -l $TEST_DIR/testfile.$seq | awk '{print $5}'`
|
||||||
|
|||||||
Reference in New Issue
Block a user