Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4253234pxj; Tue, 25 May 2021 03:57:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvT41JHmdG7p5dpYtIkMU/MbTZ7h1B91Ydsj9/ROZMAY7tTiWwIyKdHyr9gxuhD78aNWXa X-Received: by 2002:a17:907:20ce:: with SMTP id qq14mr27706896ejb.35.1621940223921; Tue, 25 May 2021 03:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621940223; cv=none; d=google.com; s=arc-20160816; b=N6syo0mtZq7vVrhCQCuZhhdflz/GMLAGKiLtYxl+p1PO5eoRFcUn8wBQzZdyVDsv1F maaL8Gzjbyw0VvIL8q8UE4MJbLN3SM6UcjbJtQB3J5mzUUJOVueOQEw68nSDztyvU/3A GgVKMNeh67dQOuGpbFJ9HixEnkjwF5kQbkp2/Vnaqyr2+fzSNRdPpB9n+HZrVGteHGFk 5XmmQRv6nAxh24NW5cTIQkZyS1WZzYQoRTb7sZZd/JyENG+l5vb02qGHStYu5l3QxUIA rvXUruISwabu0i6WRo2leZ9qaY1RD0V1D8dguvbPz2BN76vCGkG5o4mcjgDUmLtcQXHc dl1w== 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; bh=U7p+WdCrLEBx/FiI7skBf0U0P+IdeMCYAYyt9GXvbf4=; b=ZLujcGwaeITT/QfMztMs1elVajXnZQBJwfJ9qRqWB6C8xvXdAPFL6icRVN/fzZjO45 gFL8twAOBkSPp32Bu23fszQos8h6Rz7aS6u2ngg90BEhSQFDP+Yjzus3Bwt7e85ZQjq3 yx6OsGgw5qt4HjUNzi2YymUVQ8U2IbF+5GbwOnI48HdxDmnEk/WcJz/R+bGtyH6hH1Yk wtbxQjIEc8mo9amNTB3RWttP0Kd0e84b50dMTCtLD2zZGill4tB6unOHk4j9M5dGUapq IG1efq2IM3AuC0kz2BJvX53ZjEYKZyaHWNbwNX708ddnZoN8f6RNQ1Zj8FyKjuMfyL4Y ZtAg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 au2si67728ejc.88.2021.05.25.03.56.41; Tue, 25 May 2021 03:57:03 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230342AbhEYKpY (ORCPT + 99 others); Tue, 25 May 2021 06:45:24 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:47418 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230251AbhEYKpX (ORCPT ); Tue, 25 May 2021 06:45:23 -0400 Received: from mail-pl1-f199.google.com ([209.85.214.199]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llUXQ-0003Ew-9A for linux-kernel@vger.kernel.org; Tue, 25 May 2021 10:43:52 +0000 Received: by mail-pl1-f199.google.com with SMTP id x15-20020a170902e04fb02900f5295925dbso8999894plx.9 for ; Tue, 25 May 2021 03:43:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U7p+WdCrLEBx/FiI7skBf0U0P+IdeMCYAYyt9GXvbf4=; b=XWlQpZAEJdJVpLEB64ZZuHyfoXw4jUVPSLK2hf6f+CiQOZMVh+OaROFHutsoc45THu FNapr0ujIKBo45tQMosqXkA3paL2Uc0xwRxCDY6o/ntnfJKao2SWUnpFdZ+rDmZy5crB N/AmDoLkBG8uz2jnOf7a1aDjZtGTqhcYCPntcrPQlCik1M7pq1AWHtmiAn0vAigQETLy O5Tc48hVTmqfP98vyPYNTxz7lcnlArNtesRJ4oT63xk04uGuuOnSuauJ2MyZPDEIn5BM Pklh5wLA29B8lA+CJPnbvpx+0z4rGe65ueP4v242wQPAWfqdCsBtUZeDY37p0m5mEQQs jI6w== X-Gm-Message-State: AOAM532+NoRT7B4OKaHzYDL2zJCXPOD+fxMF7p+YOMI4W5y4vW6NvXZV Qwib0UTGwzUfDt2jbpr/vL8BPffMBifsNLpGykTIV1MVeG4B+Nzj1lrbfputqYe4yteuK5A893G Gy9E/HV+VeZFDF49XAzaV9OWAaTQyavF/A6dY0I5Zha56SsSnxUy9I790 X-Received: by 2002:a17:90a:a395:: with SMTP id x21mr29859625pjp.63.1621939430968; Tue, 25 May 2021 03:43:50 -0700 (PDT) X-Received: by 2002:a17:90a:a395:: with SMTP id x21mr29859587pjp.63.1621939430616; Tue, 25 May 2021 03:43:50 -0700 (PDT) MIME-Version: 1.0 References: <20210525061724.13526-1-po-hsu.lin@canonical.com> <87lf83cdyj.fsf@nvidia.com> In-Reply-To: <87lf83cdyj.fsf@nvidia.com> From: Po-Hsu Lin Date: Tue, 25 May 2021 18:43:39 +0800 Message-ID: Subject: Re: [PATCH] selftests: Use kselftest skip code for skipped tests To: Petr Machata Cc: linux-kselftest@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, shuah , Shuah Khan , ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, David Miller , Jakub Kicinski , hawk@kernel.org, nikolay@nvidia.com, gnault@redhat.com, vladimir.oltean@nxp.com, idosch@nvidia.com, baowen.zheng@corigine.com, danieller@nvidia.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 25, 2021 at 6:20 PM Petr Machata wrote: > > > Po-Hsu Lin writes: > > > diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh > > index 42e28c9..eed9f08 100644 > > --- a/tools/testing/selftests/net/forwarding/lib.sh > > +++ b/tools/testing/selftests/net/forwarding/lib.sh > > @@ -4,6 +4,9 @@ > > ############################################################################## > > # Defines > > > > +# Kselftest framework requirement - SKIP code is 4. > > +ksft_skip=4 > > + > > # Can be overridden by the configuration file. > > PING=${PING:=ping} > > PING6=${PING6:=ping6} > > @@ -121,7 +124,7 @@ check_ethtool_lanes_support() > > > > if [[ "$(id -u)" -ne 0 ]]; then > > echo "SKIP: need root privileges" > > - exit 0 > > + exit $ksft_skip > > fi > > > > if [[ "$CHECK_TC" = "yes" ]]; then > > diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh > > index 76efb1f..bb7dc6d 100755 > > --- a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh > > +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh > > @@ -1,6 +1,9 @@ > > #!/bin/bash > > # SPDX-License-Identifier: GPL-2.0 > > > > +# Kselftest framework requirement - SKIP code is 4. > > +ksft_skip=4 > > + > > ALL_TESTS=" > > ping_ipv4 > > ping_ipv6 > > @@ -411,7 +414,7 @@ ping_ipv6() > > ip nexthop ls >/dev/null 2>&1 > > if [ $? -ne 0 ]; then > > echo "Nexthop objects not supported; skipping tests" > > - exit 0 > > + exit $ksft_skip > > fi > > > > trap cleanup EXIT > > router_mpath_nh.sh sources lib.sh, which you changed above. This hunk > should not be necessary. Hello Petr, Nice catch, I will remove the following lines in those script that sources lib.sh: +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + Will prepare V2 later, thanks! > > > diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh > > index 4898dd4..e7bb976 100755 > > --- a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh > > +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh > > @@ -1,6 +1,9 @@ > > #!/bin/bash > > # SPDX-License-Identifier: GPL-2.0 > > > > +# Kselftest framework requirement - SKIP code is 4. > > +ksft_skip=4 > > + > > ALL_TESTS=" > > ping_ipv4 > > ping_ipv6 > > @@ -386,7 +389,7 @@ ping_ipv6() > > ip nexthop ls >/dev/null 2>&1 > > if [ $? -ne 0 ]; then > > echo "Nexthop objects not supported; skipping tests" > > - exit 0 > > + exit $ksft_skip > > fi > > > > trap cleanup EXIT > > Likewise. > > Unless I'm missing some indirect dependency, no other selftests in your > patch have this problem.