Skip to content

Commit ca95bf6

Browse files
committed
Merge tag 'linux-kselftest-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull Kselftest update from Shuah Khan: - Work to restructure timers test suite to move PIE out of rtctest from Alexandre Belloni. - Several minor spelling and bug fixes. - New cgroup tests from Roman Gushchin and Mike Rapoport. - Kselftest framework changes to handle and report skipped tests correctly. Prior to these changes, framework treated all non-zero return codes from tests as failures. When tests are skipped with non-zero return code, due to unmet dependencies and/or unsupported configuration, reporting them as failed lead to false negatives on the tests that couldn't be run. - Fixes to test Makefiles to remove unnecessary RUN_TESTS and EMIT_TESTS overrides and use common defines from lib.mk. - Fixes to several tests to return correct Kselftest skip code. - Changes to improve test output. * tag 'linux-kselftest-4.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (55 commits) selftests: lib: fix prime_numbers module search and skip logic selftests: intel_pstate: notification about privilege required to run intel_pstate testing script selftests: cgroup/memcontrol: add basic test for socket accounting selftest: intel_pstate: debug support message from aperf.c and return value kselftest/cgroup: fix variable dereferenced before check warning selftests/intel_pstate: Enhance table printing selftests/intel_pstate: Improve test, minor fixes selftests: cgroup/memcontrol: add basic test for swap controls selftests: cgroup: add memory controller self-tests selftests: memfd: split regular and hugetlbfs tests selftests: net: return Kselftest Skip code for skipped tests selftests: mqueue: return Kselftest Skip code for skipped tests selftests: memory-hotplug: return Kselftest Skip code for skipped tests selftests: memfd: return Kselftest Skip code for skipped tests selftests: membarrier: return Kselftest Skip code for skipped tests selftests: media_tests: return Kselftest Skip code for skipped tests selftests: locking: return Kselftest Skip code for skipped tests selftests: locking: add Makefile for locking test selftests: lib: return Kselftest Skip code for skipped tests selftests: lib: add prime_numbers.sh test to Makefile ...
2 parents 0ad39cb + fa32156 commit ca95bf6

63 files changed

Lines changed: 2113 additions & 615 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎MAINTAINERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11935,7 +11935,7 @@ F: include/linux/rtc.h
1193511935
F: include/uapi/linux/rtc.h
1193611936
F: include/linux/rtc/
1193711937
F: include/linux/platform_data/rtc-*
11938-
F: tools/testing/selftests/timers/rtctest.c
11938+
F: tools/testing/selftests/rtc/
1193911939

1194011940
REALTEK AUDIO CODECS
1194111941
M: Bard Liao <bardliao@realtek.com>

‎tools/testing/selftests/Makefile‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ TARGETS = android
33
TARGETS += bpf
44
TARGETS += breakpoints
55
TARGETS += capabilities
6+
TARGETS += cgroup
67
TARGETS += cpufreq
78
TARGETS += cpu-hotplug
89
TARGETS += efivarfs
@@ -28,6 +29,7 @@ TARGETS += powerpc
2829
TARGETS += proc
2930
TARGETS += pstore
3031
TARGETS += ptrace
32+
TARGETS += rtc
3133
TARGETS += seccomp
3234
TARGETS += sigaltstack
3335
TARGETS += size
@@ -134,7 +136,8 @@ ifdef INSTALL_PATH
134136
echo "else" >> $(ALL_SCRIPT)
135137
echo " OUTPUT=/dev/stdout" >> $(ALL_SCRIPT)
136138
echo "fi" >> $(ALL_SCRIPT)
137-
echo "export KSFT_TAP_LEVEL=`echo 1`" >> $(ALL_SCRIPT)
139+
echo "export KSFT_TAP_LEVEL=1" >> $(ALL_SCRIPT)
140+
echo "export skip=4" >> $(ALL_SCRIPT)
138141

139142
for TARGET in $(TARGETS); do \
140143
BUILD_TARGET=$$BUILD/$$TARGET; \

‎tools/testing/selftests/android/Makefile‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ all:
1818
fi \
1919
done
2020

21-
override define RUN_TESTS
22-
@cd $(OUTPUT); ./run.sh
23-
endef
24-
2521
override define INSTALL_RULE
2622
mkdir -p $(INSTALL_PATH)
2723
install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
@@ -33,10 +29,6 @@ override define INSTALL_RULE
3329
done;
3430
endef
3531

36-
override define EMIT_TESTS
37-
echo "./run.sh"
38-
endef
39-
4032
override define CLEAN
4133
@for DIR in $(SUBDIRS); do \
4234
BUILD_TARGET=$(OUTPUT)/$$DIR; \

‎tools/testing/selftests/android/ion/ion_test.sh‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ heapsize=4096
44
TCID="ion_test.sh"
55
errcode=0
66

7+
# Kselftest framework requirement - SKIP code is 4.
8+
ksft_skip=4
9+
710
run_test()
811
{
912
heaptype=$1
@@ -25,7 +28,7 @@ check_root()
2528
uid=$(id -u)
2629
if [ $uid -ne 0 ]; then
2730
echo $TCID: must be run as root >&2
28-
exit 0
31+
exit $ksft_skip
2932
fi
3033
}
3134

@@ -35,7 +38,7 @@ check_device()
3538
if [ ! -e $DEVICE ]; then
3639
echo $TCID: No $DEVICE device found >&2
3740
echo $TCID: May be CONFIG_ION is not set >&2
38-
exit 0
41+
exit $ksft_skip
3942
fi
4043
}
4144

‎tools/testing/selftests/breakpoints/step_after_suspend_test.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,14 @@ void suspend(void)
143143
int err;
144144
struct itimerspec spec = {};
145145

146+
if (getuid() != 0)
147+
ksft_exit_skip("Please run the test as root - Exiting.\n");
148+
146149
power_state_fd = open("/sys/power/state", O_RDWR);
147150
if (power_state_fd < 0)
148151
ksft_exit_fail_msg(
149-
"open(\"/sys/power/state\") failed (is this test running as root?)\n");
152+
"open(\"/sys/power/state\") failed %s)\n",
153+
strerror(errno));
150154

151155
timerfd = timerfd_create(CLOCK_BOOTTIME_ALARM, 0);
152156
if (timerfd < 0)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
CFLAGS += -Wall
3+
4+
all:
5+
6+
TEST_GEN_PROGS = test_memcontrol
7+
8+
include ../lib.mk
9+
10+
$(OUTPUT)/test_memcontrol: cgroup_util.c

0 commit comments

Comments
 (0)