Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4221811rdb; Mon, 11 Dec 2023 12:21:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQEOt0PSKl2bRCspHuvHY5aP+kbInP+CrVpmkQZIdXMOMxsqO8eRcBmPsC9Pov65TLqWxd X-Received: by 2002:a17:903:40ce:b0:1cf:7bf7:e655 with SMTP id t14-20020a17090340ce00b001cf7bf7e655mr6001445pld.8.1702326113262; Mon, 11 Dec 2023 12:21:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702326113; cv=none; d=google.com; s=arc-20160816; b=B+JUjXaeGKAXEhC9XQ+kyr7UQk/7qLIau6XG8aIyK6g+7yFzK9jcBPEUatsDaTbaKj YEThmFNkdelUlRyj95JB53rJiDa+4xVTEUJAHegaQTGFgo5hGThhiDPQYV8Q9kaAzWV8 9XBUwj3jgRodj0QvGa/YdIAlYAWKgAPDjrmqT9XgsacLP2pWf8r904T/00W1SNyElm5I iciqFqwX2ZLAAOlc9p7+1ioTI76J+00vFkPWb8Jz9FgA4BgVA3WZdwH/79NfMGHCFS4a Ne3kvduOti2OjVNX2uq0DzuDZ2/xwmhIAQf7g8NQmvzGGfIimM7jkofdxoTDUcdDqbvM GDbA== 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=zIt7i/tZWl0ZiVj1ikFYul/lVojdXxdypL0j8VsQMP8=; b=f/GU4V35+kiSz3Bjik/x5glBDCiGd8F0CWAW9EYCzLnvvR4A0i257818iYK/re1uX/ 7cb9UBdTPTiY7rNijXIrfwXgT4d39N9lUZTNmhHNVU0KbJtaraupcLwhQMF0GWjNxP2w l6iHsC3uSCsNll8O6nynhrUxIH4+OFz13cZV2mP9EpCQxC3IP9fgdPmuAuyPUl4BlL67 bdEGIFyCI6JPXACy8Q9GRfv8YUQDcCLei0pDAfk7e3mwEv+CktxC7umPn2EvXP8xYbNN /bmhQfzaDZKcZ9R0O1e1kYiHf1r5/fcZ6Vrv56Jv1oTuPSB/6RkxVnWsXSR3gXlsdSwm q3zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=JVqifZby; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="eFtJ6MH/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b16-20020a170903229000b001d00ff4bf6csi6696020plh.466.2023.12.11.12.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 12:21:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm3 header.b=JVqifZby; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="eFtJ6MH/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id E29A4809C119; Mon, 11 Dec 2023 12:21:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345076AbjLKUVD (ORCPT + 99 others); Mon, 11 Dec 2023 15:21:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345051AbjLKUUk (ORCPT ); Mon, 11 Dec 2023 15:20:40 -0500 Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02D7AC4; Mon, 11 Dec 2023 12:20:43 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id EB9BF58094F; Mon, 11 Dec 2023 15:20:42 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 11 Dec 2023 15:20:42 -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=1702326042; x= 1702333242; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=J VqifZby8iTVbIJr45A2Wmiev1aJW+TsXEbNf3yd8V+3ICvgJMw5d1B4byygvcxLV c1FPo5UbeLe2QSF2Tf/2LXqiH4sOK6LLQ4qKUOes/Cd/q7E5eskcjyYWEtPgOFFp zB9dTNw+Q9ZjCTSb0xOSS5iXW4jO2iybfVhM6jQSGryr6VL1LlRHYTfvhF8YxU2b FNlbRs+ThKMaX72/snNmnlIRFAYCD8g3vDOkWJbUVZBtwqd7HuVttlIrKXxpqau/ BzYFweClaeTPHRBLpGqyMOEBWu+Cfy1j3VTGwAJPbLnMNK2yBrLGEDU6McATG5vA 1nQwOKE2SsrnGVUVzlKWg== 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=1702326042; x= 1702333242; bh=mulrQKzv1eO6blHCVRuuCfG2CgE/rU/CR7wkoBWNDIE=; b=e FtJ6MH/HBvNzW5tiPBaMHj5ijZy+tr5MyHVJPpUwTpndNfGQpVK6BaazSWw8Ajfp sGU7udWshLOgVHWy3ki3GrhLG+QRVWT5OTzJAj0YmFKSlPyCQPoG6cLRYvO3je6P IE02RnR5whrge+p4gReMs71SM/BSZNeefsqWN3eOYb0s8u9iFPzKep2mNg5iPS5I 6X+yeunyDkvg8FPFFyYZ4YPrK9qIfUqvhmI52Zdlbu/MjGYqAHkssAKGKmDcE0w7 K7bFCQ6wpaMmP/mYibHP/9dQDVr1jQrpFqGNRms9fRL/tThiWxmZAfw903D+cx5G LzRmsysIdIwQiOML+mrMA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudelvddgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephf fvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgrnhhivghlucgiuhcu oegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpefgfefggeejhfduie ekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucevlhhushhtvghrufhi iigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiii X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Dec 2023 15:20:41 -0500 (EST) From: Daniel Xu To: ast@kernel.org, andrii@kernel.org, shuah@kernel.org, daniel@iogearbox.net, steffen.klassert@secunet.com, antony.antony@secunet.com, alexei.starovoitov@gmail.com, yonghong.song@linux.dev, eddyz87@gmail.com, eyal.birger@gmail.com Cc: martin.lau@linux.dev, song@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, mykolal@fb.com, bpf@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, devel@linux-ipsec.org, netdev@vger.kernel.org Subject: [PATCH bpf-next v5 6/9] bpf: selftests: test_tunnel: Setup fresh topology for each subtest Date: Mon, 11 Dec 2023 13:20:10 -0700 Message-ID: <64d0eca46fb43b089262ec96c797f56c10e494a5.1702325874.git.dxu@dxuuu.xyz> X-Mailer: git-send-email 2.42.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 12:21:48 -0800 (PST) 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; } -- 2.42.1