Merge tag 'linux-kselftest-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:
 "This is a milestone update in a sense.  Several new tests and install
  and packaging support is added in this update.

  This update adds install and packaging tools developed on top of
  back-end shared logic enhancemnets to run and install tests.  In
  addition several timer tests are added.

   - New timer tests from John Stultz

   - rtc test from Prarit Bhargava

   - Enhancements to un and install tests from Michael Ellerman

   - Install and packaging tools from Shuah Khan

   - Cross-compilation enablement from Tyler Baker

   - A couple of bug fixes"

* tag 'linux-kselftest-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (42 commits)
  ftracetest: Do not use usleep directly
  selftest/mqueue: enable cross compilation
  selftest/ipc: enable cross compilation
  selftest/memfd: include default header install path
  selftest/mount: enable cross compilation
  selftest/memfd: enable cross compilation
  kselftests: timers: Make set-timer-lat fail more gracefully for !CAP_WAKE_ALARM
  selftests: Change memory on-off-test.sh name to be unique
  selftests: change cpu on-off-test.sh name to be unique
  selftests/mount: Make git ignore all binaries in mount test suite
  kselftests: timers: Reduce default runtime on inconsistency-check and set-timer-lat
  ftracetest: Convert exit -1 to exit $FAIL
  ftracetest: Cope properly with stack tracer not being enabled
  tools, update rtctest.c to verify passage of time
  Documentation, split up rtc.txt into documentation and test file
  selftests: Add tool to generate kselftest tar archive
  selftests: Add kselftest install tool
  selftests: Set CC using CROSS_COMPILE once in lib.mk
  selftests: Add install support for the powerpc tests
  selftests/timers: Use shared logic to run and install tests
  ...
