# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="run null-blk in blocking mode"
TIMED=1
requires() {
- _have_module null_blk && _have_module_param null_blk blocking && _have_fio
+ _have_null_blk && _have_module_param null_blk blocking && _have_fio
}
test() {
_divide_timeout 2
FIO_PERF_FIELDS=("read iops")
- modprobe -r null_blk
- if ! modprobe null_blk queue_mode=2 submit_queues=2 blocking=1; then
+ if ! _init_null_blk queue_mode=2 submit_queues=2 blocking=1; then
return 1
fi
--rw=randread --norandommap --name=async \
--filename=/dev/nullb0 --size=5g --direct=1
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="run I/O on null_blk with shared and non-shared tags"
TIMED=1
requires() {
- _have_module null_blk && _have_module_param null_blk shared_tags && _have_fio
+ _have_null_blk && _have_module_param null_blk shared_tags && _have_fio
}
run_fio_job() {
_divide_timeout 2
- modprobe -r null_blk
- if ! modprobe null_blk queue_mode=2 submit_queues=16 nr_devices=32; then
+ if ! _init_null_blk queue_mode=2 submit_queues=16 nr_devices=32; then
return 1
fi
FIO_PERF_FIELDS=("read iops")
run_fio_job
- udevadm settle
- modprobe -r null_blk
- if ! modprobe null_blk queue_mode=2 submit_queues=16 nr_devices=32 shared_tags=1; then
+ _exit_null_blk
+ if ! _init_null_blk queue_mode=2 submit_queues=16 nr_devices=32 shared_tags=1; then
return 1
fi
FIO_PERF_FIELDS=("read iops")
run_fio_job
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="run null-blk with blk-mq and timeout injection configured"
requires() {
- _have_module null-blk && _have_module_param null_blk timeout
+ _have_null_blk && _have_module_param null_blk timeout
}
test() {
echo "Running ${TEST_NAME}"
- modprobe -r null_blk
-
# The format is "<interval>,<probability>,<space>,<times>". Here, we
# fail 50% of I/Os.
- modprobe null_blk queue_mode=2 timeout='1,50,0,-1'
+ if ! _init_null_blk queue_mode=2 timeout='1,50,0,-1'; then
+ return 1
+ fi
local scheds
# shellcheck disable=SC2207
wait
done
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="run null-blk on different schedulers with requeue injection configured"
QUICK=1
requires() {
- _have_module null-blk && _have_module_param null_blk requeue
+ _have_null_blk && _have_module_param null_blk requeue
}
test() {
echo "Running ${TEST_NAME}"
- modprobe -r null_blk
-
# The format is "<interval>,<probability>,<space>,<times>". Here, we
# requeue 10% of the time.
- modprobe null_blk queue_mode=2 requeue='1,10,0,-1'
+ if ! _init_null_blk queue_mode=2 requeue='1,10,0,-1'; then
+ return 1
+ fi
local scheds
# shellcheck disable=SC2207
iflag=direct status=none
done
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="send a signal to a process waiting on a frozen queue"
QUICK=1
requires() {
- _have_module null_blk
+ _have_null_blk
}
test() {
echo "Running ${TEST_NAME}"
- modprobe -r null_blk
-
- modprobe null_blk queue_mode=2 irqmode=2 completion_nsec=2000000000
+ if ! _init_null_blk null_blk queue_mode=2 irqmode=2 completion_nsec=2000000000; then
+ return 1
+ fi
# Start an I/O, which will take two seconds.
dd if=/dev/nullb0 of=/dev/null bs=512 iflag=direct count=1 status=none &
kill -USR1 $!
wait
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="do I/O and check the inflight counter"
QUICK=1
requires() {
- _have_module null_blk
+ _have_null_blk
}
show_inflight() {
for ((queue_mode = 1; queue_mode <= 2; queue_mode++)) do
echo "queue mode $queue_mode"
- modprobe -r null_blk
- modprobe null_blk queue_mode="$queue_mode" irqmode=2 \
- completion_nsec=500000000 || continue
-
- udevadm settle
+ if ! _init_null_blk queue_mode="$queue_mode" irqmode=2 \
+ completion_nsec=500000000; then
+ continue
+ fi
dd if=/dev/nullb0 of=/dev/null bs=4096 iflag=direct count=1 status=none &
sleep 0.1
wait
show_inflight
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
done
echo "Test complete"
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="do I/O and check iostats times"
QUICK=1
requires() {
- _have_module null_blk
+ _have_null_blk
}
init_times() {
echo "queue mode $queue_mode"
- modprobe -r null_blk
- modprobe null_blk queue_mode="$queue_mode" irqmode=2 \
- completion_nsec=1000000000 || continue
+ if ! modprobe null_blk queue_mode="$queue_mode" irqmode=2 \
+ completion_nsec=1000000000; then
+ continue
+ fi
udevadm settle
wait
show_times
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
unset init_read_ms init_write_ms read_ms write_ms
done
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="run null-blk on different schedulers with only one hardware tag"
QUICK=1
requires() {
- _have_module null_blk && _have_fio
+ _have_null_blk && _have_fio
}
test() {
echo "Running ${TEST_NAME}"
- modprobe -r null_blk
- modprobe null_blk queue_mode=2 irqmode=2 completion_nsec=2000000 \
- submit_queues=4 hw_queue_depth=1
+ if ! _init_null_blk queue_mode=2 irqmode=2 completion_nsec=2000000 \
+ submit_queues=4 hw_queue_depth=1; then
+ return 1
+ fi
local scheds
# shellcheck disable=SC2207
--runtime=10
done
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="read/write nr_requests on null-blk with different schedulers"
QUICK=1
requires() {
- _have_module null_blk
+ _have_null_blk
}
test() {
echo "Running ${TEST_NAME}"
- modprobe -r null_blk
- modprobe null_blk
+ if ! _init_null_blk; then
+ return 1
+ fi
local max_nr
local nr
done
done
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. tests/block/rc
+. common/null_blk
DESCRIPTION="run null-blk with legacy blk path and timeout injection configured"
requires() {
- _have_module null-blk && _have_module_param null_blk timeout
+ _have_null_blk && _have_module_param null_blk timeout
}
test() {
echo "Running ${TEST_NAME}"
- modprobe -r null_blk
-
# The format is "<interval>,<probability>,<space>,<times>". Here, we
# fail 50% of I/Os.
- modprobe null_blk queue_mode=1 timeout='1,50,0,-1'
+ if ! _init_null_blk queue_mode=1 timeout='1,50,0,-1'; then
+ return 1
+ fi
local scheds
# shellcheck disable=SC2207
wait
done
- udevadm settle
- modprobe -r null_blk
+ _exit_null_blk
echo "Test complete"
}