From patchwork Fri Nov 18 03:44:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_D=C3=ADaz?= X-Patchwork-Id: 22091 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp761210wrr; Thu, 17 Nov 2022 19:50:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf6rJkVvbI7YxvdBM53IBIvGzIuipuqXPnlPBK1LtSFYy+SQm247OHzkj/Xs25L36J27OrmI X-Received: by 2002:a17:906:38c:b0:78d:4ebb:7ea1 with SMTP id b12-20020a170906038c00b0078d4ebb7ea1mr4389628eja.357.1668743412279; Thu, 17 Nov 2022 19:50:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668743412; cv=none; d=google.com; s=arc-20160816; b=x86stY3JXdMUYTfWAP4X6AMWMpXEmGjL7aWq/iLTtPeDAnj1iqbXQhAX+ymeSBMnKJ VCOJh3pMO4d4HCR2yUo0V6KK8j/MHOv0cMhi2kEeKY0s9DM+70/hjD2lbyBx1FDoFBrJ 3qH0SxnfzIuoiQMbEzXdTrRMfPxJoAKWdwf0KgMoKokcR2x2nMY9cWGIRWcQph2Ex34E LC4km/clIHeGaR/AgMB3TTV3mQimP6VV8uNVlytzCuFGYO9mqACMqIw0t9YyiPCgDwk7 EVngoAb2uOUb+mb15jupaJVSODJHcf+tKeFkT236UyM0Bj38Vg3azC0QQbL4kOQGphxZ XoAA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=jGnYXRgUuCOtcxhHcdN3EAOTRD6u/BtPvCMZue/+ZQE=; b=0iFGnRWigj7dW9RaBuawLYu5+S0dToLiMgNTQLajtiGLF2ie2CWsC3Jc2xgroa4jZ7 QWWRspr/ON5v3DLSpsJREvBNjqpf9J3b0H8nLhcqB0nAPavQhLij0VwQM0Gv9v7/rffL pV4JX6Ma/Bq1rAey1WzNXK2OL7d9AClHhSE4AT9uSOCOPHW7jaVKf0KwEMX5AUM6hLa7 B+GoaIdcCB3V7MjqaUlAk3oD484iDvfwTM4E1ucaUBnxv2RzGmvpzoZWWhdjMwyFfeRE gv3P6PXwKUiRBuuqcPr9z+IfsKL3VWi/BnokR4owfBs5SqSIE1rR1Bqj8qqtaYEDFUSo 0J1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z0vmkWFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020a056402274300b00463c29b5443si2419741edd.27.2022.11.17.19.49.48; Thu, 17 Nov 2022 19:50:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z0vmkWFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234317AbiKRDo4 (ORCPT + 99 others); Thu, 17 Nov 2022 22:44:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234794AbiKRDox (ORCPT ); Thu, 17 Nov 2022 22:44:53 -0500 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FCF565E54 for ; Thu, 17 Nov 2022 19:44:52 -0800 (PST) Received: by mail-oi1-x233.google.com with SMTP id s206so4139089oie.3 for ; Thu, 17 Nov 2022 19:44:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jGnYXRgUuCOtcxhHcdN3EAOTRD6u/BtPvCMZue/+ZQE=; b=Z0vmkWFntUkPh2GZ76Y/bnp2oYyE4jqya+BzsIeqgdc8ywkzdgfVsxijBvxMnQSJ6J FYoh3g5fUNxkJQup4YQfAE0LP3JRAyOELUSbC7TMsSlow7k2dJdTzeFzr1g0Ii9XS89Q 5YTGFgPkOqKTp8rZqtArRHNoQ44fvwNlMfeuv0zhLKIb4A+RyVI7y79bGFVUu+lL95jl R2EfWp0lkOGq0f0LGtyg9YW3x+7y6JFqdzK6YGjKJqehgms9rVWU63FtXWl0GqnTODVf TpqTukpuAR1amnQBM/74a5X48E4qJsDts/6fzI5fmGFdZlDVDjfyI51sNGof7R26tQQ6 7yzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jGnYXRgUuCOtcxhHcdN3EAOTRD6u/BtPvCMZue/+ZQE=; b=PR6NxZXd4GDqnWKb1w48aMdhVgEavU9sEFDmLpFBKJ3qfzyzje52Dr3CAXAu/ols5i nSbT1ZcSIhyyHBk3PjFEvZSWWb6mGPKM0tp0d3fmZzm9czkg4DgEwSkjgxs+fypAQCEr J1AiLFhRbVkD2QLVRxmMQWwIC8LF/B8NyNk7MUT/eG57NEBGp53EG2k20ZbsQtJV97EZ EY2Q3omuP8gKjXymRyAJdlYTCf6ol1LLt+F+RMCB8awWYWIWjggAq9SlIIjcNMpEjvWc cwIuzQSv/BWdeTPoO1qq5q48g8NY+vJGR83yblDVrk3AUdJvk08IzwhjWcY1fs+DCdsk xlGw== X-Gm-Message-State: ANoB5pmai6Xp4a3JrtX71zKB7rcQNV141IgM0maOJuLsEHAMrWkoKGg6 4WTxfw1pvKL5RNs+s9oE8jgrlw== X-Received: by 2002:a54:4705:0:b0:35a:1945:4610 with SMTP id k5-20020a544705000000b0035a19454610mr5297087oik.149.1668743091543; Thu, 17 Nov 2022 19:44:51 -0800 (PST) Received: from alago.cortijodelrio.net ([189.219.72.83]) by smtp.googlemail.com with ESMTPSA id c23-20020a4ad8d7000000b0047f94999318sm1020032oov.29.2022.11.17.19.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 19:44:51 -0800 (PST) From: =?utf-8?q?Daniel_D=C3=ADaz?= To: linux-kselftest@vger.kernel.org Cc: =?utf-8?q?Daniel_D=C3=ADaz?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan , netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] selftests/net: Find nettest in current directory Date: Thu, 17 Nov 2022 21:44:21 -0600 Message-Id: <20221118034421.994619-1-daniel.diaz@linaro.org> X-Mailer: git-send-email 2.34.1 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_NONE, SPF_HELO_NONE,SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749804292667605467?= X-GMAIL-MSGID: =?utf-8?q?1749804292667605467?= The `nettest` binary, built from `selftests/net/nettest.c`, was expected to be found in the path during test execution of `fcnal-test.sh` and `pmtu.sh`, leading to tests getting skipped when the binary is not installed in the system, as can be seen in these logs found in the wild [1]: # TEST: vti4: PMTU exceptions [SKIP] [ 350.600250] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready [ 350.607421] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready # 'nettest' command not found; skipping tests # xfrm6udp not supported # TEST: vti6: PMTU exceptions (ESP-in-UDP) [SKIP] [ 351.605102] IPv6: ADDRCONF(NETDEV_CHANGE): veth_b: link becomes ready [ 351.612243] IPv6: ADDRCONF(NETDEV_CHANGE): veth_a: link becomes ready # 'nettest' command not found; skipping tests # xfrm4udp not supported The `unicast_extensions.sh` tests also rely on `nettest`, but it runs fine there because it looks for the binary in the current working directory [2]: The same mechanism that works for the Unicast extensions tests is here copied over to the PMTU and functional tests. [1] https://lkft.validation.linaro.org/scheduler/job/5839508#L6221 [2] https://lkft.validation.linaro.org/scheduler/job/5839508#L7958 Signed-off-by: Daniel Díaz --- tools/testing/selftests/net/fcnal-test.sh | 11 +++++++---- tools/testing/selftests/net/pmtu.sh | 10 ++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh index 31c3b6ebd388..21ca91473c09 100755 --- a/tools/testing/selftests/net/fcnal-test.sh +++ b/tools/testing/selftests/net/fcnal-test.sh @@ -4196,10 +4196,13 @@ elif [ "$TESTS" = "ipv6" ]; then TESTS="$TESTS_IPV6" fi -which nettest >/dev/null -if [ $? -ne 0 ]; then - echo "'nettest' command not found; skipping tests" - exit $ksft_skip +# nettest can be run from PATH or from same directory as this selftest +if ! which nettest >/dev/null; then + PATH=$PWD:$PATH + if ! which nettest >/dev/null; then + echo "'nettest' command not found; skipping tests" + exit $ksft_skip + fi fi declare -i nfail=0 diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh index 736e358dc549..dfe3d287f01d 100755 --- a/tools/testing/selftests/net/pmtu.sh +++ b/tools/testing/selftests/net/pmtu.sh @@ -686,10 +686,12 @@ setup_xfrm() { } setup_nettest_xfrm() { - which nettest >/dev/null - if [ $? -ne 0 ]; then - echo "'nettest' command not found; skipping tests" - return 1 + if ! which nettest >/dev/null; then + PATH=$PWD:$PATH + if ! which nettest >/dev/null; then + echo "'nettest' command not found; skipping tests" + return 1 + fi fi [ ${1} -eq 6 ] && proto="-6" || proto=""