Commit b5ec9fe5 authored by Tommi Rantala's avatar Tommi Rantala Committed by Shuah Khan
Browse files

selftests: pidfd: skip test on kcmp() ENOSYS



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

Signed-off-by: default avatarTommi Rantala <tommi.t.rantala@nokia.com>
Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 0b18fed9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);