From patchwork Mon Feb 26 16:23:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= X-Patchwork-Id: 206768 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2185247dyb; Mon, 26 Feb 2024 08:25:01 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXhIDSeqwcZslgasdVHrfGR9rhRjej2EGKafto5Mn2Bsrpi7Mrak5jlucBShNyzcPKD0jTAgyY3EgAhiXnBcoDsEsk1QQ== X-Google-Smtp-Source: AGHT+IE32LeXS9UZ/AY4Zhd89zKRfJ2cmf0lgU6aXAYgXEj1PKDq4CgwQpmpZOaUYtXoz9uzA891 X-Received: by 2002:a05:6102:3234:b0:470:3a5d:a711 with SMTP id x20-20020a056102323400b004703a5da711mr4256049vsf.6.1708964701062; Mon, 26 Feb 2024 08:25:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708964701; cv=pass; d=google.com; s=arc-20160816; b=yzNyDgwdcHEL4ELzzwOQyCuABhR2zGXHO2YUSR3f4ucxTmDwlZIODq4mSDowUbs89c uXqlfQI1vinSGW3aAFXLLeRUOAIB6GgtFp3Ztc3Dk8hi+w4C7WIrrwIlufp6+ebF+ehx IXnbgKRSAEnq3CBO7p+VWrHlVb+1rx2Z5aXRbJzzgXiIu2AJrKXQY4O2qIBO5mplih2G T2xvNlypbYnb84KHQnf1avhq6NSWp39N8Rhs+ad1zJH1pSrPBbEMyJKM2eo/1eWx+GY9 1RjZ+jJSX0vWjAifR8cOkvR7e9bPfSbJd6zvULO+K+1BKGR5w5z8v1p5601AX5u1glbD 6OLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RWpjmlAs5uN55zt8YC8Tf0FPyv/9mkcoQuZE0jzOkMg=; fh=K0JPSFdNpi/Cfy8dtq3QIYRSBCp2/NcVcn+SzLGvTsE=; b=c07QIipQCgIDMWoTEbk9VteN6J4Bd3NMLIwqu7pLbDWz8paPOxRN5SmA804hJLivjk IH5xgLolFBFisGB+CCLqVF9rB+mWsXynZcdt9ylGbOBrHQGDAAyofLj0NDPLJVij6Xag VQRz0WdJkxwlVkk5SM+UjncsvvVTgWRrHGO2UdHqG7umfaY7nYhWI3COuFITluoT1dRW ebSRanq78N5P74vp1fYv47+9eY+S7IhUBITp3yvzTw/k3Qb+sb0eHZUV3UGFYYUjzfz8 8t/QRvRu//F1pmKpW7q5UfUFiRH2hKH5Hga3jvHbRgYPUi2AClXwvkMxCF0LfCZkT1Cu Ep2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=YaPaegVb; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-81896-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81896-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g20-20020a056102159400b0046d2aa46ad3si697721vsv.113.2024.02.26.08.25.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 08:25:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81896-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=YaPaegVb; arc=pass (i=1 spf=pass spfdomain=digikod.net dkim=pass dkdomain=digikod.net); spf=pass (google.com: domain of linux-kernel+bounces-81896-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81896-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D2ECC1C22B99 for ; Mon, 26 Feb 2024 16:25:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A23FA12C81D; Mon, 26 Feb 2024 16:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b="YaPaegVb" Received: from smtp-bc09.mail.infomaniak.ch (smtp-bc09.mail.infomaniak.ch [45.157.188.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6AF612D761; Mon, 26 Feb 2024 16:23:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.157.188.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708964638; cv=none; b=Tk4j762Be+BJ7qBNpeCfIYMafposhoeHF0DvayBkM7zbRx0swUIQUgvt1miMvQosMkEO6N1wONHpmPxtst+/iAS4TcnGyKMc17T8+AIek1FwpsBGHxftcSbDGnV0yU95bTlN8m8NwkwWwGrvMPXYd7/s4M+AhQRMZDrrpM7NI8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708964638; c=relaxed/simple; bh=lzn0jtPveq2aZBuWKiD3pKlsYwgBRJ4U7D5p8D9Xa9s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bdezgmXiI/dp3bnU+QQWqJLhzXiy7SGRSJvOy5Zwjro6CJA3FRBnS8GYIwfRxATIr7meqEw29kqTV/Y0aoKTbTGaE8whiUzqrDCCT3VYIyvXOFJlSOPeeNVtlMlyBo1xbnguXMMT1WHv3NRa8Dk41U+u1uldXbaGlx7RM437Ca4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net; spf=pass smtp.mailfrom=digikod.net; dkim=pass (1024-bit key) header.d=digikod.net header.i=@digikod.net header.b=YaPaegVb; arc=none smtp.client-ip=45.157.188.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=digikod.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=digikod.net Received: from smtp-4-0001.mail.infomaniak.ch (smtp-4-0001.mail.infomaniak.ch [10.7.10.108]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Tk5XL25Xkz7Km; Mon, 26 Feb 2024 17:23:46 +0100 (CET) Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4Tk5XK57h5zsTl; Mon, 26 Feb 2024 17:23:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1708964626; bh=lzn0jtPveq2aZBuWKiD3pKlsYwgBRJ4U7D5p8D9Xa9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YaPaegVb2VeR9n1J0G87joTNxA5lTSCmCLy4PBAVLu7Lqt12AqXXskAoqUqMEE+hT XBVmzYf44ndBNqzZ/DtYwaTTZ/LFBed7UNWO5ng4R6qBVTShDC5haaNxsDTSXr3lnC gRrSEET6p6I/quv+GrYOb4tdGkjEmqDxv9JQaQ0s= From: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= To: Jakub Kicinski , Kees Cook , Shuah Khan , davem@davemloft.net Cc: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , =?utf-8?q?G?= =?utf-8?q?=C3=BCnther_Noack?= , Will Drewry , edumazet@google.com, jakub@cloudflare.com, pabeni@redhat.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 1/2] selftests/landlock: Redefine TEST_F() as TEST_F_FORK() Date: Mon, 26 Feb 2024 17:23:34 +0100 Message-ID: <20240226162335.3532920-2-mic@digikod.net> In-Reply-To: <20240226162335.3532920-1-mic@digikod.net> References: <20240223160259.22c61d1e@kernel.org> <20240226162335.3532920-1-mic@digikod.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Infomaniak-Routing: alpha X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791979370490163554 X-GMAIL-MSGID: 1791979370490163554 This has the effect of creating a new test process for either TEST_F() or TEST_F_FORK(), which doesn't change tests but will ease potential backports. See next commit for the TEST_F_FORK() merge into TEST_F(). Cc: Günther Noack Cc: Jakub Kicinski Cc: Kees Cook Cc: Shuah Khan Cc: Will Drewry Signed-off-by: Mickaël Salaün --- tools/testing/selftests/landlock/common.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/landlock/common.h b/tools/testing/selftests/landlock/common.h index 425c5698aea2..0bc15d36971a 100644 --- a/tools/testing/selftests/landlock/common.h +++ b/tools/testing/selftests/landlock/common.h @@ -37,7 +37,7 @@ struct __test_metadata *_metadata, \ FIXTURE_DATA(fixture_name) *self, \ const FIXTURE_VARIANT(fixture_name) *variant); \ - TEST_F(fixture_name, test_name) \ + __TEST_F_IMPL(fixture_name, test_name, -1, TEST_TIMEOUT_DEFAULT) \ { \ int status; \ const pid_t child = fork(); \ @@ -80,6 +80,10 @@ __attribute__((unused)) *variant) /* clang-format on */ +/* Makes backporting easier. */ +#undef TEST_F +#define TEST_F(fixture_name, test_name) TEST_F_FORK(fixture_name, test_name) + #ifndef landlock_create_ruleset static inline int landlock_create_ruleset(const struct landlock_ruleset_attr *const attr,