From 47a18c42d99268a25689ecfac9e28c24af13d104 Mon Sep 17 00:00:00 2001 From: Pintu Agarwal Date: Wed, 1 Nov 2017 13:00:39 -0400 Subject: android/ion: userspace test utility for ion buffer sharing This is a test utility to verify ION buffer sharing in user space between 2 independent processes. It uses unix domain socket (with SCM_RIGHTS) as IPC to transfer an FD to another process to share the same buffer. This utility demonstrates how ION buffer sharing can be implemented between two user space processes, using various heap types. This utility is made to be run as part of kselftest framework in kernel. The utility is verified on Ubuntu-32 bit system with Linux Kernel 4.14, using ION system heap. For more information about the utility please check the README file. Signed-off-by: Pintu Agarwal Signed-off-by: Shuah Khan --- tools/testing/selftests/android/Makefile | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tools/testing/selftests/android/Makefile (limited to 'tools/testing/selftests/android/Makefile') diff --git a/tools/testing/selftests/android/Makefile b/tools/testing/selftests/android/Makefile new file mode 100644 index 000000000000..1a7492268993 --- /dev/null +++ b/tools/testing/selftests/android/Makefile @@ -0,0 +1,46 @@ +SUBDIRS := ion + +TEST_PROGS := run.sh + +.PHONY: all clean + +include ../lib.mk + +all: + @for DIR in $(SUBDIRS); do \ + BUILD_TARGET=$(OUTPUT)/$$DIR; \ + mkdir $$BUILD_TARGET -p; \ + make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + #SUBDIR test prog name should be in the form: SUBDIR_test.sh + TEST=$$DIR"_test.sh"; \ + if [ -e $$DIR/$$TEST ]; then + rsync -a $$DIR/$$TEST $$BUILD_TARGET/; + fi + done + +override define RUN_TESTS + @cd $(OUTPUT); ./run.sh +endef + +override define INSTALL_RULE + mkdir -p $(INSTALL_PATH) + install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) + + @for SUBDIR in $(SUBDIRS); do \ + BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \ + mkdir $$BUILD_TARGET -p; \ + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \ + done; +endef + +override define EMIT_TESTS + echo "./run.sh" +endef + +override define CLEAN + @for DIR in $(SUBDIRS); do \ + BUILD_TARGET=$(OUTPUT)/$$DIR; \ + mkdir $$BUILD_TARGET -p; \ + make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\ + done +endef -- cgit