forked from linux-blktests/blktests
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path010
More file actions
executable file
·73 lines (64 loc) · 1.42 KB
/
010
File metadata and controls
executable file
·73 lines (64 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0+
# Copyright (C) 2022 Google LLC
. tests/zbd/rc
. common/null_blk
. common/scsi_debug
DESCRIPTION="test gap zone support with F2FS"
QUICK=1
requires() {
_have_fio
_have_driver f2fs
_have_module null_blk
_have_module_param scsi_debug zone_cap_mb
_have_program mkfs.f2fs
_have_module scsi_debug
_page_size_equals 4096
}
test() {
echo "Running ${TEST_NAME}"
local mount_dir="$TMPDIR/mnt"
local null_blk_params=(
blocksize=4096
completion_nsec=0
memory_backed=1
size=1024 # MB
submit_queues=1
power=1
)
_init_null_blk nr_devices=0 queue_mode=2 &&
_configure_null_blk nullb0 "${null_blk_params[@]}" || return $?
local cdev=/dev/nullb0
local scsi_debug_params=(
delay=0
dev_size_mb=1024
sector_size=4096
zbc=host-managed
zone_cap_mb=3
zone_nr_conv=0
zone_size_mb=4
)
_init_scsi_debug "${scsi_debug_params[@]}" &&
local zdev="/dev/${SCSI_DEBUG_DEVICES[0]}" fail &&
ls -ld "${cdev}" "${zdev}" >>"${FULL}" &&
mkfs.f2fs -m "${cdev}" -c "${zdev}" >>"${FULL}" 2>&1 &&
mkdir -p "${mount_dir}" &&
mount -t f2fs "${cdev}" "${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
_exit_scsi_debug
_exit_null_blk
if [ -z "$fail" ]; then
echo "Test complete"
else
echo "Test failed"
return 1
fi
}