Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5500191rdb; Sun, 31 Dec 2023 04:17:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZeEFSJHRayGsQUUdiN7JbEi2z3nmZ2OCLTorHWzFw/cQLxuJAG8JMG8+72vu6UtTo/ciu X-Received: by 2002:a05:6359:4c1c:b0:170:e930:bd3 with SMTP id kj28-20020a0563594c1c00b00170e9300bd3mr15022566rwc.32.1704025049072; Sun, 31 Dec 2023 04:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704025049; cv=none; d=google.com; s=arc-20160816; b=MIG6+Z2asH4LKLF/5eF99mTGZZ9zQKQa1FJk1Th+of0m7/77dlrjiVYlSF+16dKbP9 GZsIVBDhsXwzvVNwyoDoWm6LXfEFqtfCcZnOyBHg9RE5RzEsv2UL8hWkMJvms8CyGj/O qns+doULsqNbjavGH3a6PrzJVHpzulsSUite8S7YPU9OusTCotcLWXfLHvzha8coZodA 6MzZGOgvhx8fcMPhDzQhmXdf9tMyqSnkFAjDIO01kMqhUB7q429qwLUsgTfVCS5bNhKd GtSdph8NHxbRDe12EWnn2iPrFEWjsQE8JrQQgVYrkJkjtmfPSbPpuIbuBZwDQSxXKIaJ uJ9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=adPJVxO7TfBjcBAzSxJW6gA78OICpm0oYZHYg9+yj2U=; fh=tWs2ZJUV5A/vZlrLn/ilbzGK5uU751b0sx+sAIdH1OQ=; b=FHEX0I2W28z6u8Ru3H6a1eDr9nGqqRfRfFTXI0qz+cVmJXIuOjHJfxdmbIopxRRvuk Ludd6tQv/JBbRjnb7gM4HQ9jReBjFI4/NhRcVGhLmCs29zaf7TgUYztGbibTBp7bFvEl J4zLk+Hav2UjN7jhzIjb4uZOFU+HEGkM8HDqb0VLYqIA3Cdz5KsXSj1SzkKanOKDaG1k sv2li+bjU8DqhyIIyImFzmvjXdJyFpRTb/jjE9yXHO4t2fAFnfnboDuCeURcPQa9z41m Uq1vngjVe9n3mENZZcSNCCdevErMUN7KaB5vkAKSokuoN566FXDpgZQoeO3alvObLYJA SL3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OOaOR2kz; spf=pass (google.com: domain of linux-kernel+bounces-13702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r14-20020aa7988e000000b006d9d7c6b392si9079024pfl.270.2023.12.31.04.17.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 04:17:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OOaOR2kz; spf=pass (google.com: domain of linux-kernel+bounces-13702-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13702-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A4EEA281FAA for ; Sun, 31 Dec 2023 12:17:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3222833EE; Sun, 31 Dec 2023 12:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OOaOR2kz" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B04125390 for ; Sun, 31 Dec 2023 12:17:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704025037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=adPJVxO7TfBjcBAzSxJW6gA78OICpm0oYZHYg9+yj2U=; b=OOaOR2kzUz3iZyfTeo634m2LlbVa08kVZJb2wJn8HU9pxe7ZM58gQBBtKwQszRjwro3red Th+Z0ob2QwgucctUay2svh7PRPhHfstV2yu/DkTjBpsDIWaMhnDt9TbAow3bgKFGu322E5 7Q7MS4Z7wVJ+a2eZ+FPLnE2s02DeEQ8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-371-gmQAzOf9PeuhmxowWMXTiA-1; Sun, 31 Dec 2023 07:17:16 -0500 X-MC-Unique: gmQAzOf9PeuhmxowWMXTiA-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-40d5ab2fbc9so37500065e9.3 for ; Sun, 31 Dec 2023 04:17:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704025035; x=1704629835; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=adPJVxO7TfBjcBAzSxJW6gA78OICpm0oYZHYg9+yj2U=; b=tcfXe9lLbYOsdXZwre0Ex+TznRmT34Fm5O2LVH1nWGdE70Of8s/cdZFvw+lrqWx8yY OEjl5ehs5IhHwVyWvDJ/O/vW0eC5ISNlpRZYsdK6xi4p2LlFJm7T6fFHa6l7wyCUg7JA rEbGYsskPCqI4Tl1hJ4bZqRq93o7fyrSv+93iNeouWuRHBSkkM+hWRuHfgJ6fShqSKOy Fh1n2LY8ZoqiB3DGN1smghqZ09/9DvMh6JNuYv2u6A8EQpgA5R064MfOr8+vby9bwlqD z2XrC7s3EVOGTz63YFpa7tXhopHo+uJwro920kn3NDqAqu6mfyzhIHLV7VRVNPr0bXT8 0NQw== X-Gm-Message-State: AOJu0YxHTFl8Yfm4QwbO8b+TNLm1VOiy6DyNINzL8G1dLdHID+KszVHp cB/JkO1RoPh/ROyLJCQEm+2R4Kn2l2CSJatompdbgfifomFtg7tYs1Vwp7lyU+Mr2ZpGI3kjg/r oBRvUNuNfjJFMP1BJbnbiBgDi7n64cy7z X-Received: by 2002:a05:600c:1709:b0:40d:3d98:3747 with SMTP id c9-20020a05600c170900b0040d3d983747mr7936487wmn.121.1704025034865; Sun, 31 Dec 2023 04:17:14 -0800 (PST) X-Received: by 2002:a05:600c:1709:b0:40d:3d98:3747 with SMTP id c9-20020a05600c170900b0040d3d983747mr7936482wmn.121.1704025034585; Sun, 31 Dec 2023 04:17:14 -0800 (PST) Received: from debian (2a01cb058918ce00b14e8593d3a1c390.ipv6.abo.wanadoo.fr. [2a01:cb05:8918:ce00:b14e:8593:d3a1:c390]) by smtp.gmail.com with ESMTPSA id g14-20020a05600c310e00b0040d6eb862a7sm11145610wmo.41.2023.12.31.04.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Dec 2023 04:17:13 -0800 (PST) Date: Sun, 31 Dec 2023 13:17:11 +0100 From: Guillaume Nault To: Yujie Liu Cc: netdev@vger.kernel.org, Hangbin Liu , Paolo Abeni , David Ahern , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, lkp@intel.com, kernel test robot Subject: Re: [PATCH v2 net-next] selftests/net: change shebang to bash to support "source" Message-ID: References: <20231229131931.3961150-1-yujie.liu@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231229131931.3961150-1-yujie.liu@intel.com> On Fri, Dec 29, 2023 at 09:19:31PM +0800, Yujie Liu wrote: > The patch set [1] added a general lib.sh in net selftests, and converted > several test scripts to source the lib.sh. > > unicast_extensions.sh (converted in [1]) and pmtu.sh (converted in [2]) > have a /bin/sh shebang which may point to various shells in different > distributions, but "source" is only available in some of them. For > example, "source" is a built-it function in bash, but it cannot be > used in dash. > > Refer to other scripts that were converted together, simply change the > shebang to bash to fix the following issues when the default /bin/sh > points to other shells. Looks like it'd be simpler to just replace the "source" commands with "." and leave the shebang as is (unless there are other bash-specific constructs in these scripts of course). Generally speaking, I think we should avoid madating a specific shell, unless that really simplifies the test script (which is not the case here). > # selftests: net: unicast_extensions.sh > # ./unicast_extensions.sh: 31: source: not found > # ########################################################################### > # Unicast address extensions tests (behavior of reserved IPv4 addresses) > # ########################################################################### > # TEST: assign and ping within 240/4 (1 of 2) (is allowed) [FAIL] > # TEST: assign and ping within 240/4 (2 of 2) (is allowed) [FAIL] > # TEST: assign and ping within 0/8 (1 of 2) (is allowed) [FAIL] > # TEST: assign and ping within 0/8 (2 of 2) (is allowed) [FAIL] > # TEST: assign and ping inside 255.255/16 (is allowed) [FAIL] > # TEST: assign and ping inside 255.255.255/24 (is allowed) [FAIL] > # TEST: route between 240.5.6/24 and 255.1.2/24 (is allowed) [FAIL] > # TEST: route between 0.200/16 and 245.99/16 (is allowed) [FAIL] > # TEST: assign and ping lowest address (/24) [FAIL] > # TEST: assign and ping lowest address (/26) [FAIL] > # TEST: routing using lowest address [FAIL] > # TEST: assigning 0.0.0.0 (is forbidden) [ OK ] > # TEST: assigning 255.255.255.255 (is forbidden) [ OK ] > # TEST: assign and ping inside 127/8 (is forbidden) [ OK ] > # TEST: assign and ping class D address (is forbidden) [ OK ] > # TEST: routing using class D (is forbidden) [ OK ] > # TEST: routing using 127/8 (is forbidden) [ OK ] > not ok 51 selftests: net: unicast_extensions.sh # exit=1 > > v1 -> v2: > - Fix pmtu.sh which has the same issue as unicast_extensions.sh, > suggested by Hangbin > - Change the style of the "source" line to be consistent with other > tests, suggested by Hangbin > > Link: https://lore.kernel.org/all/20231202020110.362433-1-liuhangbin@gmail.com/ [1] > Link: https://lore.kernel.org/all/20231219094856.1740079-1-liuhangbin@gmail.com/ [2] > Reported-by: kernel test robot > Signed-off-by: Yujie Liu > --- > tools/testing/selftests/net/pmtu.sh | 4 ++-- > tools/testing/selftests/net/unicast_extensions.sh | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh > index 175d3d1d773b..f10879788f61 100755 > --- a/tools/testing/selftests/net/pmtu.sh > +++ b/tools/testing/selftests/net/pmtu.sh > @@ -1,4 +1,4 @@ > -#!/bin/sh > +#!/bin/bash > # SPDX-License-Identifier: GPL-2.0 > # > # Check that route PMTU values match expectations, and that initial device MTU > @@ -198,7 +198,7 @@ > # - pmtu_ipv6_route_change > # Same as above but with IPv6 > > -source ./lib.sh > +source lib.sh > > PAUSE_ON_FAIL=no > VERBOSE=0 > diff --git a/tools/testing/selftests/net/unicast_extensions.sh b/tools/testing/selftests/net/unicast_extensions.sh > index b7a2cb9e7477..f52aa5f7da52 100755 > --- a/tools/testing/selftests/net/unicast_extensions.sh > +++ b/tools/testing/selftests/net/unicast_extensions.sh > @@ -1,4 +1,4 @@ > -#!/bin/sh > +#!/bin/bash > # SPDX-License-Identifier: GPL-2.0 > # > # By Seth Schoen (c) 2021, for the IPv4 Unicast Extensions Project > @@ -28,7 +28,7 @@ > # These tests provide an easy way to flip the expected result of any > # of these behaviors for testing kernel patches that change them. > > -source ./lib.sh > +source lib.sh > > # nettest can be run from PATH or from same directory as this selftest > if ! which nettest >/dev/null; then > > base-commit: cd4d7263d58ab98fd4dee876776e4da6c328faa3 > -- > 2.34.1 > >