From patchwork Fri Dec 1 20:23:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 172654 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1395803vqy; Fri, 1 Dec 2023 12:24:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IFs78SRLY2eb/sxGwC79Vh/vnXKHIaIJA1AGKJfnsaIs9hHSsfq7oOdsixP2M/J3YnCcVyt X-Received: by 2002:a17:902:8f8c:b0:1d0:6ffe:1e86 with SMTP id z12-20020a1709028f8c00b001d06ffe1e86mr74423plo.105.1701462260985; Fri, 01 Dec 2023 12:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701462260; cv=none; d=google.com; s=arc-20160816; b=PxdrhCufKHR72/YTC0/StQppFH8168BtYdzG9tIf17ISEjnTkwnR68gB7A4Ipc0cj1 lsu07p4PK83CoXMHs5VWEezmWjQWp7Yt2JL2xz/fsDv+at8sEaEGiDheezrGppzmfaD5 VC1QIFMbTqkgpHz8aTxD753+C4Uf1GaldZDT9kTK/OOMvNkp14aDUftTagDlYEFv7ltv K53UNDy8rhlwgH5kCbsseqdFoy+piD6CBXlb0uws0yrjimjXEQFweLvMNhzBuRzdmPBa f1AUSFw6ROP3kFWGfMSyd8wjl8s3DP0Q8lruUKXdUf3H0XpKOEmjG5aWBL9ObuRerKZs f/oQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; fh=EED5Kmk4NeeAF1lciSI8z5093duwqeI1+6ucqgDjd84=; b=DfyvMFQBcpaQEhBB/yymxA0goHj0bouTfLYXZYm/8h5x8/99xy6vAbP0l+vYdN/ENj FmJ2TBLNwXzXIc8HIfI9mb9AqDO9I7AlsOAfwDTN3gRrdB1lSSXAgBDMZfrMPTj4SgOo jmxjXkMf/lgCt3L2qYL0W9Fvw40ax/ehTOXyYiNHjhuPvUX0neFsS/8hHVtdvOedFqnj fv8iX8aGsOvCo/jn3Tb/w4J2kwvDwMFCGvRsiZgGRM5Qq0xXUWhVHErBmcTDkPp6wZ5I 1Ra/tFdjlzoLkiHst2MdZKZxyKH96hnx/4cSlvcFuSmH1bww03u3CuOGOz7sj/HQHkMt /ItA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=EHAr4rCg; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=MDBWQLOY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id x2-20020a170902ec8200b001c36018fdaasi4021041plg.219.2023.12.01.12.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 12:24:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=EHAr4rCg; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=MDBWQLOY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0B97E8153D1B; Fri, 1 Dec 2023 12:24:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379600AbjLAUYI (ORCPT + 99 others); Fri, 1 Dec 2023 15:24:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230526AbjLAUX6 (ORCPT ); Fri, 1 Dec 2023 15:23:58 -0500 Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D25F10FE; Fri, 1 Dec 2023 12:24:03 -0800 (PST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailnew.nyi.internal (Postfix) with ESMTP id 40599580996; Fri, 1 Dec 2023 15:24:03 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Fri, 01 Dec 2023 15:24:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1701462243; x= 1701469443; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=E HAr4rCgShLNZZ4O/7TNayEf9oOKO4GXYDh3ZOePutwcEIvReaAQcyQxASQqhSqj/ BY9Ywbiz59KGIUN7eT88YwhLmIlEvm2SFOhFMSn30mRL00iRu6wrC5BEl/5azSVV 2RJceiUKGAmWVIYFWg1+przrpLhm3v1f29s1hmyPaTzSAwGyu+L30MLHJnFn+HHF ISf3POIQOyA3voHkM4goE+HPtqd5hOIhgmZHXi6VPRpW0gqITajsGnLd2sGNf6LC oyWRhEa9STdmUAikinlFOfLho3HZGolrzHBi+Ex0r8YFOL2etle0zz0SNKTHZzOw +Arqn2dpk96LvZTdxC69g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1701462243; x= 1701469443; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=M DBWQLOYFMi8R6XPEcWeb/joAJYbPqAt0dP9wpyRd7fzmvHPa7VPbsoEB/Rjxnggj VbrW6/TLi8376FLUEZbOKGEsQNu6X1q2K2WuJDMzZPkdZLOTqcoZRAemRApoaS/z 4lUBZMSfIOrFDfYT/rN92xb8O8/b0k71H8A6tsTPQfEq8jeoDcWPGX3A72mGioPz b9+Qq4sqM6A81UfI12vO+8rKWzGOWcF8AcaJmFre1QhIonGsjwv+TnGpq0iRqSLV JBRESn5Zg/+rGvqwbsIkIzH5uNYUdaBxyw46v87jLJEOYiI0wqfeQMK4HAynyvRX YJe5AumJq90e0gT8j+z/Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeiledgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcu oegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpefgfefggeejhfduie ekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Dec 2023 15:24:01 -0500 (EST) From: Daniel Xu To: ast@kernel.org, daniel@iogearbox.net, shuah@kernel.org, andrii@kernel.org, steffen.klassert@secunet.com, antony.antony@secunet.com, alexei.starovoitov@gmail.com, yonghong.song@linux.dev, eddyz87@gmail.com Cc: mykolal@fb.com, martin.lau@linux.dev, song@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linux-ipsec.org, netdev@vger.kernel.org Subject: [PATCH ipsec-next v3 6/9] bpf: selftests: test_tunnel: Setup fresh topology for each subtest Date: Fri, 1 Dec 2023 13:23:17 -0700 Message-ID: <0441399633380f6ac1bd34ae6e5bf668fb7b83ce.1701462010.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 12:24:20 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784112491874668992 X-GMAIL-MSGID: 1784112491874668992 This helps with determinism b/c individual setup/teardown prevents leaking state between different subtests. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/prog_tests/test_tunnel.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c b/tools/testing/selftests/bpf/prog_tests/test_tunnel.c index d149ab98798d..b57d48219d0b 100644 --- a/tools/testing/selftests/bpf/prog_tests/test_tunnel.c +++ b/tools/testing/selftests/bpf/prog_tests/test_tunnel.c @@ -535,23 +535,20 @@ static void test_ipip_tunnel(enum ipip_encap encap) #define RUN_TEST(name, ...) \ ({ \ if (test__start_subtest(#name)) { \ + config_device(); \ test_ ## name(__VA_ARGS__); \ + cleanup(); \ } \ }) static void *test_tunnel_run_tests(void *arg) { - cleanup(); - config_device(); - RUN_TEST(vxlan_tunnel); RUN_TEST(ip6vxlan_tunnel); RUN_TEST(ipip_tunnel, NONE); RUN_TEST(ipip_tunnel, FOU); RUN_TEST(ipip_tunnel, GUE); - cleanup(); - return NULL; }