forked from osandov/blktests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scsi/098: Test F2FS write hint support
- Loading branch information
1 parent
b4413ea
commit 4760880
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Running scsi/098 | ||
0 | ||
2 | ||
3 | ||
Test complete |