fi
}
-_test_batched_discard()
+_require_batched_discard()
{
if [ $# -ne 1 ]; then
- echo "Usage: _test_batched_discard mnt_point" 1>&2
+ echo "Usage: _require_batched_discard mnt_point" 1>&2
exit 1
fi
_require_fstrim
- $FSTRIM_PROG ${1} &>/dev/null
+ [$FSTRIM_PROG $1 > /dev/null 2>&1] || _notrun "FITRIM not supported on $1"
}
_require_dumpe2fs()
_supported_fs generic
_supported_os Linux
_require_scratch
-_require_fstrim
rm -f $seqres.full
_scratch_mkfs >>$seqres.full 2>&1
_require_fs_space $SCRATCH_MNT $((10 * 1024 * 1024))
_scratch_mount
+_require_batched_discard $SCRATCH_MNT
for ((i = 0; i < $((4 * $LOAD_FACTOR)); i++)); do
trim_loop &
_supported_fs generic
_supported_os Linux
_require_scratch
-_require_fstrim
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
+_require_batched_discard $SCRATCH_MNT
_cleanup()
{
nproc=20
content=$here
-# Check for FITRIM support
-echo -n "Checking FITRIM support: "
-_test_batched_discard $SCRATCH_MNT || _notrun "FITRIM not supported on $SCRATCH_DEV"
-echo "done."
-
mkdir -p $tmp
(
QA output created by 251
-Checking FITRIM support: done.
Running the test: done.
_supported_fs generic
_supported_os Linux
_require_math
-_require_fstrim
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
-_test_batched_discard $SCRATCH_MNT || _notrun "FITRIM not supported on $SCRATCH_DEV"
+_require_batched_discard $SCRATCH_MNT
fssize=$($DF_PROG -k | grep "$SCRATCH_MNT" | grep "$SCRATCH_DEV" | awk '{print $3}')
_supported_fs generic
_supported_os Linux
-_require_fstrim
_require_scratch
_scratch_mkfs >/dev/null 2>&1
_scratch_mount
-_test_batched_discard $SCRATCH_MNT || _notrun "FITRIM not supported on $SCRATCH_DEV"
+_require_batched_discard $SCRATCH_MNT
echo "[+] Length is zero (should fail)"
out=$("$FSTRIM_PROG" -v -o0 -l0 $SCRATCH_MNT 2>&1)