Hi Sean,
I started to see compile errors on ir test. Could you please take a look
and see if you can fix them.
ir_loopback.c:32:16: error: field ‘proto’ has incomplete type
enum rc_proto proto;
^~~~~
ir_loopback.c:37:4: error: ‘RC_PROTO_RC5’ undeclared here (not in a
function)
{ RC_PROTO_RC5, "rc-5", 0x1f7f, "rc-5" },
^~~~~~~~~~~~
ir_loopback.c:38:4: error: ‘RC_PROTO_RC5X_20’ undeclared here (not in a
function); did you mean ‘RC_PROTO_RC5’?
{ RC_PROTO_RC5X_20, "rc-5x-20", 0x1f7f3f, "rc-5" },
^~~~~~~~~~~~~~~~
RC_PROTO_RC5
ir_loopback.c:39:4: error: ‘RC_PROTO_RC5_SZ’ undeclared here (not in a
function); did you mean ‘RC_PROTO_RC5X_20’?
{ RC_PROTO_RC5_SZ, "rc-5-sz", 0x2fff, "rc-5-sz" },
^~~~~~~~~~~~~~~
RC_PROTO_RC5X_20
ir_loopback.c:40:4: error: ‘RC_PROTO_JVC’ undeclared here (not in a
function); did you mean ‘RC_PROTO_RC5’?
{ RC_PROTO_JVC, "jvc", 0xffff, "jvc" },
^~~~~~~~~~~~
RC_PROTO_RC5
ir_loopback.c:41:4: error: ‘RC_PROTO_SONY12’ undeclared here (not in a
function); did you mean ‘RC_PROTO_JVC’?
{ RC_PROTO_SONY12, "sony-12", 0x1f007f, "sony" },
^~~~~~~~~~~~~~~
RC_PROTO_JVC
ir_loopback.c:42:4: error: ‘RC_PROTO_SONY15’ undeclared here (not in a
function); did you mean ‘RC_PROTO_SONY12’?
{ RC_PROTO_SONY15, "sony-15", 0xff007f, "sony" },
^~~~~~~~~~~~~~~
RC_PROTO_SONY12
ir_loopback.c:43:4: error: ‘RC_PROTO_SONY20’ undeclared here (not in a
function); did you mean ‘RC_PROTO_SONY15’?
{ RC_PROTO_SONY20, "sony-20", 0x1fff7f, "sony" },
^~~~~~~~~~~~~~~
RC_PROTO_SONY15
ir_loopback.c:44:4: error: ‘RC_PROTO_NEC’ undeclared here (not in a
function); did you mean ‘RC_PROTO_JVC’?
{ RC_PROTO_NEC, "nec", 0xffff, "nec" },
^~~~~~~~~~~~
RC_PROTO_JVC
ir_loopback.c:45:4: error: ‘RC_PROTO_NECX’ undeclared here (not in a
function); did you mean ‘RC_PROTO_NEC’?
{ RC_PROTO_NECX, "nec-x", 0xffffff, "nec" },
^~~~~~~~~~~~~
RC_PROTO_NEC
ir_loopback.c:46:4: error: ‘RC_PROTO_NEC32’ undeclared here (not in a
function); did you mean ‘RC_PROTO_NECX’?
{ RC_PROTO_NEC32, "nec-32", 0xffffffff, "nec" },
^~~~~~~~~~~~~~
RC_PROTO_NECX
ir_loopback.c:47:4: error: ‘RC_PROTO_SANYO’ undeclared here (not in a
function); did you mean ‘RC_PROTO_SONY20’?
{ RC_PROTO_SANYO, "sanyo", 0x1fffff, "sanyo" },
^~~~~~~~~~~~~~
RC_PROTO_SONY20
ir_loopback.c:48:4: error: ‘RC_PROTO_RC6_0’ undeclared here (not in a
function); did you mean ‘RC_PROTO_RC5_SZ’?
{ RC_PROTO_RC6_0, "rc-6-0", 0xffff, "rc-6" },
^~~~~~~~~~~~~~
RC_PROTO_RC5_SZ
ir_loopback.c:49:4: error: ‘RC_PROTO_RC6_6A_20’ undeclared here (not in
a function); did you mean ‘RC_PROTO_RC6_0’?
{ RC_PROTO_RC6_6A_20, "rc-6-6a-20", 0xfffff, "rc-6" },
^~~~~~~~~~~~~~~~~~
RC_PROTO_RC6_0
ir_loopback.c:50:4: error: ‘RC_PROTO_RC6_6A_24’ undeclared here (not in
a function); did you mean ‘RC_PROTO_RC6_6A_20’?
{ RC_PROTO_RC6_6A_24, "rc-6-6a-24", 0xffffff, "rc-6" },
^~~~~~~~~~~~~~~~~~
RC_PROTO_RC6_6A_20
ir_loopback.c:51:4: error: ‘RC_PROTO_RC6_6A_32’ undeclared here (not in
a function); did you mean ‘RC_PROTO_RC6_6A_24’?
{ RC_PROTO_RC6_6A_32, "rc-6-6a-32", 0xffffffff, "rc-6" },
^~~~~~~~~~~~~~~~~~
RC_PROTO_RC6_6A_24
ir_loopback.c:52:4: error: ‘RC_PROTO_RC6_MCE’ undeclared here (not in a
function); did you mean ‘RC_PROTO_RC6_0’?
{ RC_PROTO_RC6_MCE, "rc-6-mce", 0x00007fff, "rc-6" },
^~~~~~~~~~~~~~~~
RC_PROTO_RC6_0
ir_loopback.c:53:4: error: ‘RC_PROTO_SHARP’ undeclared here (not in a
function); did you mean ‘RC_PROTO_SANYO’?
{ RC_PROTO_SHARP, "sharp", 0x1fff, "sharp" },
^~~~~~~~~~~~~~
RC_PROTO_SANYO
ir_loopback.c: In function ‘main’:
ir_loopback.c:101:9: error: ‘LIRC_MODE_SCANCODE’ undeclared (first use
in this function); did you mean ‘LIRC_MODE_LIRCCODE’?
mode = LIRC_MODE_SCANCODE;
^~~~~~~~~~~~~~~~~~
LIRC_MODE_LIRCCODE
ir_loopback.c:101:9: note: each undeclared identifier is reported only
once for each function it appears in
thanks,
-- Shuah
If the cgroup destruction races with an exit() of a belonging
process(es), cg_kill_all() may fail. It's not a good reason to make
cg_destroy() fail and leave the cgroup in place, potentially causing
next test runs to fail.
Signed-off-by: Roman Gushchin <guro(a)fb.com>
Cc: Shuah Khan <shuah(a)kernel.org>
Cc: Tejun Heo <tj(a)kernel.org>
Cc: kernel-team(a)fb.com
Cc: linux-kselftest(a)vger.kernel.org
---
tools/testing/selftests/cgroup/cgroup_util.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c
index 14c9fe284806..eba06f94433b 100644
--- a/tools/testing/selftests/cgroup/cgroup_util.c
+++ b/tools/testing/selftests/cgroup/cgroup_util.c
@@ -227,9 +227,7 @@ int cg_destroy(const char *cgroup)
retry:
ret = rmdir(cgroup);
if (ret && errno == EBUSY) {
- ret = cg_killall(cgroup);
- if (ret)
- return ret;
+ cg_killall(cgroup);
usleep(100);
goto retry;
}
--
2.19.2
Shuah,
I was recently investigating some errors coming out of our functional
tests and we, Dan and I, came up with a discussion that might not be new
for you, but, interests us, in defining how to better use kselftests as
a regression mechanism/tool in our LKFT (https://lkft.linaro.org).
David / Willem,
I'm only using udpgso as an example for what I'd like to ask Shuah. Feel
free to jump in in the discussion if you think its worth.
All,
Regarding: udpgso AND https://bugs.linaro.org/show_bug.cgi?id=3980
udpgso tests are failing in kernels bellow 4.18 because of 2 main reasons:
1) udp4_ufo_fragment does not seem to demand the GSO SKB to be > than
the MTU for older kernels (4th test case in udpgso.c).
2) setsockopt(...UDP_SEGMENT) support is not present for older kernels.
(commits "udp: generate gso with UDP_SEGMENT" and its fixes seem to be
needed).
With that explained, finally the question/discussion:
Shouldn't we enforce a versioning mechanism for tests that are testing
recently added features ? I mean, some of the tests inside udpgso
selftest are good enough for older kernels...
But, because we have no control over "kernel features" and "supported
test cases", we, Linaro, have to end up blacklisting all selftests that
have new feature oriented tests, because one or two test cases only.
This has already been solved in other functional tests projects:
allowing to check the running kernel version and deciding which test
cases to run.
Would that be something we should pursue ? (We could try to make patches
here and there, like this case, whenever we face this). Or... should we
stick with mainline/next only when talking about kselftest and forget
about LTS kernels ?
OBS: Situations like this are very time consuming before we can tell if
there was a regression or the older kernel did not support the test case.
Thank you for the attention.
Rafael
--
Rafael D. Tinoco
Linaro - Kernel Validation
From: Shuah Khan <shuah(a)kernel.org>
Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk") added
khdr target to run headers_install target from the main Makefile. The
logic uses KSFT_KHDR_INSTALL and top_srcdir as controls to initialize
variables and include files to run headers_install from the top level
Makefile. There are a few problems with this logic.
1. Exposes top_srcdir to all tests
2. Common logic impacts all tests
3. Uses KSFT_KHDR_INSTALL, top_srcdir, and khdr in an adhoc way. Tests
add "khdr" dependency in their Makefiles to TEST_PROGS_EXTENDED in
some cases, and STATIC_LIBS in other cases. This makes this framework
confusing to use.
The common logic that runs for all tests even when KSFT_KHDR_INSTALL
isn't defined by the test. top_srcdir is initialized to a default value
when test doesn't initialize it. It works for all tests without a sub-dir
structure and tests with sub-dir structure fail to build.
e.g: make -C sparc64/drivers/ or make -C drivers/dma-buf
../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory
make: *** No rule to make target '../../../../scripts/subarch.include'. Stop.
There is no reason to require all tests to define top_srcdir and there is
no need to require tests to add khdr dependency using adhoc changes to
TEST_* and other variables.
Fix it with a consistent use of KSFT_KHDR_INSTALL and top_srcdir from tests
that have the dependency on headers_install.
Change common logic to include khdr target define and "all" target with
dependency on khdr when KSFT_KHDR_INSTALL is defined.
Only tests that have dependency on headers_install have to define just
the KSFT_KHDR_INSTALL, and top_srcdir variables and there is no need to
specify khdr dependency in the test Makefiles.
Fixes: b2d35fa5fc80 ("selftests: add headers_install to lib.mk")
Cc: stable(a)vger.kernel.org
Signed-off-by: Shuah Khan <shuah(a)kernel.org>
---
tools/testing/selftests/android/Makefile | 2 +-
tools/testing/selftests/futex/functional/Makefile | 1 +
tools/testing/selftests/gpio/Makefile | 6 +++---
tools/testing/selftests/kvm/Makefile | 2 +-
tools/testing/selftests/lib.mk | 8 ++++----
tools/testing/selftests/networking/timestamping/Makefile | 1 +
tools/testing/selftests/tc-testing/bpf/Makefile | 1 +
tools/testing/selftests/vm/Makefile | 1 +
8 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/android/Makefile b/tools/testing/selftests/android/Makefile
index d9a725478375..72c25a3cb658 100644
--- a/tools/testing/selftests/android/Makefile
+++ b/tools/testing/selftests/android/Makefile
@@ -6,7 +6,7 @@ TEST_PROGS := run.sh
include ../lib.mk
-all: khdr
+all:
@for DIR in $(SUBDIRS); do \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
mkdir $$BUILD_TARGET -p; \
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index ad1eeb14fda7..30996306cabc 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -19,6 +19,7 @@ TEST_GEN_FILES := \
TEST_PROGS := run.sh
top_srcdir = ../../../../..
+KSFT_KHDR_INSTALL := 1
include ../../lib.mk
$(TEST_GEN_FILES): $(HEADERS)
diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile
index 46648427d537..07f572a1bd3f 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -10,8 +10,6 @@ TEST_PROGS_EXTENDED := gpio-mockup-chardev
GPIODIR := $(realpath ../../../gpio)
GPIOOBJ := gpio-utils.o
-include ../lib.mk
-
all: $(TEST_PROGS_EXTENDED)
override define CLEAN
@@ -19,7 +17,9 @@ override define CLEAN
$(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean
endef
-$(TEST_PROGS_EXTENDED):| khdr
+KSFT_KHDR_INSTALL := 1
+include ../lib.mk
+
$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ)
$(GPIODIR)/$(GPIOOBJ):
diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
index 01a219229238..52bfe5e76907 100644
--- a/tools/testing/selftests/kvm/Makefile
+++ b/tools/testing/selftests/kvm/Makefile
@@ -1,6 +1,7 @@
all:
top_srcdir = ../../../..
+KSFT_KHDR_INSTALL := 1
UNAME_M := $(shell uname -m)
LIBKVM = lib/assert.c lib/elf.c lib/io.c lib/kvm_util.c lib/ucall.c lib/sparsebit.c
@@ -44,7 +45,6 @@ $(OUTPUT)/libkvm.a: $(LIBKVM_OBJ)
all: $(STATIC_LIBS)
$(TEST_GEN_PROGS): $(STATIC_LIBS)
-$(STATIC_LIBS):| khdr
cscope: include_paths = $(LINUX_TOOL_INCLUDE) $(LINUX_HDR_PATH) include lib ..
cscope:
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 0a8e75886224..8b0f16409ed7 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -16,18 +16,18 @@ TEST_GEN_PROGS := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS))
TEST_GEN_PROGS_EXTENDED := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_PROGS_EXTENDED))
TEST_GEN_FILES := $(patsubst %,$(OUTPUT)/%,$(TEST_GEN_FILES))
+ifdef KSFT_KHDR_INSTALL
top_srcdir ?= ../../../..
include $(top_srcdir)/scripts/subarch.include
ARCH ?= $(SUBARCH)
-all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
-
.PHONY: khdr
khdr:
make ARCH=$(ARCH) -C $(top_srcdir) headers_install
-ifdef KSFT_KHDR_INSTALL
-$(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES):| khdr
+all: khdr $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
+else
+all: $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES)
endif
.ONESHELL:
diff --git a/tools/testing/selftests/networking/timestamping/Makefile b/tools/testing/selftests/networking/timestamping/Makefile
index 14cfcf006936..c46c0eefab9e 100644
--- a/tools/testing/selftests/networking/timestamping/Makefile
+++ b/tools/testing/selftests/networking/timestamping/Makefile
@@ -6,6 +6,7 @@ TEST_PROGS := hwtstamp_config rxtimestamp timestamping txtimestamp
all: $(TEST_PROGS)
top_srcdir = ../../../../..
+KSFT_KHDR_INSTALL := 1
include ../../lib.mk
clean:
diff --git a/tools/testing/selftests/tc-testing/bpf/Makefile b/tools/testing/selftests/tc-testing/bpf/Makefile
index dc92eb271d9a..be5a5e542804 100644
--- a/tools/testing/selftests/tc-testing/bpf/Makefile
+++ b/tools/testing/selftests/tc-testing/bpf/Makefile
@@ -4,6 +4,7 @@ APIDIR := ../../../../include/uapi
TEST_GEN_FILES = action.o
top_srcdir = ../../../../..
+KSFT_KHDR_INSTALL := 1
include ../../lib.mk
CLANG ?= clang
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index 6e67e726e5a5..e13eb6cc8901 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -25,6 +25,7 @@ TEST_GEN_FILES += virtual_address_range
TEST_PROGS := run_vmtests
+KSFT_KHDR_INSTALL := 1
include ../lib.mk
$(OUTPUT)/userfaultfd: LDLIBS += -lpthread
--
2.17.1
Hi Linus,
Please pull the following Kselftest update for Linux 4.20-rc7.
This Kselftest update for Linux 4.20-rc7 consists of a single fix for
seccomp test from Kees Cook.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 651022382c7f8da46cb4872a545ee1da6d097d2a:
Linux 4.20-rc1 (2018-11-04 15:37:52 -0800)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-4.20-rc7
for you to fetch changes up to 2bd61abead58c82714a1f6fa6beb0fd0df6a6d13:
selftests/seccomp: Remove SIGSTOP si_pid check (2018-12-11 17:57:30
-0700)
----------------------------------------------------------------
linux-kselftest-4.20-rc7
This Kselftest update for Linux 4.20-rc7 consists of a single fix for
seccomp test from Kees Cook.
----------------------------------------------------------------
Kees Cook (1):
selftests/seccomp: Remove SIGSTOP si_pid check
tools/testing/selftests/seccomp/seccomp_bpf.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------
From: Colin Ian King <colin.king(a)canonical.com>
There is a spelling mistake in the --gettimeleft help text, fix it.
Signed-off-by: Colin Ian King <colin.king(a)canonical.com>
---
tools/testing/selftests/watchdog/watchdog-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
index dac907a932ce..c2333c78cf04 100644
--- a/tools/testing/selftests/watchdog/watchdog-test.c
+++ b/tools/testing/selftests/watchdog/watchdog-test.c
@@ -78,7 +78,7 @@ static void usage(char *progname)
printf(" -T, --gettimeout Get the timeout\n");
printf(" -n, --pretimeout=T Set the pretimeout to T seconds\n");
printf(" -N, --getpretimeout Get the pretimeout\n");
- printf(" -L, --gettimeleft Get the time left until timer experies\n");
+ printf(" -L, --gettimeleft Get the time left until timer expires\n");
printf("\n");
printf("Parameters are parsed left-to-right in real-time.\n");
printf("Example: %s -d -t 10 -p 5 -e\n", progname);
--
2.19.1