Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp292626pxb; Tue, 28 Sep 2021 22:26:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwSv8sYtNIlcXPoV42Day9rJHACHjIxVWAdQFOigVRrZ86WEku34IVbmW1yege4S4cR2bZ X-Received: by 2002:aa7:c0d4:: with SMTP id j20mr12583702edp.26.1632893186932; Tue, 28 Sep 2021 22:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632893186; cv=none; d=google.com; s=arc-20160816; b=mL6mp7csXBQGH63I2oauJB+OvITB01PioIQgKRBGVI6HhSskJ+JBe8RW3jvMWEnT/M HToTYKZCTiq/LUKHrlchwZUMJ1RYTBe9+1HTY+6Owd9WZLDafpA1+4iar4d+S4gVOpqY GQrZpIffyyVHloVMUpUilYdWEQfVfAsX+qg2MdTZHqsBPdB18bQBFE7Z8qAu1npmjKuy vJ7QwMsy//Di1EdO3eeBKDJpuZM5g6MM255Wa2deVjGXqbqaQrjr/It+0/+fBvzkv7r+ 94uY8Mve3otAs3TydEJl1F4LHjTpO/77g3Xq0Ox0acCC0WiJQa9bLPJS10ER0/uymiTV ueBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MnfWci33OxaIqWkhaUWKgeCRCJGFxddYrn7zGjAWBHA=; b=nCCp6g5zcr69S1PnF1QF4lekoQKYYdF869/CUctBarorcL6equtDGlA6iEh0zWwSv6 2OHlaVV2Ontm3c6ZnU359Tu86np1bJ1eyM3lvE9SXcUAPkPm5biTblvWZzxGS5UKwtlQ 7kDZBx5XfkbSNay0DM4nFz3wsRyxJ+wl7+vTQ/cKmzbTDjv/DWL0j/xPskEKs9vW1CDJ X78wzymiKxIKJb3bipFQQavU4AEx1cr9C38+mhtma8DsoF6OZdZg7xLV7+0c1UmUFIg7 EoAx7/dpTkXvir7mC/M0tbI7g/zN2h4Pu4IQMnCKbFHzASEVDYSpvUkIB5+b0FrWKKOx d4og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=A3E908NK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si1372101ejm.381.2021.09.28.22.26.02; Tue, 28 Sep 2021 22:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=A3E908NK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244148AbhI2FYi (ORCPT + 99 others); Wed, 29 Sep 2021 01:24:38 -0400 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]:35876 "EHLO smtp-relay-internal-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243585AbhI2FYh (ORCPT ); Wed, 29 Sep 2021 01:24:37 -0400 Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 953EF40319 for ; Wed, 29 Sep 2021 05:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1632892976; bh=MnfWci33OxaIqWkhaUWKgeCRCJGFxddYrn7zGjAWBHA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=A3E908NKT5lrxierITA4ef/Bz19YWD3rL6Cga4Ny5DhETDk3fQQ5xP5zHN6ZX9lNn kft1foZh/cC12afLpFAWeMoR4T/dWqyRQp7DFj+eOz2S30AqBgY2vU7UjgN53d8SqW AwoNgULFA/RuTpxQCY0zRt2mN0YcHAlcmq0YG86PrMB+AE8p6onP9/OYG+MBf0x0uN QTQTBpxE4so5SL6eJJXL96wJKJm3+gSlA8xpNibkzpTu0tIzvC6UzmPPHYNmEvCAfd XpRztnsOSDHCPjh+bIqV+A68KLJ3PG7Cyv0+UEm1TtswzuRWuVgsoEV4Pf2SwGY+PI XIfb6ks+tDzfw== Received: by mail-pl1-f197.google.com with SMTP id p5-20020a170902a405b029012cbb4fcc03so630856plq.19 for ; Tue, 28 Sep 2021 22:22:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MnfWci33OxaIqWkhaUWKgeCRCJGFxddYrn7zGjAWBHA=; b=uMB4uhGwpIm/G+BoKfieZkhm1a5F57uez2bI2z2XVsVespHrMOD8dC2PJZjKhN+nQR mxtKXbg0XqXBW76qWcFiGdUZs7Q7I/h/Jxh/aW3Wl+WofR10dVfoNaAqFSXVrNJ20vYE m5rU5WiBTAKG8aOmky66ifNg7pM1sBpQMKS3LtLEltDPlRIRajdRcRl4sszQIq9kEdk9 EyJV/O4rQTEE9jocpzGWxsgDWvSX5m4AvYPHQbrfCtgy9x/jijw06av62FeiWvgwV7Z5 AlyBq0G/O+9dv03wKbKFj8qYNz2VM8RvJixyUWhd+t+foM+0+wKTQCApCDIKo13E4kYZ kcAA== X-Gm-Message-State: AOAM531mWwS2N+b5PyaDWp3AGpqcpsf7nzlFE8XbTp/hg2Qqa4ugV6vh U/cWys1zuCPYaWhDvr+HsBWe/spEepzDHqEjstXsXSCvYZSMCFveyrMYhq3ih94HMbj61p7vrPF bRtVI4iSXXtcBpVrh/fOoadFzgQCib1/r+hIRr7dXAWkrfZUqVwkCnO3Q X-Received: by 2002:a17:902:c205:b0:13e:6097:b992 with SMTP id 5-20020a170902c20500b0013e6097b992mr356401pll.88.1632892974837; Tue, 28 Sep 2021 22:22:54 -0700 (PDT) X-Received: by 2002:a17:902:c205:b0:13e:6097:b992 with SMTP id 5-20020a170902c20500b0013e6097b992mr356367pll.88.1632892974439; Tue, 28 Sep 2021 22:22:54 -0700 (PDT) MIME-Version: 1.0 References: <20210823030143.29937-1-po-hsu.lin@canonical.com> <87h7fdg8pr.fsf@cloudflare.com> In-Reply-To: <87h7fdg8pr.fsf@cloudflare.com> From: Po-Hsu Lin Date: Wed, 29 Sep 2021 13:22:54 +0800 Message-ID: Subject: Re: [PATCH] selftests/bpf: Use kselftest skip code for skipped tests To: Jakub Sitnicki Cc: linux-kernel , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, hawk@kernel.org, Jakub Kicinski , David Miller , kpsingh@kernel.org, john.fastabend@gmail.com, yhs@fb.com, songliubraving@fb.com, kafai@fb.com, andrii@kernel.org, daniel@iogearbox.net, ast@kernel.org, Shuah Khan Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 25, 2021 at 5:44 PM Jakub Sitnicki wrote: > > On Mon, Aug 23, 2021 at 05:01 AM CEST, Po-Hsu Lin wrote: > > There are several test cases in the bpf directory are still using > > exit 0 when they need to be skipped. Use kselftest framework skip > > code instead so it can help us to distinguish the return status. > > > > Criterion to filter out what should be fixed in bpf directory: > > grep -r "exit 0" -B1 | grep -i skip > > > > This change might cause some false-positives if people are running > > these test scripts directly and only checking their return codes, > > which will change from 0 to 4. However I think the impact should be > > small as most of our scripts here are already using this skip code. > > And there will be no such issue if running them with the kselftest > > framework. > > > > Signed-off-by: Po-Hsu Lin > > --- > > tools/testing/selftests/bpf/test_bpftool_build.sh | 5 ++++- > > tools/testing/selftests/bpf/test_xdp_meta.sh | 5 ++++- > > tools/testing/selftests/bpf/test_xdp_vlan.sh | 7 +++++-- > > 3 files changed, 13 insertions(+), 4 deletions(-) > > > > diff --git a/tools/testing/selftests/bpf/test_bpftool_build.sh b/tools/testing/selftests/bpf/test_bpftool_build.sh > > index ac349a5..b6fab1e 100755 > > --- a/tools/testing/selftests/bpf/test_bpftool_build.sh > > +++ b/tools/testing/selftests/bpf/test_bpftool_build.sh > > @@ -1,6 +1,9 @@ > > #!/bin/bash > > # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > > > > +# Kselftest framework requirement - SKIP code is 4. > > +ksft_skip=4 > > + > > case $1 in > > -h|--help) > > echo -e "$0 [-j ]" > > @@ -22,7 +25,7 @@ KDIR_ROOT_DIR=$(realpath $PWD/$SCRIPT_REL_DIR/../../../../) > > cd $KDIR_ROOT_DIR > > if [ ! -e tools/bpf/bpftool/Makefile ]; then > > echo -e "skip: bpftool files not found!\n" > > - exit 0 > > + exit $ksft_skip > > fi > > > > ERROR=0 > > This bit has been fixed a couple days ago by a similar change: > > https://lore.kernel.org/bpf/20210820025549.28325-1-lizhijian@cn.fujitsu.com > Hello Jakub, Thanks for the feedback, I have submit a v2 patch for this: https://lore.kernel.org/bpf/20210929051250.13831-1-po-hsu.lin@canonical.com/ Cheers > > diff --git a/tools/testing/selftests/bpf/test_xdp_meta.sh b/tools/testing/selftests/bpf/test_xdp_meta.sh > > index 637fcf4..fd3f218 100755 > > --- a/tools/testing/selftests/bpf/test_xdp_meta.sh > > +++ b/tools/testing/selftests/bpf/test_xdp_meta.sh > > @@ -1,5 +1,8 @@ > > #!/bin/sh > > > > +# Kselftest framework requirement - SKIP code is 4. > > +ksft_skip=4 > > + > > cleanup() > > { > > if [ "$?" = "0" ]; then > > Would consider making it read-only: > > readonly KSFT_SKIP=4 > > [...]