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

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
...@@ -204,7 +204,10 @@ TEST_F(child, fetch_fd) ...@@ -204,7 +204,10 @@ TEST_F(child, fetch_fd)
fd = sys_pidfd_getfd(self->pidfd, self->remote_fd, 0); fd = sys_pidfd_getfd(self->pidfd, self->remote_fd, 0);
ASSERT_GE(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); ret = fcntl(fd, F_GETFD);
ASSERT_GE(ret, 0); ASSERT_GE(ret, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment