From: Vincent Whitchurch Date: Mon, 09 Jun 2025 15:27:00 +0200 Subject: [PATCH bpf-next v2 3/5] selftests/bpf: sockmap: Exit with error on failure MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250609-sockmap-splice-v2-3-9c50645cfa32@datadoghq.com> References: <20250609-sockmap-splice-v2-0-9c50645cfa32@datadoghq.com> In-Reply-To: <20250609-sockmap-splice-v2-0-9c50645cfa32@datadoghq.com> To: John Fastabend , Jakub Sitnicki Cc: Kuniyuki Iwashima , netdev@vger.kernel.org, bpf@vger.kernel.org, Vincent Whitchurch X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1749475632; l=739; i=vincent.whitchurch@datadoghq.com; s=20240606; h=from:subject:message-id; bh=zvCxjLCWikXEcOPolUq/9Ge5sJ6PAHHwLBy0hdL4r6w=; b=eWw43c2PIjFVk8vp02nfNuVjaQhpIZAAx+un2YJaK6v7SrB30ALbKLzdnb+WUrfgV8tfBR04A BdBsyguCu5JAHC5TIt7IbVEaTV1cHUVpcskhe+C+H6i/9Rl5KP4eo+t X-Developer-Key: i=vincent.whitchurch@datadoghq.com; a=ed25519; pk=GwUiPK96WuxbUAD4UjapyK7TOt+aX0EqABOZ/BOj+/M= X-Endpoint-Received: by B4 Relay for vincent.whitchurch@datadoghq.com/20240606 with auth_id=170 List-Id: B4 Relay Submissions If any tests failed, exit the program with a non-zero error code. Signed-off-by: Vincent Whitchurch --- tools/testing/selftests/bpf/test_sockmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c index fd2da2234cc9..cf1c36ed32c1 100644 --- a/tools/testing/selftests/bpf/test_sockmap.c +++ b/tools/testing/selftests/bpf/test_sockmap.c @@ -2238,7 +2238,9 @@ int main(int argc, char **argv) close(cg_fd); if (cg_created) cleanup_cgroup_environment(); - return err; + if (err) + return err; + return failed ? 1 : 0; } void running_handler(int a) -- 2.34.1