Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH 0/1] selftests: net: use BASH for bareudp testing
@ 2025-10-27  9:57 Po-Hsu Lin
  2025-10-27  9:57 ` [PATCH 1/1] " Po-Hsu Lin
  2025-10-30  1:00 ` [PATCH 0/1] " patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Po-Hsu Lin @ 2025-10-27  9:57 UTC (permalink / raw)
  To: netdev, linux-kselftest, linux-kernel
  Cc: po-hsu.lin, davem, edumazet, kuba, pabeni, horms, shuah,
	edoardo.canepa

The bareudp.sh script uses /bin/sh and it will load another lib.sh
BASH script at the very beginning.

But on some operating systems like Ubuntu, /bin/sh is actually pointed to
DASH, thus it will try to run BASH commands with DASH and consequently
leads to syntax issues.

This patch fixes syntax failures on systems where /bin/sh is not BASH by
explicitily using BASH for bareudp.sh.

Po-Hsu Lin (1):
  selftests: net: use BASH for bareudp testing

 tools/testing/selftests/net/bareudp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/1] selftests: net: use BASH for bareudp testing
  2025-10-27  9:57 [PATCH 0/1] selftests: net: use BASH for bareudp testing Po-Hsu Lin
@ 2025-10-27  9:57 ` Po-Hsu Lin
  2025-10-28 13:58   ` Przemek Kitszel
  2025-10-30  1:00 ` [PATCH 0/1] " patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Po-Hsu Lin @ 2025-10-27  9:57 UTC (permalink / raw)
  To: netdev, linux-kselftest, linux-kernel
  Cc: po-hsu.lin, davem, edumazet, kuba, pabeni, horms, shuah,
	edoardo.canepa

In bareudp.sh, this script uses /bin/sh and it will load another lib.sh
BASH script at the very beginning.

But on some operating systems like Ubuntu, /bin/sh is actually pointed to
DASH, thus it will try to run BASH commands with DASH and consequently
leads to syntax issues:
  # ./bareudp.sh: 4: ./lib.sh: Bad substitution
  # ./bareudp.sh: 5: ./lib.sh: source: not found
  # ./bareudp.sh: 24: ./lib.sh: Syntax error: "(" unexpected

Fix this by explicitly using BASH for bareudp.sh. This fixes test
execution failures on systems where /bin/sh is not BASH.

Reported-by: Edoardo Canepa <edoardo.canepa@canonical.com>
Link: https://bugs.launchpad.net/bugs/2129812
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/net/bareudp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/bareudp.sh b/tools/testing/selftests/net/bareudp.sh
index 4046131e7888..d9e5b967f815 100755
--- a/tools/testing/selftests/net/bareudp.sh
+++ b/tools/testing/selftests/net/bareudp.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
 # Test various bareudp tunnel configurations.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] selftests: net: use BASH for bareudp testing
  2025-10-27  9:57 ` [PATCH 1/1] " Po-Hsu Lin
@ 2025-10-28 13:58   ` Przemek Kitszel
  0 siblings, 0 replies; 4+ messages in thread
From: Przemek Kitszel @ 2025-10-28 13:58 UTC (permalink / raw)
  To: shuah, Po-Hsu Lin, linux-kselftest, kuba
  Cc: davem, edumazet, netdev, pabeni, horms, edoardo.canepa,
	linux-kernel

On 10/27/25 10:57, Po-Hsu Lin wrote:
> In bareudp.sh, this script uses /bin/sh and it will load another lib.sh
> BASH script at the very beginning.
> 
> But on some operating systems like Ubuntu, /bin/sh is actually pointed to
> DASH, thus it will try to run BASH commands with DASH and consequently
> leads to syntax issues:
>    # ./bareudp.sh: 4: ./lib.sh: Bad substitution
>    # ./bareudp.sh: 5: ./lib.sh: source: not found
>    # ./bareudp.sh: 24: ./lib.sh: Syntax error: "(" unexpected
> 
> Fix this by explicitly using BASH for bareudp.sh. This fixes test
> execution failures on systems where /bin/sh is not BASH.
> 
> Reported-by: Edoardo Canepa <edoardo.canepa@canonical.com>
> Link: https://bugs.launchpad.net/bugs/2129812
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---
>   tools/testing/selftests/net/bareudp.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/net/bareudp.sh b/tools/testing/selftests/net/bareudp.sh
> index 4046131e7888..d9e5b967f815 100755
> --- a/tools/testing/selftests/net/bareudp.sh
> +++ b/tools/testing/selftests/net/bareudp.sh
> @@ -1,4 +1,4 @@
> -#!/bin/sh
> +#!/bin/bash
>   # SPDX-License-Identifier: GPL-2.0
>   
>   # Test various bareudp tunnel configurations.

this is of course a correct fix,
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>

what about extending checkpatch to avoid such issues in the future?
I remember at least a few such cases fixes, and I don't pay that much
attention

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] selftests: net: use BASH for bareudp testing
  2025-10-27  9:57 [PATCH 0/1] selftests: net: use BASH for bareudp testing Po-Hsu Lin
  2025-10-27  9:57 ` [PATCH 1/1] " Po-Hsu Lin
@ 2025-10-30  1:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-30  1:00 UTC (permalink / raw)
  To: Po-Hsu Lin
  Cc: netdev, linux-kselftest, linux-kernel, davem, edumazet, kuba,
	pabeni, horms, shuah, edoardo.canepa

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 27 Oct 2025 17:57:09 +0800 you wrote:
> The bareudp.sh script uses /bin/sh and it will load another lib.sh
> BASH script at the very beginning.
> 
> But on some operating systems like Ubuntu, /bin/sh is actually pointed to
> DASH, thus it will try to run BASH commands with DASH and consequently
> leads to syntax issues.
> 
> [...]

Here is the summary with links:
  - [1/1] selftests: net: use BASH for bareudp testing
    https://git.kernel.org/netdev/net/c/9311e9540a8b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-30  1:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-27  9:57 [PATCH 0/1] selftests: net: use BASH for bareudp testing Po-Hsu Lin
2025-10-27  9:57 ` [PATCH 1/1] " Po-Hsu Lin
2025-10-28 13:58   ` Przemek Kitszel
2025-10-30  1:00 ` [PATCH 0/1] " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox