diff --git a/tests/scsi/098 b/tests/scsi/098 new file mode 100755 index 00000000..ea265019 --- /dev/null +++ b/tests/scsi/098 @@ -0,0 +1,57 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2022 Google LLC + +. tests/zbd/rc +. common/null_blk +. common/scsi_debug + +DESCRIPTION="test F2FS write hint support" +QUICK=1 + +requires() { + _have_fio + _have_driver f2fs + _have_program mkfs.f2fs + _have_module scsi_debug +} + +test() { + echo "Running ${TEST_NAME}" + + local mount_dir="$TMPDIR/mnt" + + local scsi_debug_params=( + delay=0 + dev_size_mb=1024 + sector_size=4096 + ) + _init_scsi_debug "${scsi_debug_params[@]}" && + local dev="/dev/${SCSI_DEBUG_DEVICES[0]}" fail && + ls -ld "${dev}" >>"${FULL}" && + mkfs.f2fs "${dev}" >>"${FULL}" 2>&1 && + mkdir -p "${mount_dir}" && + mount -t f2fs -o whint_mode=fs-based "${dev}" "${mount_dir}" && + local fio_args=( + --size=1M + --directory="${mount_dir}" + --time_based + --runtime=10 + ) && + _run_fio_verify_io "${fio_args[@]}" >>"${FULL}" 2>&1 || + fail=true + + umount "${mount_dir}" >>"${FULL}" 2>&1 + head -n 999 /sys/bus/pseudo/drivers/scsi_debug/group_number_stats >> "${FULL}" + while read -r group count; do + if [ "$count" -gt 0 ]; then echo "$group"; fi + done < /sys/bus/pseudo/drivers/scsi_debug/group_number_stats + _exit_scsi_debug + + if [ -z "$fail" ]; then + echo "Test complete" + else + echo "Test failed" + return 1 + fi +} diff --git a/tests/scsi/098.out b/tests/scsi/098.out new file mode 100644 index 00000000..04971d5b --- /dev/null +++ b/tests/scsi/098.out @@ -0,0 +1,5 @@ +Running scsi/098 +0 +2 +3 +Test complete