mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
selftests: add memfd_create() + sealing tests
Some basic tests to verify sealing on memfds works as expected and guarantees the advertised semantics. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Hugh Dickins <hughd@google.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Ryan Lortie <desrt@desrt.ca> Cc: Lennart Poettering <lennart@poettering.net> Cc: Daniel Mack <zonque@gmail.com> Cc: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
9183df25fe
commit
4f5ce5e8d7
@@ -2,6 +2,7 @@ TARGETS = breakpoints
|
||||
TARGETS += cpu-hotplug
|
||||
TARGETS += efivarfs
|
||||
TARGETS += kcmp
|
||||
TARGETS += memfd
|
||||
TARGETS += memory-hotplug
|
||||
TARGETS += mqueue
|
||||
TARGETS += net
|
||||
|
||||
2
tools/testing/selftests/memfd/.gitignore
vendored
Normal file
2
tools/testing/selftests/memfd/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
memfd_test
|
||||
memfd-test-file
|
||||
29
tools/testing/selftests/memfd/Makefile
Normal file
29
tools/testing/selftests/memfd/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
uname_M := $(shell uname -m 2>/dev/null || echo not)
|
||||
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
|
||||
ifeq ($(ARCH),i386)
|
||||
ARCH := X86
|
||||
endif
|
||||
ifeq ($(ARCH),x86_64)
|
||||
ARCH := X86
|
||||
endif
|
||||
|
||||
CFLAGS += -I../../../../arch/x86/include/generated/uapi/
|
||||
CFLAGS += -I../../../../arch/x86/include/uapi/
|
||||
CFLAGS += -I../../../../include/uapi/
|
||||
CFLAGS += -I../../../../include/
|
||||
|
||||
all:
|
||||
ifeq ($(ARCH),X86)
|
||||
gcc $(CFLAGS) memfd_test.c -o memfd_test
|
||||
else
|
||||
echo "Not an x86 target, can't build memfd selftest"
|
||||
endif
|
||||
|
||||
run_tests: all
|
||||
ifeq ($(ARCH),X86)
|
||||
gcc $(CFLAGS) memfd_test.c -o memfd_test
|
||||
endif
|
||||
@./memfd_test || echo "memfd_test: [FAIL]"
|
||||
|
||||
clean:
|
||||
$(RM) memfd_test
|
||||
913
tools/testing/selftests/memfd/memfd_test.c
Normal file
913
tools/testing/selftests/memfd/memfd_test.c
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user