From: Björn Töpel <hidden> Date: 2021-02-06 09:28:00
From: Björn Töpel <redacted>
The test_xdp_redirect.sh script uses a bash redirect feature,
'&>/dev/null'. Use '>/dev/null 2>&1' 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.
Acked-by: William Tu <redacted>
Fixes: 996139e801fd ("selftests: bpf: add a test for XDP redirect")
Signed-off-by: Björn Töpel <redacted>
---
William, I kept your Acked-by.
v2: Kept /bin/sh and removed bashisms. (Randy)
---
tools/testing/selftests/bpf/test_xdp_redirect.sh | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
From: Randy Dunlap <hidden> Date: 2021-02-06 16:27:16
On 2/6/21 1:26 AM, Björn Töpel wrote:
From: Björn Töpel <redacted>
The test_xdp_redirect.sh script uses a bash redirect feature,
'&>/dev/null'. Use '>/dev/null 2>&1' 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.
Acked-by: William Tu <redacted>
Fixes: 996139e801fd ("selftests: bpf: add a test for XDP redirect")
Signed-off-by: Björn Töpel <redacted>
Acked-by: Randy Dunlap <redacted>
Thanks.
quoted hunk
---
William, I kept your Acked-by.
v2: Kept /bin/sh and removed bashisms. (Randy)
---
tools/testing/selftests/bpf/test_xdp_redirect.sh | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
On Sat, Feb 6, 2021 at 1:29 AM Björn Töpel [off-list ref] wrote:
From: Björn Töpel <redacted>
The test_xdp_redirect.sh script uses a bash redirect feature,
'&>/dev/null'. Use '>/dev/null 2>&1' instead.
We have plenty of explicit bash uses in selftest scripts, I'm not sure
it's a good idea to make scripts more verbose.
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.
This sounds like a dubious decision. The script checks return results
only of last two commands, for which it's better to write and if
[<first command>] && [<second command>] check and leave set -e intact.
quoted hunk
Acked-by: William Tu <redacted>
Fixes: 996139e801fd ("selftests: bpf: add a test for XDP redirect")
Signed-off-by: Björn Töpel <redacted>
---
William, I kept your Acked-by.
v2: Kept /bin/sh and removed bashisms. (Randy)
---
tools/testing/selftests/bpf/test_xdp_redirect.sh | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
From: Björn Töpel <hidden> Date: 2021-02-09 06:42:33
On 2021-02-09 06:52, Andrii Nakryiko wrote:
On Sat, Feb 6, 2021 at 1:29 AM Björn Töpel [off-list ref] wrote:
quoted
From: Björn Töpel <redacted>
The test_xdp_redirect.sh script uses a bash redirect feature,
'&>/dev/null'. Use '>/dev/null 2>&1' instead.
We have plenty of explicit bash uses in selftest scripts, I'm not sure
it's a good idea to make scripts more verbose.
$ cd tools/testing/selftests
$ git grep '\#!/bin/bash'|wc -l
282
$ git grep '\#!/bin/sh'|wc -l
164
Andrii/Randy, I'm fine with whatever. I just want to be able to run the
test on Debian-derived systems. ;-)
quoted
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.
This sounds like a dubious decision. The script checks return results
only of last two commands, for which it's better to write and if
[<first command>] && [<second command>] check and leave set -e intact.
Ok!
Please decide on the shell flavor, and I'll respin a v3.
Björn
From: Randy Dunlap <hidden> Date: 2021-02-09 06:56:01
On 2/8/21 10:41 PM, Björn Töpel wrote:
On 2021-02-09 06:52, Andrii Nakryiko wrote:
quoted
On Sat, Feb 6, 2021 at 1:29 AM Björn Töpel [off-list ref] wrote:
quoted
From: Björn Töpel <redacted>
The test_xdp_redirect.sh script uses a bash redirect feature,
'&>/dev/null'. Use '>/dev/null 2>&1' instead.
We have plenty of explicit bash uses in selftest scripts, I'm not sure
it's a good idea to make scripts more verbose.
$ cd tools/testing/selftests
$ git grep '\#!/bin/bash'|wc -l
282
$ git grep '\#!/bin/sh'|wc -l
164
Andrii/Randy, I'm fine with whatever. I just want to be able to run the
test on Debian-derived systems. ;-)
quoted
quoted
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.
This sounds like a dubious decision. The script checks return results
only of last two commands, for which it's better to write and if
[<first command>] && [<second command>] check and leave set -e intact.
Ok!
Please decide on the shell flavor, and I'll respin a v3.
In general shell scripts in the kernel try not to use bash (we have taken
several patches to convert from /bin/bash to /bin/sh scripts).
OTOH, perf and bpf seem to be large exceptions to this trend,
so it is apparently OK to use bash. :)
Sorry to sidetrack you.
--
~Randy