This commit is contained in:
Linus Torvalds
2015-04-13 08:59:21 -07:00
69 changed files with 3368 additions and 461 deletions
+33
View File
@@ -55,7 +55,40 @@ clean_hotplug:
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 \
mkdir -p $(INSTALL_PATH)/$$TARGET ; \
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
+3 -2
View File
@@ -16,8 +16,9 @@ else
echo "Not an x86 target, can't build breakpoints selftests"
endif
run_tests:
@./breakpoint_test || echo "breakpoints selftests: [FAIL]"
TEST_PROGS := breakpoint_test
include ../lib.mk
clean:
rm -fr breakpoint_test
+4 -3
View File
@@ -1,9 +1,10 @@
all:
run_tests:
@/bin/bash ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]"
TEST_PROGS := cpu-on-off-test.sh
include ../lib.mk
run_full_test:
@/bin/bash ./on-off-test.sh -a || echo "cpu-hotplug selftests: [FAIL]"
@/bin/bash ./cpu-on-off-test.sh -a || echo "cpu-hotplug selftests: [FAIL]"
clean:
+4 -3
View File
@@ -1,12 +1,13 @@
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall
test_objs = open-unlink create-read
all: $(test_objs)
run_tests: all
@/bin/bash ./efivarfs.sh || echo "efivarfs selftests: [FAIL]"
TEST_PROGS := efivarfs.sh
TEST_FILES := $(test_objs)
include ../lib.mk
clean:
rm -f $(test_objs)
View File
+6 -3
View File
@@ -1,4 +1,3 @@
CC = $(CROSS_COMPILE)gcc
CFLAGS = -Wall
BINARIES = execveat
DEPS = execveat.symlink execveat.denatured script subdir
@@ -18,8 +17,12 @@ execveat.denatured: execveat
%: %.c
$(CC) $(CFLAGS) -o $@ $^
run_tests: all
./execveat
TEST_PROGS := execveat
TEST_FILES := $(DEPS)
include ../lib.mk
override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
clean:
rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
+2 -18
View File
@@ -3,25 +3,9 @@
# No binaries, but make sure arg-less "make" doesn't trigger "run_tests"
all:
fw_filesystem:
@if /bin/sh ./fw_filesystem.sh ; then \
echo "fw_filesystem: ok"; \
else \
echo "fw_filesystem: [FAIL]"; \
exit 1; \
fi
TEST_PROGS := fw_filesystem.sh fw_userhelper.sh
fw_userhelper:
@if /bin/sh ./fw_userhelper.sh ; then \
echo "fw_userhelper: ok"; \
else \
echo "fw_userhelper: [FAIL]"; \
exit 1; \
fi
run_tests: all fw_filesystem fw_userhelper
include ../lib.mk
# Nothing to clean up.
clean:
.PHONY: all clean run_tests fw_filesystem fw_userhelper
View File
View File
+3 -2
View File
@@ -1,7 +1,8 @@
all:
run_tests:
@/bin/sh ./ftracetest || echo "ftrace selftests: [FAIL]"
TEST_PROGS := ftracetest
include ../lib.mk
clean:
rm -rf logs/*
@@ -2,4 +2,4 @@
# description: Basic event tracing check
test -f available_events -a -f set_event -a -d events
# check scheduler events are available
grep -q sched available_events && exit 0 || exit -1
grep -q sched available_events && exit 0 || exit $FAIL
@@ -9,7 +9,11 @@ do_reset() {
fail() { #msg
do_reset
echo $1
exit -1
exit $FAIL
}
yield() {
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
}
if [ ! -f set_event -o ! -d events/sched ]; then
@@ -21,7 +25,8 @@ reset_tracer
do_reset
echo 'sched:sched_switch' > set_event
usleep 1
yield
count=`cat trace | grep sched_switch | wc -l`
if [ $count -eq 0 ]; then
@@ -31,7 +36,8 @@ fi
do_reset
echo 1 > events/sched/sched_switch/enable
usleep 1
yield
count=`cat trace | grep sched_switch | wc -l`
if [ $count -eq 0 ]; then
@@ -41,7 +47,8 @@ fi
do_reset
echo 0 > events/sched/sched_switch/enable
usleep 1
yield
count=`cat trace | grep sched_switch | wc -l`
if [ $count -ne 0 ]; then
@@ -9,7 +9,11 @@ do_reset() {
fail() { #msg
do_reset
echo $1
exit -1
exit $FAIL
}
yield() {
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
}
if [ ! -f set_event -o ! -d events/sched ]; then
@@ -21,7 +25,8 @@ reset_tracer
do_reset
echo 'sched:*' > set_event
usleep 1
yield
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
if [ $count -lt 3 ]; then
@@ -31,7 +36,8 @@ fi
do_reset
echo 1 > events/sched/enable
usleep 1
yield
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
if [ $count -lt 3 ]; then
@@ -41,7 +47,8 @@ fi
do_reset
echo 0 > events/sched/enable
usleep 1
yield
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
if [ $count -ne 0 ]; then
@@ -9,7 +9,11 @@ do_reset() {
fail() { #msg
do_reset
echo $1
exit -1
exit $FAIL
}
yield() {
ping localhost -c 1 || sleep .001 || usleep 1 || sleep 1
}
if [ ! -f available_events -o ! -f set_event -o ! -d events ]; then
@@ -21,6 +25,9 @@ reset_tracer
do_reset
echo '*:*' > set_event
yield
count=`cat trace | grep -v ^# | wc -l`
if [ $count -eq 0 ]; then
fail "none of events are recorded"
@@ -29,6 +36,9 @@ fi
do_reset
echo 1 > events/enable
yield
count=`cat trace | grep -v ^# | wc -l`
if [ $count -eq 0 ]; then
fail "none of events are recorded"
@@ -37,6 +47,9 @@ fi
do_reset
echo 0 > events/enable
yield
count=`cat trace | grep -v ^# | wc -l`
if [ $count -ne 0 ]; then
fail "any of events should not be recorded"
@@ -16,7 +16,9 @@ fi
do_reset() {
reset_tracer
echo 0 > /proc/sys/kernel/stack_tracer_enabled
if [ -e /proc/sys/kernel/stack_tracer_enabled ]; then
echo 0 > /proc/sys/kernel/stack_tracer_enabled
fi
enable_tracing
clear_trace
echo > set_ftrace_filter
@@ -25,7 +27,7 @@ do_reset() {
fail() { # msg
do_reset
echo $1
exit -1
exit $FAIL
}
disable_tracing
@@ -17,7 +17,7 @@ do_reset() {
fail() { # msg
do_reset
echo $1
exit -1
exit $FAIL
}
disable_tracing
@@ -31,7 +31,7 @@ fail() { # mesg
reset_tracer
echo > set_ftrace_filter
echo $1
exit -1
exit $FAIL
}
echo "Testing function tracer with profiler:"
+55
View File
@@ -0,0 +1,55 @@
#!/bin/bash
#
# gen_kselftest_tar
# Generate kselftest tarball
# Author: Shuah Khan <shuahkh@osg.samsung.com>
# Copyright (C) 2015 Samsung Electronics Co., Ltd.
# This software may be freely redistributed under the terms of the GNU
# General Public License (GPLv2).
# main
main()
{
if [ "$#" -eq 0 ]; then
echo "$0: Generating default compression gzip"
copts="cvzf"
ext=".tar.gz"
else
case "$1" in
tar)
copts="cvf"
ext=".tar"
;;
targz)
copts="cvzf"
ext=".tar.gz"
;;
tarbz2)
copts="cvjf"
ext=".tar.bz2"
;;
tarxz)
copts="cvJf"
ext=".tar.xz"
;;
*)
echo "Unknown tarball format $1"
exit 1
;;
esac
fi
install_dir=./kselftest
# Run install using INSTALL_KSFT_PATH override to generate install
# directory
./kselftest_install.sh
tar $copts kselftest${ext} $install_dir
echo "Kselftest archive kselftest${ext} created!"
# clean up install directory
rm -rf kselftest
}
main "$@"
+4 -7
View File
@@ -12,14 +12,11 @@ endif
CFLAGS += -I../../../../usr/include/
all:
ifeq ($(ARCH),x86)
gcc $(CFLAGS) msgque.c -o msgque_test
else
echo "Not an x86 target, can't build msgque selftest"
endif
$(CC) $(CFLAGS) msgque.c -o msgque_test
run_tests: all
./msgque_test
TEST_PROGS := msgque_test
include ../lib.mk
clean:
rm -fr ./msgque_test

Some files were not shown because too many files have changed in this diff Show More