Skip to content

Commit

Permalink
Merge tag 'linux-kselftest-4.18-rc1' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…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
  ...
  • Loading branch information
Linus Torvalds committed Jun 6, 2018
2 parents 0ad39cb + fa32156 commit ca95bf6
Show file tree
Hide file tree
Showing 63 changed files with 2,113 additions and 615 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -11935,7 +11935,7 @@ F: include/linux/rtc.h
F: include/uapi/linux/rtc.h
F: include/linux/rtc/
F: include/linux/platform_data/rtc-*
F: tools/testing/selftests/timers/rtctest.c
F: tools/testing/selftests/rtc/

REALTEK AUDIO CODECS
M: Bard Liao <bardliao@realtek.com>
Expand Down
5 changes: 4 additions & 1 deletion tools/testing/selftests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TARGETS = android
TARGETS += bpf
TARGETS += breakpoints
TARGETS += capabilities
TARGETS += cgroup
TARGETS += cpufreq
TARGETS += cpu-hotplug
TARGETS += efivarfs
Expand All @@ -28,6 +29,7 @@ TARGETS += powerpc
TARGETS += proc
TARGETS += pstore
TARGETS += ptrace
TARGETS += rtc
TARGETS += seccomp
TARGETS += sigaltstack
TARGETS += size
Expand Down Expand Up @@ -134,7 +136,8 @@ ifdef INSTALL_PATH
echo "else" >> $(ALL_SCRIPT)
echo " OUTPUT=/dev/stdout" >> $(ALL_SCRIPT)
echo "fi" >> $(ALL_SCRIPT)
echo "export KSFT_TAP_LEVEL=`echo 1`" >> $(ALL_SCRIPT)
echo "export KSFT_TAP_LEVEL=1" >> $(ALL_SCRIPT)
echo "export skip=4" >> $(ALL_SCRIPT)

for TARGET in $(TARGETS); do \
BUILD_TARGET=$$BUILD/$$TARGET; \
Expand Down
8 changes: 0 additions & 8 deletions tools/testing/selftests/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ all:
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)
Expand All @@ -33,10 +29,6 @@ override define INSTALL_RULE
done;
endef

override define EMIT_TESTS
echo "./run.sh"
endef

override define CLEAN
@for DIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
Expand Down
7 changes: 5 additions & 2 deletions tools/testing/selftests/android/ion/ion_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ heapsize=4096
TCID="ion_test.sh"
errcode=0

# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4

run_test()
{
heaptype=$1
Expand All @@ -25,7 +28,7 @@ check_root()
uid=$(id -u)
if [ $uid -ne 0 ]; then
echo $TCID: must be run as root >&2
exit 0
exit $ksft_skip
fi
}

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,14 @@ void suspend(void)
int err;
struct itimerspec spec = {};

if (getuid() != 0)
ksft_exit_skip("Please run the test as root - Exiting.\n");

power_state_fd = open("/sys/power/state", O_RDWR);
if (power_state_fd < 0)
ksft_exit_fail_msg(
"open(\"/sys/power/state\") failed (is this test running as root?)\n");
"open(\"/sys/power/state\") failed %s)\n",
strerror(errno));

timerfd = timerfd_create(CLOCK_BOOTTIME_ALARM, 0);
if (timerfd < 0)
Expand Down
10 changes: 10 additions & 0 deletions tools/testing/selftests/cgroup/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-License-Identifier: GPL-2.0
CFLAGS += -Wall

all:

TEST_GEN_PROGS = test_memcontrol

include ../lib.mk

$(OUTPUT)/test_memcontrol: cgroup_util.c
Loading

0 comments on commit ca95bf6

Please sign in to comment.