Skip to contentSkip to conversation

selftests fixes

PATCH In review Tommi Rantala 5 participants 39 messages Oct 8, 2020 – Nov 5, 2020

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover selftests fixes

Hi, small fixes to issues I hit with selftests.

Tommi Rantala (13):
selftests: filter kselftest headers from command in lib.mk
selftests: pidfd: fix compilation errors due to wait.h
selftests: add vmaccess to .gitignore selftests/harness: prettify SKIP message whitespace again
selftests: pidfd: use ksft_test_result_skip() when skipping test
selftests: pidfd: skip test on kcmp() ENOSYS
selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config
selftests: pidfd: drop needless linux/kcmp.h inclusion in
pidfd_setns_test.c
selftests: android: fix multiple definition of sock_name
selftests: proc: fix warning: _GNU_SOURCE redefined
selftests: core: use SKIP instead of XFAIL in close_range_test.c
selftests: clone3: use SKIP instead of XFAIL
selftests: binderfs: use SKIP instead of XFAIL

 tools/testing/selftests/android/ion/ipcsocket.c           | 1 +
 tools/testing/selftests/android/ion/ipcsocket.h           | 2 --
 .../selftests/clone3/clone3_cap_checkpoint_restore.c      | 2 +-
 tools/testing/selftests/core/close_range_test.c           | 8 ++++----
 .../selftests/filesystems/binderfs/binderfs_test.c        | 8 ++++----
 tools/testing/selftests/kselftest_harness.h               | 2 +-
 tools/testing/selftests/lib.mk                            | 2 +-
 tools/testing/selftests/pidfd/config                      | 1 +
 tools/testing/selftests/pidfd/pidfd_getfd_test.c          | 5 ++++-
 tools/testing/selftests/pidfd/pidfd_open_test.c           | 1 -
 tools/testing/selftests/pidfd/pidfd_poll_test.c           | 1 -
 tools/testing/selftests/pidfd/pidfd_setns_test.c          | 1 -
 tools/testing/selftests/pidfd/pidfd_test.c                | 2 +-
 tools/testing/selftests/proc/proc-loadavg-001.c           | 1 -
 tools/testing/selftests/proc/proc-self-syscall.c          | 1 -
 tools/testing/selftests/proc/proc-uptime-002.c            | 1 -
 tools/testing/selftests/ptrace/.gitignore                 | 1 +
 17 files changed, 19 insertions(+), 21 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/13 selftests: filter kselftest headers from command in lib.mk

Commit 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk") added header dependency to the rule, but as the rule uses $^, the headers are added to the compiler command line.

