linux-stable/tools/testing/selftests/Makefile

104 lines
2.3 KiB
Makefile
Raw Normal View History

TARGETS = breakpoints
TARGETS += cpu-hotplug
TARGETS += efivarfs
TARGETS += exec
TARGETS += firmware
TARGETS += ftrace
TARGETS += futex
TARGETS += kcmp
TARGETS += membarrier
TARGETS += memfd
TARGETS += memory-hotplug
TARGETS += mount
TARGETS += mqueue
TARGETS += net
TARGETS += powerpc
TARGETS += ptrace
TARGETS += seccomp
TARGETS += size
TARGETS += sysctl
ifneq (1, $(quicktest))
TARGETS += timers
endif
TARGETS += user
TARGETS += jumplabel
TARGETS += vm
x86, selftests: Add sigreturn selftest This is my sigreturn test, added mostly unchanged from its old home. It exercises the sigreturn(2) syscall, specifically focusing on its interactions with various IRET corner cases. It tests for correct behavior in several areas that were historically dangerously buggy. For example, it exercises espfix on kernels of both bitnesses under various conditions, and it contains testcases for several now-fixed bugs in IRET error handling. If you run it on older kernels without the fixes, your system will crash. It probably won't eat your data in the process. There is no released kernel on which the sigreturn_64 test will pass, but it passes on tip:x86/asm. I plan to switch to lib.mk for Linux 4.2. I'm not using the ksft_ helpers at all yet. I can do that later. Signed-off-by: Andy Lutomirski <luto@kernel.org> Acked-by: Shuah Khan <shuahkh@osg.samsung.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Denys Vlasenko <vda.linux@googlemail.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Shuah Khan <shuah.kh@samsung.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/89d10b76b92c7202d8123654dc8d36701c017b3d.1428386971.git.luto@kernel.org [ Fixed empty format string GCC build warning in trivial_32bit_program.c ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-04-07 06:11:06 +00:00
TARGETS += x86
selftests/zram: Adding zram tests zram: Compressed RAM based block devices ---------------------------------------- The zram module creates RAM based block devices named /dev/zram<id> (<id> = 0, 1, ...). Pages written to these disks are compressed and stored in memory itself. These disks allow very fast I/O and compression provides good amounts of memory savings. Some of the usecases include /tmp storage, use as swap disks, various caches under /var and maybe many more :) Statistics for individual zram devices are exported through sysfs nodes at /sys/block/zram<id>/ This patch is to validate the zram functionality. Test interacts with block device /dev/zram<id> and sysfs nodes /sys/block/zram<id>/ zram.sh: sanity check of CONFIG_ZRAM and to run zram01 and zram02 tests zram01.sh: creates general purpose ram disks with different filesystems zram02.sh: creates block device for swap zram_lib.sh: create library with initialization/cleanup functions README: ZRAM introduction and Kconfig required. Makefile: To run zram tests zram test output ----------------- ./zram.sh -------------------- running zram tests -------------------- /dev/zram0 device file found: OK set max_comp_streams to zram device(s) /sys/block/zram0/max_comp_streams = '2' (1/1) zram max streams: OK test that we can set compression algorithm supported algs: [lzo] lz4 /sys/block/zram0/comp_algorithm = 'lzo' (1/1) zram set compression algorithm: OK set disk size to zram device(s) /sys/block/zram0/disksize = '2097152' (1/1) zram set disksizes: OK set memory limit to zram device(s) /sys/block/zram0/mem_limit = '2M' (1/1) zram set memory limit: OK make ext4 filesystem on /dev/zram0 zram mkfs.ext4: OK mount /dev/zram0 zram mount of zram device(s): OK fill zram0... zram0 can be filled with '1932' KB zram used 3M, zram disk sizes 2097152M zram compression ratio: 699050.66:1: OK zram cleanup zram01 : [PASS] /dev/zram0 device file found: OK set max_comp_streams to zram device(s) /sys/block/zram0/max_comp_streams = '2' (1/1) zram max streams: OK set disk size to zram device(s) /sys/block/zram0/disksize = '1048576' (1/1) zram set disksizes: OK set memory limit to zram device(s) /sys/block/zram0/mem_limit = '1M' (1/1) zram set memory limit: OK make swap with zram device(s) done with /dev/zram0 zram making zram mkswap and swapon: OK zram swapoff: OK zram cleanup zram02 : [PASS] CC: Shuah Khan <shuahkh@osg.samsung.com> CC: Tyler Baker <tyler.baker@linaro.org> CC: Milosz Wasilewski <milosz.wasilewski@linaro.org> CC: Alexey Kodanev <alexey.kodanev@oracle.com> Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com> Reviewed-By: Tyler Baker <tyler.baker@linaro.org> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
2015-08-18 07:01:59 +00:00
TARGETS += zram
#Please keep the TARGETS list alphabetically sorted
# Run "make quicktest=1 run_tests" or
# "make quicktest=1 kselftest from top level Makefile
TARGETS_HOTPLUG = cpu-hotplug
TARGETS_HOTPLUG += memory-hotplug
# Clear LDFLAGS and MAKEFLAGS if called from main
# Makefile to avoid test build failures when test
# Makefile doesn't have explicit build rules.
ifeq (1,$(MAKELEVEL))
override LDFLAGS =
override MAKEFLAGS =
endif
all:
for TARGET in $(TARGETS); do \
make -C $$TARGET; \
done;
run_tests: all
for TARGET in $(TARGETS); do \
make -C $$TARGET run_tests; \
done;
hotplug:
for TARGET in $(TARGETS_HOTPLUG); do \
make -C $$TARGET; \
done;
run_hotplug: hotplug
for TARGET in $(TARGETS_HOTPLUG); do \
make -C $$TARGET run_full_test; \
done;
clean_hotplug:
for TARGET in $(TARGETS_HOTPLUG); do \
make -C $$TARGET clean; \
done;
INSTALL_PATH ?= install
INSTALL_PATH := $(abspath $(INSTALL_PATH))
ALL_SCRIPT := $(INSTALL_PATH)/run_kselftest.sh
install:
ifdef INSTALL_PATH
@# Ask all targets to install their files
mkdir -p $(INSTALL_PATH)
for TARGET in $(TARGETS); do \
make -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \
done;
@# Ask all targets to emit their test scripts
echo "#!/bin/bash" > $(ALL_SCRIPT)
echo "cd \$$(dirname \$$0)" >> $(ALL_SCRIPT)
echo "ROOT=\$$PWD" >> $(ALL_SCRIPT)
for TARGET in $(TARGETS); do \
echo "echo ; echo Running tests in $$TARGET" >> $(ALL_SCRIPT); \
echo "echo ========================================" >> $(ALL_SCRIPT); \
echo "cd $$TARGET" >> $(ALL_SCRIPT); \
make -s --no-print-directory -C $$TARGET emit_tests >> $(ALL_SCRIPT); \
echo "cd \$$ROOT" >> $(ALL_SCRIPT); \
done;
chmod u+x $(ALL_SCRIPT)
else
$(error Error: set INSTALL_PATH to use install)
endif
clean:
for TARGET in $(TARGETS); do \
make -C $$TARGET clean; \
done;
.PHONY: install