selftests/bpf: use bash instead of sh in test_xdp_redirect.sh
Subsystems (6)
PATCH 1/1 selftests/bpf: use bash instead of sh in test_xdp_redirect.sh
From: Björn Töpel <[email protected]>
The test_xdp_redirect.sh script uses some bash-features, such as '&>'. On systems that use dash as the sh implementation this will not work as intended. Change the shebang to use bash instead.
Also remove the 'set -e' since the script actually relies on that the return value can be used to determine pass/fail of the test.
--- tools/testing/selftests/bpf/test_xdp_redirect.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/test_xdp_redirect.sh +1 -2
@@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Create 2 namespaces with two veth peers, and # forward packets in-between using generic XDP #
@@ -72,7 +72,6 @@ test_xdp_redirect() cleanup } -set -e trap cleanup 2 3 6 9 test_xdp_redirect xdpgeneric
base-commit: 6183f4d3a0a2ad230511987c6c362ca43ec0055f
Signature · 1 line
2.27.0
Quoted 7 lines · Björn Töpel
From: Björn Töpel <[email protected]>
The
test_xdp_redirect.shscript uses some bash-features, such as '&>'. On systems that use dash as the sh implementation this will not work as intended. Change the shebang to use bash instead.
Quoted 6 lines
Also remove the 'set -e' since the script actually relies on that the return value can be used to determine pass/fail of the test.
Fixes 996139e801fd ("selftests: bpf: add a test for XDP redirect")Signed-off-by Björn Töpel <[email protected]>---
LGTM, thanks.
Quoted 7 lines · William Tu
Quoted 6 lines · Björn Töpel
From: Björn Töpel <[email protected]>
The
test_xdp_redirect.shscript uses some bash-features, such as '&>'. On systems that use dash as the sh implementation this will not work as intended. Change the shebang to use bash instead.
Hi,
In general we (kernel, maybe not bpf) try to move away from bash to a more "standard" sh shell, so things like "&>" would be converted to ">file 2>&1" or whatever is needed.
Quoted 9 lines
Quoted 6 lines
Also remove the 'set -e' since the script actually relies on that the return value can be used to determine pass/fail of the test.
Fixes 996139e801fd ("selftests: bpf: add a test for XDP redirect")Signed-off-by Björn Töpel <[email protected]>---
LGTM, thanks.
Acked-by William Tu <[email protected]>
Signature · 1 line
~Randy
Quoted 6 lines · Randy Dunlap
Quoted 4 lines · William Tu
Quoted 3 lines · Björn Töpel
From: Björn Töpel <[email protected]>
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
The
test_xdp_redirect.shscript uses some bash-features, such as '&>'. On systems that use dash as the sh implementation this will not work as intended. Change the shebang to use bash instead.Hi,
In general we (kernel, maybe not bpf) try to move away from bash to a more "standard" sh shell, so things like "&>" would be converted to ">file 2>&1" or whatever is needed.
Ok! I'll respin!
Björn