Commit 6aecda00 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

selftests: ublk: add kernel selftests for ublk



Both ublk driver and userspace heavily depends on io_uring subsystem,
and tools/testing/selftests/ should be the best place for holding this
cross-subsystem tests.

Add basic read/write IO test over this ublk null disk, and make sure ublk
working.

More tests will be added.

Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250228161919.2869102-2-ming.lei@redhat.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ed9f3112
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24237,6 +24237,7 @@ S: Maintained
F:	Documentation/block/ublk.rst
F:	drivers/block/ublk_drv.c
F:	include/uapi/linux/ublk_cmd.h
F:	tools/testing/selftests/ublk/
UBSAN
M:	Kees Cook <kees@kernel.org>
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ endif
TARGETS += tmpfs
TARGETS += tpm2
TARGETS += tty
TARGETS += ublk
TARGETS += uevent
TARGETS += user_events
TARGETS += vDSO
+3 −0
Original line number Diff line number Diff line
kublk
/tools
*-verify.state
+12 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0

CFLAGS += -O3 -Wl,-no-as-needed -Wall -I $(top_srcdir)
LDLIBS += -lpthread -lm -luring

TEST_PROGS := test_null_01.sh

TEST_GEN_PROGS_EXTENDED = kublk

include ../lib.mk

$(TEST_GEN_PROGS_EXTENDED): kublk.c null.c
+1 −0
Original line number Diff line number Diff line
CONFIG_BLK_DEV_UBLK=m
Loading