This can cause unexpected precompiled header files being generated when compilation fails:

  $ echo { >> openat2_test.c
  $ make
  gcc -Wall -O2 -g -fsanitize=address -fsanitize=undefined  openat2_test.c
    tools/testing/selftests/kselftest_harness.h tools/testing/selftests/kselftest.h helpers.c
    -o tools/testing/selftests/openat2/openat2_test
  openat2_test.c:313:1: error: expected identifier or ‘(’ before ‘{’ token
    313 | {
        | ^
  make: *** [../lib.mk:140: tools/testing/selftests/openat2/openat2_test] Error 1
  $ file openat2_test*
  openat2_test:   GCC precompiled header (version 014) for C
  openat2_test.c: C source, ASCII text

Fix it by filtering out the headers, so that we'll only pass the actual *.c files in the compiler command line.

Fixes 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk")
---
 tools/testing/selftests/lib.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/lib.mk +1 -1
index 7a17ea815736..66f3317dc365 100644
@@ -137,7 +137,7 @@ endif
 ifeq ($(OVERRIDE_TARGETS),)
 LOCAL_HDRS := $(selfdir)/kselftest_harness.h $(selfdir)/kselftest.h
 $(OUTPUT)/%:%.c $(LOCAL_HDRS)
-	$(LINK.c) $^ $(LDLIBS) -o $@
+	$(LINK.c) $(filter-out $(LOCAL_HDRS),$^) $(LDLIBS) -o $@
 
 $(OUTPUT)/%.o:%.S
 	$(COMPILE.S) $^ -o $@
Signature · 1 line
2.26.2
Acked-by on v1 1/13
#2 lore raw

Re: [PATCH 01/13] selftests: filter kselftest headers from command in lib.mk

Quoted 22 lines · Tommi Rantala

Commit 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk") added header dependency to the rule, but as the rule uses $^, the headers are added to the compiler command line.

This can cause unexpected precompiled header files being generated when compilation fails:

  $ echo { >> openat2_test.c
  $ make
  gcc -Wall -O2 -g -fsanitize=address -fsanitize=undefined  openat2_test.c
    tools/testing/selftests/kselftest_harness.h tools/testing/selftests/kselftest.h helpers.c
    -o tools/testing/selftests/openat2/openat2_test
  openat2_test.c:313:1: error: expected identifier or ‘(’ before ‘{’ token
    313 | {
        | ^
  make: *** [../lib.mk:140: tools/testing/selftests/openat2/openat2_test] Error 1
  $ file openat2_test*
  openat2_test:   GCC precompiled header (version 014) for C
  openat2_test.c: C source, ASCII text
Quoted 5 lines

Fix it by filtering out the headers, so that we'll only pass the actual *.c files in the compiler command line.

Fixes 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk")

Ah yes, thanks!

Signature · 1 line
Kees Cook
Reviewed-by on v1 1/13
#3 lore raw

Re: [PATCH 01/13] selftests: filter kselftest headers from command in lib.mk

In reply to Tommi Rantala
Quoted 22 lines · Tommi Rantala

Commit 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk") added header dependency to the rule, but as the rule uses $^, the headers are added to the compiler command line.

This can cause unexpected precompiled header files being generated when compilation fails:

  $ echo { >> openat2_test.c
  $ make
  gcc -Wall -O2 -g -fsanitize=address -fsanitize=undefined  openat2_test.c
    tools/testing/selftests/kselftest_harness.h tools/testing/selftests/kselftest.h helpers.c
    -o tools/testing/selftests/openat2/openat2_test
  openat2_test.c:313:1: error: expected identifier or ‘(’ before ‘{’ token
    313 | {
        | ^
  make: *** [../lib.mk:140: tools/testing/selftests/openat2/openat2_test] Error 1
  $ file openat2_test*
  openat2_test:   GCC precompiled header (version 014) for C
  openat2_test.c: C source, ASCII text
Quoted 6 lines

Fix it by filtering out the headers, so that we'll only pass the actual *.c files in the compiler command line.

Fixes 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk")

---

Thanks!

#4 lore raw

PATCH 2/13 selftests: pidfd: fix compilation errors due to wait.h

In reply to Tommi Rantala

Drop unneeded <linux/wait.h> header inclusion to fix pidfd compilation errors seen in Fedora 32:

In file included from pidfd_open_test.c:9:
../../../../usr/include/linux/wait.h:17:16: error: expected identifier before numeric constant

   17 | #define P_ALL  0
      |                ^
---
 tools/testing/selftests/pidfd/pidfd_open_test.c | 1 -
 tools/testing/selftests/pidfd/pidfd_poll_test.c | 1 -
 2 files changed, 2 deletions(-)
tools/testing/selftests/pidfd/pidfd_open_test.c +0 -1
index b9fe75fc3e51..8a59438ccc78 100644
@@ -6,7 +6,6 @@
 #include <inttypes.h>
 #include <limits.h>
 #include <linux/types.h>
-#include <linux/wait.h>
 #include <sched.h>
 #include <signal.h>
 #include <stdbool.h>
tools/testing/selftests/pidfd/pidfd_poll_test.c +0 -1
index 4b115444dfe9..610811275357 100644
@@ -3,7 +3,6 @@
 #define _GNU_SOURCE
 #include <errno.h>
 #include <linux/types.h>
-#include <linux/wait.h>
 #include <poll.h>
 #include <signal.h>
 #include <stdbool.h>
Signature · 1 line
2.26.2
Reviewed-by on v1 2/13
#5 lore raw

Re: [PATCH 02/13] selftests: pidfd: fix compilation errors due to wait.h

Quoted 9 lines · Tommi Rantala

Drop unneeded <linux/wait.h> header inclusion to fix pidfd compilation errors seen in Fedora 32:

In file included from pidfd_open_test.c:9:
../../../../usr/include/linux/wait.h:17:16: error: expected identifier before numeric constant

   17 | #define P_ALL  0
      |                ^
Signature · 1 line
Kees Cook
Acked-by on v1 2/13
#6 lore raw

Re: [PATCH 02/13] selftests: pidfd: fix compilation errors due to wait.h

In reply to Tommi Rantala
Quoted 10 lines · Tommi Rantala

Drop unneeded <linux/wait.h> header inclusion to fix pidfd compilation errors seen in Fedora 32:

In file included from pidfd_open_test.c:9:
../../../../usr/include/linux/wait.h:17:16: error: expected identifier before numeric constant

   17 | #define P_ALL  0
      |                ^

---

Thanks!

#7 lore raw

PATCH 3/13 selftests: add vmaccess to .gitignore

In reply to Tommi Rantala

Commit 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks") added vmaccess testcase, add the binary to .gitignore

Fixes 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks")
---
 tools/testing/selftests/ptrace/.gitignore | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/ptrace/.gitignore +1 -0
index 7bebf9534a86..792318aaa30c 100644
@@ -1,3 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
 get_syscall_info
 peeksiginfo
+vmaccess
Signature · 1 line
2.26.2
Reviewed-by on v1 3/13
#8 lore raw

Re: [PATCH 03/13] selftests: add vmaccess to .gitignore

Quoted 5 lines · Tommi Rantala

Commit 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks") added vmaccess testcase, add the binary to .gitignore

Fixes 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks")
Signature · 1 line
Kees Cook
#10 lore raw

PATCH 4/13 selftests/harness: prettify SKIP message whitespace again

In reply to Tommi Rantala

Commit 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP") replaced XFAIL with SKIP in the output. Add one more space to make the output aligned and pretty again.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
---
 tools/testing/selftests/kselftest_harness.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kselftest_harness.h +1 -1
index 4f78e4805633..d8f44f4bdb3f 100644
@@ -126,7 +126,7 @@
 	snprintf(_metadata->results->reason, \
 		 sizeof(_metadata->results->reason), fmt, ##__VA_ARGS__); \
 	if (TH_LOG_ENABLED) { \
-		fprintf(TH_LOG_STREAM, "#      SKIP     %s\n", \
+		fprintf(TH_LOG_STREAM, "#      SKIP      %s\n", \
 			_metadata->results->reason); \
 	} \
 	_metadata->passed = 1; \
Signature · 1 line
2.26.2
Acked-by on v1 4/13
#11 lore raw

Re: [PATCH 04/13] selftests/harness: prettify SKIP message whitespace again

Quoted 6 lines · Tommi Rantala

Commit 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP") replaced XFAIL with SKIP in the output. Add one more space to make the output aligned and pretty again.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")

Nice catch!

Signature · 1 line
Kees Cook
Reviewed-by on v1 4/13
#12 lore raw

Re: [PATCH 04/13] selftests/harness: prettify SKIP message whitespace again

In reply to Tommi Rantala
Quoted 7 lines · Tommi Rantala

Commit 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP") replaced XFAIL with SKIP in the output. Add one more space to make the output aligned and pretty again.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")

---

Thanks!

#13 lore raw

PATCH 5/13 selftests: pidfd: use ksft_test_result_skip() when skipping test

In reply to Tommi Rantala

There's planned tests != run tests in pidfd_test when some test is skipped:

  $ ./pidfd_test
  TAP version 13
  1..8
  [...]
  # pidfd_send_signal signal recycled pid test: Skipping test
  # Planned tests != run tests (8 != 7)
  # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0

Fix by using ksft_test_result_skip():

  $ ./pidfd_test
  TAP version 13
  1..8
  [...]
  ok 8 # SKIP pidfd_send_signal signal recycled pid test: Unsharing pid namespace not permitted
  # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0
---
 tools/testing/selftests/pidfd/pidfd_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/pidfd/pidfd_test.c +1 -1
index c585aaa2acd8..529eb700ac26 100644
@@ -330,7 +330,7 @@ static int test_pidfd_send_signal_recycled_pid_fail(void)
 		ksft_exit_fail_msg("%s test: Failed to recycle pid %d\n",
 				   test_name, PID_RECYCLE);
 	case PIDFD_SKIP:
-		ksft_print_msg("%s test: Skipping test\n", test_name);
+		ksft_test_result_skip("%s test: Skipping test\n", test_name);
 		ret = 0;
 		break;
 	case PIDFD_XFAIL:
Signature · 1 line
2.26.2
Acked-by on v1 5/13
#14 lore raw

Re: [PATCH 05/13] selftests: pidfd: use ksft_test_result_skip() when skipping test

Quoted 20 lines · Tommi Rantala

There's planned tests != run tests in pidfd_test when some test is skipped:

  $ ./pidfd_test
  TAP version 13
  1..8
  [...]
  # pidfd_send_signal signal recycled pid test: Skipping test
  # Planned tests != run tests (8 != 7)
  # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0

Fix by using ksft_test_result_skip():

  $ ./pidfd_test
  TAP version 13
  1..8
  [...]
  ok 8 # SKIP pidfd_send_signal signal recycled pid test: Unsharing pid namespace not permitted
  # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0
Quoted 2 lines

---

Thanks, I never got around to fixing this myself.

#15 lore raw

PATCH 6/13 selftests: pidfd: skip test on kcmp() ENOSYS

In reply to Tommi Rantala

Skip test if kcmp() is not available, for example if kernel is compiled without CONFIG_CHECKPOINT_RESTORE=y.

---
 tools/testing/selftests/pidfd/pidfd_getfd_test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/pidfd/pidfd_getfd_test.c +4 -1
index 7758c98be015..0930e2411dfb 100644
@@ -204,7 +204,10 @@ TEST_F(child, fetch_fd)
 	fd = sys_pidfd_getfd(self->pidfd, self->remote_fd, 0);
 	ASSERT_GE(fd, 0);
 
-	EXPECT_EQ(0, sys_kcmp(getpid(), self->pid, KCMP_FILE, fd, self->remote_fd));
+	ret = sys_kcmp(getpid(), self->pid, KCMP_FILE, fd, self->remote_fd);
+	if (ret < 0 && errno == ENOSYS)
+		SKIP(return, "kcmp() syscall not supported");
+	EXPECT_EQ(ret, 0);
 
 	ret = fcntl(fd, F_GETFD);
 	ASSERT_GE(ret, 0);
Signature · 1 line
2.26.2
#17 lore raw

PATCH 7/13 selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config

In reply to Tommi Rantala

kcmp syscall is used in pidfd_getfd_test.c, so add CONFIG_CHECKPOINT_RESTORE=y to config to ensure kcmp is available.

---
 tools/testing/selftests/pidfd/config | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/pidfd/config +1 -0
index bb11de90c0c9..f6f2965e17af 100644
@@ -4,3 +4,4 @@ CONFIG_USER_NS=y
 CONFIG_PID_NS=y
 CONFIG_NET_NS=y
 CONFIG_CGROUPS=y
+CONFIG_CHECKPOINT_RESTORE=y
Signature · 1 line
2.26.2
#19 lore raw

PATCH 8/13 selftests: pidfd: drop needless linux/kcmp.h inclusion in pidfd_setns_test.c

In reply to Tommi Rantala

kcmp is not used in pidfd_setns_test.c, so do not include <linux/kcmp.h>

---
 tools/testing/selftests/pidfd/pidfd_setns_test.c | 1 -
 1 file changed, 1 deletion(-)
tools/testing/selftests/pidfd/pidfd_setns_test.c +0 -1
index 7dca1aa4672d..3f3dc7a02a01 100644
@@ -16,7 +16,6 @@
 #include <unistd.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
-#include <linux/kcmp.h>
 
 #include "pidfd.h"
 #include "../clone3/clone3_selftests.h"
Signature · 1 line
2.26.2
#21 lore raw

PATCH 9/13 selftests: android: fix multiple definition of sock_name

In reply to Tommi Rantala

Fix multiple definition of sock_name compilation error:

tools/testing/selftests/android/ion/ipcsocket.h:8: multiple definition of `sock_name'

---
 tools/testing/selftests/android/ion/ipcsocket.c | 1 +
 tools/testing/selftests/android/ion/ipcsocket.h | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/android/ion/ipcsocket.c +1 -0
index 7dc521002095..67ec69410d2e 100644
@@ -10,6 +10,7 @@
 
 #include "ipcsocket.h"
 
+static char sock_name[MAX_SOCK_NAME_LEN];
 
 int opensocket(int *sockfd, const char *name, int connecttype)
 {
tools/testing/selftests/android/ion/ipcsocket.h +0 -2
index b3e84498a8a1..ec5efb23e7b0 100644
@@ -5,8 +5,6 @@
 
 #define MAX_SOCK_NAME_LEN	64
 
-char sock_name[MAX_SOCK_NAME_LEN];
-
 /* This structure is responsible for holding the IPC data
  * data: hold the buffer fd
  * len: just the length of 32-bit integer fd
Signature · 1 line
2.26.2
Acked-by on v1 9/13
#22 lore raw

Re: [PATCH 09/13] selftests: android: fix multiple definition of sock_name

Quoted 6 lines · Tommi Rantala

Fix multiple definition of sock_name compilation error:

tools/testing/selftests/android/ion/ipcsocket.h:8: multiple definition of `sock_name'

---

Ion will be removed from the kernel soon but this seems like an ok bugfix.
Thanks!

maintainer
#23 lore raw

Re: [PATCH 09/13] selftests: android: fix multiple definition of sock_name

Quoted 5 lines · Christian Brauner
Quoted 4 lines · Tommi Rantala

Fix multiple definition of sock_name compilation error:

tools/testing/selftests/android/ion/ipcsocket.h:8: multiple definition of `sock_name'

Quoted 8 lines
Quoted 2 lines

---

Ion will be removed from the kernel soon but this seems like an ok bugfix.
Thanks!

ion is already gone. I am dropping this from linux-kselftest fixes now. This is also causing conflict with ion removal commit

thanks,
-- Shuah

#24 lore raw

PATCH 10/13 selftests: proc: fix warning: _GNU_SOURCE redefined

In reply to Tommi Rantala

Makefile already contains -D_GNU_SOURCE, so we can remove it from the *.c files.

---
 tools/testing/selftests/proc/proc-loadavg-001.c  | 1 -
 tools/testing/selftests/proc/proc-self-syscall.c | 1 -
 tools/testing/selftests/proc/proc-uptime-002.c   | 1 -
 3 files changed, 3 deletions(-)
tools/testing/selftests/proc/proc-loadavg-001.c +0 -1
index 471e2aa28077..fb4fe9188806 100644
@@ -14,7 +14,6 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 /* Test that /proc/loadavg correctly reports last pid in pid namespace. */
-#define _GNU_SOURCE
 #include <errno.h>
 #include <sched.h>
 #include <sys/types.h>
tools/testing/selftests/proc/proc-self-syscall.c +0 -1
index 9f6d000c0245..8511dcfe67c7 100644
@@ -13,7 +13,6 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
-#define _GNU_SOURCE
 #include <unistd.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
tools/testing/selftests/proc/proc-uptime-002.c +0 -1
index 30e2b7849089..e7ceabed7f51 100644
@@ -15,7 +15,6 @@
  */
 // Test that values in /proc/uptime increment monotonically
 // while shifting across CPUs.
-#define _GNU_SOURCE
 #undef NDEBUG
 #include <assert.h>
 #include <unistd.h>
Signature · 1 line
2.26.2
#25 lore raw

PATCH 11/13 selftests: core: use SKIP instead of XFAIL in close_range_test.c

In reply to Tommi Rantala

XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP"), use SKIP instead.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
---
 tools/testing/selftests/core/close_range_test.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/core/close_range_test.c +4 -4
index c99b98b0d461..575b391ddc78 100644
@@ -44,7 +44,7 @@ TEST(close_range)
 		fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
 		ASSERT_GE(fd, 0) {
 			if (errno == ENOENT)
-				XFAIL(return, "Skipping test since /dev/null does not exist");
+				SKIP(return, "Skipping test since /dev/null does not exist");
 		}
 
 		open_fds[i] = fd;
@@ -52,7 +52,7 @@ TEST(close_range)
 
 	EXPECT_EQ(-1, sys_close_range(open_fds[0], open_fds[100], -1)) {
 		if (errno == ENOSYS)
-			XFAIL(return, "close_range() syscall not supported");
+			SKIP(return, "close_range() syscall not supported");
 	}
 
 	EXPECT_EQ(0, sys_close_range(open_fds[0], open_fds[50], 0));
@@ -108,7 +108,7 @@ TEST(close_range_unshare)
 		fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
 		ASSERT_GE(fd, 0) {
 			if (errno == ENOENT)
-				XFAIL(return, "Skipping test since /dev/null does not exist");
+				SKIP(return, "Skipping test since /dev/null does not exist");
 		}
 
 		open_fds[i] = fd;
@@ -197,7 +197,7 @@ TEST(close_range_unshare_capped)
 		fd = open("/dev/null", O_RDONLY | O_CLOEXEC);
 		ASSERT_GE(fd, 0) {
 			if (errno == ENOENT)
-				XFAIL(return, "Skipping test since /dev/null does not exist");
+				SKIP(return, "Skipping test since /dev/null does not exist");
 		}
 
 		open_fds[i] = fd;
Signature · 1 line
2.26.2
Reviewed-by on v1 11/13
#26 lore raw

Re: [PATCH 11/13] selftests: core: use SKIP instead of XFAIL in close_range_test.c

Quoted 5 lines · Tommi Rantala

XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP"), use SKIP instead.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
Signature · 1 line
Kees Cook
#28 lore raw

PATCH 12/13 selftests: clone3: use SKIP instead of XFAIL

In reply to Tommi Rantala

XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP"), use SKIP instead.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
---
 tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/clone3/clone3_cap_checkpoint_restore.c +1 -1
index 9562425aa0a9..614091de4c54 100644
@@ -145,7 +145,7 @@ TEST(clone3_cap_checkpoint_restore)
 	test_clone3_supported();
 
 	EXPECT_EQ(getuid(), 0)
-		XFAIL(return, "Skipping all tests as non-root\n");
+		SKIP(return, "Skipping all tests as non-root");
 
 	memset(&set_tid, 0, sizeof(set_tid));
 
Signature · 1 line
2.26.2
Reviewed-by on v1 12/13
#29 lore raw

Re: [PATCH 12/13] selftests: clone3: use SKIP instead of XFAIL

Quoted 5 lines · Tommi Rantala

XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP"), use SKIP instead.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
Signature · 1 line
Kees Cook
#31 lore raw

PATCH 13/13 selftests: binderfs: use SKIP instead of XFAIL

In reply to Tommi Rantala

XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP"), use SKIP instead.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
---
 .../selftests/filesystems/binderfs/binderfs_test.c        | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/testing/selftests/filesystems/binderfs/binderfs_test.c +4 -4
index 1d27f52c61e6..477cbb042f5b 100644
@@ -74,7 +74,7 @@ static int __do_binderfs_test(struct __test_metadata *_metadata)
 	ret = mount(NULL, binderfs_mntpt, "binder", 0, 0);
 	EXPECT_EQ(ret, 0) {
 		if (errno == ENODEV)
-			XFAIL(goto out, "binderfs missing");
+			SKIP(goto out, "binderfs missing");
 		TH_LOG("%s - Failed to mount binderfs", strerror(errno));
 		goto rmdir;
 	}
@@ -475,10 +475,10 @@ TEST(binderfs_stress)
 TEST(binderfs_test_privileged)
 {
 	if (geteuid() != 0)
-		XFAIL(return, "Tests are not run as root. Skipping privileged tests");
+		SKIP(return, "Tests are not run as root. Skipping privileged tests");
 
 	if (__do_binderfs_test(_metadata))
-		XFAIL(return, "The Android binderfs filesystem is not available");
+		SKIP(return, "The Android binderfs filesystem is not available");
 }
 
 TEST(binderfs_test_unprivileged)
@@ -511,7 +511,7 @@ TEST(binderfs_test_unprivileged)
 	ret = wait_for_pid(pid);
 	if (ret) {
 		if (ret == 2)
-			XFAIL(return, "The Android binderfs filesystem is not available");
+			SKIP(return, "The Android binderfs filesystem is not available");
 		ASSERT_EQ(ret, 0) {
 			TH_LOG("wait_for_pid() failed");
 		}
Signature · 1 line
2.26.2
Reviewed-by on v1 13/13
#32 lore raw

Re: [PATCH 13/13] selftests: binderfs: use SKIP instead of XFAIL

Quoted 5 lines · Tommi Rantala

XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP"), use SKIP instead.

Fixes 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP")
Signature · 1 line
Kees Cook
#34 lore raw
In reply to Tommi Rantala
Quoted 17 lines · Tommi Rantala

Hi, small fixes to issues I hit with selftests.

Tommi Rantala (13):
selftests: filter kselftest headers from command in lib.mk
selftests: pidfd: fix compilation errors due to wait.h
selftests: add vmaccess to .gitignore selftests/harness: prettify SKIP message whitespace again
selftests: pidfd: use ksft_test_result_skip() when skipping test
selftests: pidfd: skip test on kcmp() ENOSYS
selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config
selftests: pidfd: drop needless linux/kcmp.h inclusion in
pidfd_setns_test.c
selftests: android: fix multiple definition of sock_name
selftests: proc: fix warning: _GNU_SOURCE redefined
selftests: core: use SKIP instead of XFAIL in close_range_test.c
selftests: clone3: use SKIP instead of XFAIL
selftests: binderfs: use SKIP instead of XFAIL

This mostly deals with stuff I maintain but it can go via the selftest tree, thanks!

Christian

maintainer
#35 lore raw
In reply to Tommi Rantala
Quoted 28 lines · Tommi Rantala

Hi, small fixes to issues I hit with selftests.

Tommi Rantala (13):
selftests: filter kselftest headers from command in lib.mk
selftests: pidfd: fix compilation errors due to wait.h
selftests: add vmaccess to .gitignore selftests/harness: prettify SKIP message whitespace again
selftests: pidfd: use ksft_test_result_skip() when skipping test
selftests: pidfd: skip test on kcmp() ENOSYS
selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config
selftests: pidfd: drop needless linux/kcmp.h inclusion in
pidfd_setns_test.c
selftests: android: fix multiple definition of sock_name
selftests: proc: fix warning: _GNU_SOURCE redefined
selftests: core: use SKIP instead of XFAIL in close_range_test.c
selftests: clone3: use SKIP instead of XFAIL
selftests: binderfs: use SKIP instead of XFAIL

  tools/testing/selftests/android/ion/ipcsocket.c           | 1 +
  tools/testing/selftests/android/ion/ipcsocket.h           | 2 --
  .../selftests/clone3/clone3_cap_checkpoint_restore.c      | 2 +-
  tools/testing/selftests/core/close_range_test.c           | 8 ++++----
  .../selftests/filesystems/binderfs/binderfs_test.c        | 8 ++++----
  tools/testing/selftests/kselftest_harness.h               | 2 +-
  tools/testing/selftests/lib.mk                            | 2 +-
  tools/testing/selftests/pidfd/config                      | 1 +
  tools/testing/selftests/pidfd/pidfd_getfd_test.c          | 5 ++++-
  tools/testing/selftests/pidfd/pidfd_open_test.c           | 1 -
Quoted 9 lines
  tools/testing/selftests/pidfd/pidfd_poll_test.c           | 1 -
  tools/testing/selftests/pidfd/pidfd_setns_test.c          | 1 -
  tools/testing/selftests/pidfd/pidfd_test.c                | 2 +-
  tools/testing/selftests/proc/proc-loadavg-001.c           | 1 -
  tools/testing/selftests/proc/proc-self-syscall.c          | 1 -
  tools/testing/selftests/proc/proc-uptime-002.c            | 1 -
  tools/testing/selftests/ptrace/.gitignore                 | 1 +
  17 files changed, 19 insertions(+), 21 deletions(-)

Thanks for fixing these.

Applied all except 03/13 which is already fixed.

thanks,
-- Shuah

#36 lore raw
In reply to Tommi Rantala
Quoted 17 lines · Tommi Rantala

Hi, small fixes to issues I hit with selftests.

Tommi Rantala (13):
selftests: filter kselftest headers from command in lib.mk
selftests: pidfd: fix compilation errors due to wait.h
selftests: add vmaccess to .gitignore selftests/harness: prettify SKIP message whitespace again
selftests: pidfd: use ksft_test_result_skip() when skipping test
selftests: pidfd: skip test on kcmp() ENOSYS
selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config
selftests: pidfd: drop needless linux/kcmp.h inclusion in
pidfd_setns_test.c
selftests: android: fix multiple definition of sock_name
selftests: proc: fix warning: _GNU_SOURCE redefined
selftests: core: use SKIP instead of XFAIL in close_range_test.c
selftests: clone3: use SKIP instead of XFAIL
selftests: binderfs: use SKIP instead of XFAIL

This series doesn't seem to have been picked up?

cheers

maintainer
#37 lore raw
Quoted 19 lines · Michael Ellerman
Quoted 17 lines · Tommi Rantala

Hi, small fixes to issues I hit with selftests.

Tommi Rantala (13):
selftests: filter kselftest headers from command in lib.mk
selftests: pidfd: fix compilation errors due to wait.h
selftests: add vmaccess to .gitignore selftests/harness: prettify SKIP message whitespace again
selftests: pidfd: use ksft_test_result_skip() when skipping test
selftests: pidfd: skip test on kcmp() ENOSYS
selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config
selftests: pidfd: drop needless linux/kcmp.h inclusion in
pidfd_setns_test.c
selftests: android: fix multiple definition of sock_name
selftests: proc: fix warning: _GNU_SOURCE redefined
selftests: core: use SKIP instead of XFAIL in close_range_test.c
selftests: clone3: use SKIP instead of XFAIL
selftests: binderfs: use SKIP instead of XFAIL

Quoted 4 lines

This series doesn't seem to have been picked up?

cheers

I applied them to linux-kselftest fixes yesterday.

thanks,
-- Shuah

#38 lore raw
Quoted 20 lines · Shuah Khan
Quoted 19 lines · Michael Ellerman
Quoted 17 lines · Tommi Rantala

Hi, small fixes to issues I hit with selftests.

Tommi Rantala (13):
selftests: filter kselftest headers from command in lib.mk
selftests: pidfd: fix compilation errors due to wait.h
selftests: add vmaccess to .gitignore selftests/harness: prettify SKIP message whitespace again
selftests: pidfd: use ksft_test_result_skip() when skipping test
selftests: pidfd: skip test on kcmp() ENOSYS
selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config
selftests: pidfd: drop needless linux/kcmp.h inclusion in
pidfd_setns_test.c
selftests: android: fix multiple definition of sock_name
selftests: proc: fix warning: _GNU_SOURCE redefined
selftests: core: use SKIP instead of XFAIL in close_range_test.c
selftests: clone3: use SKIP instead of XFAIL
selftests: binderfs: use SKIP instead of XFAIL

Quoted 4 lines
Quoted 2 lines

This series doesn't seem to have been picked up?

I applied them to linux-kselftest fixes yesterday.

Thanks.

cheers