From patchwork Mon Feb 6 22:57:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luke Nowakowski-Krijger X-Patchwork-Id: 1738518 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=iQltJgqu; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P9hWY0rb3z23y5 for ; Tue, 7 Feb 2023 09:58:31 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pPARH-0002lG-2v; Mon, 06 Feb 2023 22:58:19 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pPARF-0002kr-4L for kernel-team@lists.ubuntu.com; Mon, 06 Feb 2023 22:58:17 +0000 Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (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-1.canonical.com (Postfix) with ESMTPS id 8502E41AAE for ; Mon, 6 Feb 2023 22:58:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1675724296; bh=/MFK0sBaT4d3Ij3l2tWgOc6lQRGgA0kc0UWoeKXghFc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=iQltJgquI9yA7H7Aq5TpiZoImlJgnoKk8Je4ojnJiEVMmMxNbwPpzaDtWfCb8o2x7 fuMmNwsSEUU2ih7MAUlL1y3xLmqLXO7NJqAjeC9tXTnxBDctp8dS+d0f0IxxDApYbs 2KahriNVCVJW8iNLth1ZPnSMMMO1Dn3cA6rGg+vjGMwGyNpSX3jK9NLy3087coGI1V rQXxRJfpBVK+hOiXNREcA4nnRReTpFsPwvbvxscJ9ecDFku6Ki9A6VKdInQKQ8lNfv U4SGegHBAbjT094ks7earvY8MhjZ+jTNHc360uMFq/njb3zCtqFbq7yIP/+MDZsewS 67PVa5MD10kZQ== Received: by mail-pg1-f200.google.com with SMTP id 201-20020a6300d2000000b004ccf545f44fso5785165pga.12 for ; Mon, 06 Feb 2023 14:58:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/MFK0sBaT4d3Ij3l2tWgOc6lQRGgA0kc0UWoeKXghFc=; b=e8AjkVRztmqRi7uZMc70Uz6Xbxybf0FbWw5mAXGmM8i24CZGx69uwdPoOK7hA1Vx76 neQoo8Kh4AoqQDiFLM4SCAQ/SvHlcvSortsQgoYOkJkqprIzdewu7z80IVhIPxygNb6F KHD3X0L9NhWWu3HjML6dy6ul8StVyIqoqNNsUm94u0dRbXFhEetRmr6/fqAQhKTzXaeO mY5AHLyssPIEC5J7MP9c9rkgA2piQ5zDQYiBdFhJdIyeF0+6IUhkRKCFasAtOb2ESlwo P94FGWeGpm1daUZ1k1ugT+BjfIutJ/09QWMgyb1gCVRag7fCJ0BBou41CrBZYizxUW43 9O+Q== X-Gm-Message-State: AO0yUKVnSckc7aRK57QG4lWH/2jLxzv7Cf2DMyuynmv8tHr4hw4PyT96 8PUwHbT6v2L17HzfSaLrRc3d+G5U44ZIlQcH9C3jk4xtkCh/GFQ8+VwVREslhn7iYvpzi19mOhm LaaagGwD3n5svLl4yX4AfDvKl65qxUP3NLIPc6mjyYg== X-Received: by 2002:a05:6a20:1d47:b0:b8:6bc8:54c2 with SMTP id cs7-20020a056a201d4700b000b86bc854c2mr663505pzb.32.1675724294504; Mon, 06 Feb 2023 14:58:14 -0800 (PST) X-Google-Smtp-Source: AK7set9ZTAHSECMrZHte85dVN37fM4UimtnhF5pLMKFDDEgfpQxyCnxsxsCXwvEBMNE6Th4axi4Tag== X-Received: by 2002:a05:6a20:1d47:b0:b8:6bc8:54c2 with SMTP id cs7-20020a056a201d4700b000b86bc854c2mr663485pzb.32.1675724294028; Mon, 06 Feb 2023 14:58:14 -0800 (PST) Received: from luke-ubuntu.buildd (cpe-75-80-146-43.san.res.rr.com. [75.80.146.43]) by smtp.gmail.com with ESMTPSA id s25-20020aa78bd9000000b00581d62be96dsm7614483pfd.197.2023.02.06.14.58.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 14:58:13 -0800 (PST) From: Luke Nowakowski-Krijger To: kernel-team@lists.ubuntu.com Subject: [SRU][K][PATCH 1/1] selftests/net: Find nettest in current directory Date: Mon, 6 Feb 2023 14:57:33 -0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Daniel Díaz BugLink: https://bugs.launchpad.net/bugs/2006391 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 Signed-off-by: David S. Miller (cherry-picked from commit bd5e1e42826f18147afb0) Signed-off-by: Luke Nowakowski-Krijger --- 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=""