selftests: Add functional test for the abort file in fusectl
PATCH v2 1/1 selftests: Add functional test for the abort file in fusectl
This patch add a simple functional test for the "abort" file in fusectlfs (/sys/fs/fuse/connections/ID/about).
A simple fuse daemon is added for testing.
Related discussion can be found in the link below.
---
Changes in v2:
- Apply changes suggested by Amir Goldstein
- Check errno
- Link to v1: https://lore.kernel.org/all/[email protected]/
--- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + .../selftests/filesystems/fusectl/.gitignore | 3 + .../selftests/filesystems/fusectl/Makefile | 21 +++ .../selftests/filesystems/fusectl/fuse_mnt.c | 146 ++++++++++++++++++ .../filesystems/fusectl/fusectl_test.c | 116 ++++++++++++++ 6 files changed, 288 insertions(+) create mode 100644 tools/testing/selftests/filesystems/fusectl/.gitignore create mode 100644 tools/testing/selftests/filesystems/fusectl/Makefile create mode 100644 tools/testing/selftests/filesystems/fusectl/fuse_mnt.c create mode 100644 tools/testing/selftests/filesystems/fusectl/fusectl_test.c
MAINTAINERS +1 -0
@@ -9740,6 +9740,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git F: Documentation/filesystems/fuse.rst F: fs/fuse/ F: include/uapi/linux/fuse.h +F: tools/testing/selftests/filesystems/fusectl FUTEX SUBSYSTEM M: Thomas Gleixner <[email protected]>
tools/testing/selftests/Makefile +1 -0
@@ -36,6 +36,7 @@ TARGETS += filesystems/fat TARGETS += filesystems/overlayfs TARGETS += filesystems/statmount TARGETS += filesystems/mount-notify +TARGETS += filesystems/fusectl TARGETS += firmware TARGETS += fpu TARGETS += ftrace
tools/testing/selftests/filesystems/fusectl/.gitignore new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0-only +fuse_mnt +fusectl_test
tools/testing/selftests/filesystems/fusectl/Makefile new file +21 -0
@@ -0,0 +1,21 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +CFLAGS += -Wall -O2 -g $(KHDR_INCLUDES) + +TEST_GEN_PROGS := fusectl_test +TEST_GEN_FILES := fuse_mnt + +include ../../lib.mk + +VAR_CFLAGS := $(shell pkg-config fuse --cflags 2>/dev/null) +ifeq ($(VAR_CFLAGS),) +VAR_CFLAGS := -D_FILE_OFFSET_BITS=64 -I/usr/include/fuse +endif + +VAR_LDLIBS := $(shell pkg-config fuse --libs 2>/dev/null) +ifeq ($(VAR_LDLIBS),) +VAR_LDLIBS := -lfuse -pthread +endif + +$(OUTPUT)/fuse_mnt: CFLAGS += $(VAR_CFLAGS) +$(OUTPUT)/fuse_mnt: LDLIBS += $(VAR_LDLIBS)
tools/testing/selftests/filesystems/fusectl/fuse_mnt.c new file +146 -0
146 lines not on this page · raw message
tools/testing/selftests/filesystems/fusectl/fusectl_test.c new file +116 -0
116 lines not on this page · raw message
Signature · 1 line
2.43.0
Quoted 7 lines · Chen Linxuan
This patch add a simple functional test for the "abort" file in fusectlfs (
/sys/fs/fuse/connections/ID/about).A simple fuse daemon is added for testing.
Related discussion can be found in the link below.
Quoted 8 lines
Link https://lore.kernel.org/all/CAOQ4uxjKFXOKQxPpxtS6G_nR0tpw95w0GiO68UcWg_OBhmSY=Q@mail.gmail.com/ open hereCc Amir Goldstein <[email protected]>Signed-off-by Chen Linxuan <[email protected]>---
Changes in v2:
- Apply changes suggested by Amir Goldstein
- Check errno
- Link to v1: https://lore.kernel.org/all/[email protected]/
Short summary should include the test name:
selftests: filesystems: Add functional test for the abort file in fusectl
Also if this test requires root previlege, add check for it. The rest looks good to me.
thanks,
-- Shuah
Quoted 1 line · Shuah Khan
Also if this test requires root previlege, add check for it.
Currently, this test does not require root privileges.
Thanks,
Chen Linxuan
Quoted 8 lines · Chen Linxuan
Quoted 1 line · Shuah Khan
Also if this test requires root previlege, add check for it.
Currently, this test does not require root privileges.
Thanks,
Chen Linxuan
Thanks. Looks good to me.
thanks,
-- Shuah
V3 has been sent. See
https://lore.kernel.org/all/[email protected]/
Quoted 19 lines · Shuah Khan
Quoted 8 lines · Chen Linxuan
Quoted 1 line · Shuah Khan
Also if this test requires root previlege, add check for it.
Currently, this test does not require root privileges.
Thanks,
Chen LinxuanThanks. Looks good to me.
Acked-by Shuah Khan <[email protected]>thanks,
-- Shuah