selftests/powerpc: Skip test instead of failing
authorBreno Leitao <leitao@debian.org>
Wed, 31 Oct 2018 14:38:22 +0000 (11:38 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Dec 2019 07:51:45 +0000 (08:51 +0100)
commit5aba77393e6f1e5a09a7bdd6ed8442d18484a399
tree7dd395ef75f3f0087c3e8c03ea1094a9b41a767c
parent104d0d63a1268301c35caca9b701d4b9b1af13e8
selftests/powerpc: Skip test instead of failing

[ Upstream commit eafcd8e3fbad4f426a40ed2b6a8c697c3a4ef36a ]

Current core-pkey selftest fails if the test runs without privileges to
write into the core pattern file (/proc/sys/kernel/core_pattern). This
causes the test to fail and give the impression that the subsystem being
tested is broken, when, in fact, the test is being executed without the
proper privileges. This is the current error:

test: core_pkey
tags: git_version:v4.19-3-g9e3363be9bce-dirty
Error writing to core_pattern file: Permission denied
failure: core_pkey

This patch simply skips this test if it runs without the proper privileges,
avoiding this undesired failure.

CC: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
CC: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/powerpc/ptrace/core-pkey.c