All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests: bpf: test_kmod.sh: fix passing arguments via function
@ 2022-09-26  9:23 Yauheni Kaliuta
  2022-09-27 14:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Yauheni Kaliuta @ 2022-09-26  9:23 UTC (permalink / raw)
  To: bpf; +Cc: andrii, liuhangbin, Yauheni Kaliuta

Since the tests are run in a function $@ there actually contains
function arguments, not the script ones.

Pass "$@" to the function as well.

Fixes: 272d1f4cfa3c ("selftests: bpf: test_kmod.sh: Pass parameters to the module")
Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
---

I have to admit that I messed up with testing of the last test_kmod.sh
patch and it paid immediatly. Feeling really ashamed.

---
 tools/testing/selftests/bpf/test_kmod.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh
index d4a4279c0181..50dca53ac536 100755
--- a/tools/testing/selftests/bpf/test_kmod.sh
+++ b/tools/testing/selftests/bpf/test_kmod.sh
@@ -29,6 +29,7 @@ test_run()
 	sysctl -w net.core.bpf_jit_harden=$2 2>&1 > /dev/null
 
 	echo "[ JIT enabled:$1 hardened:$2 ]"
+	shift 2
 	dmesg -C
 	if [ -f ${OUTPUT}/lib/test_bpf.ko ]; then
 		insmod ${OUTPUT}/lib/test_bpf.ko "$@" 2> /dev/null
@@ -64,9 +65,9 @@ test_restore()
 
 rc=0
 test_save
-test_run 0 0
-test_run 1 0
-test_run 1 1
-test_run 1 2
+test_run 0 0 "$@"
+test_run 1 0 "$@"
+test_run 1 1 "$@"
+test_run 1 2 "$@"
 test_restore
 exit $rc
-- 
2.37.3


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

* Re: [PATCH bpf-next] selftests: bpf: test_kmod.sh: fix passing arguments via function
  2022-09-26  9:23 [PATCH bpf-next] selftests: bpf: test_kmod.sh: fix passing arguments via function Yauheni Kaliuta
@ 2022-09-27 14:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-27 14:00 UTC (permalink / raw)
  To: Yauheni Kaliuta; +Cc: bpf, andrii, liuhangbin

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Mon, 26 Sep 2022 12:23:20 +0300 you wrote:
> Since the tests are run in a function $@ there actually contains
> function arguments, not the script ones.
> 
> Pass "$@" to the function as well.
> 
> Fixes: 272d1f4cfa3c ("selftests: bpf: test_kmod.sh: Pass parameters to the module")
> Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
> 
> [...]

Here is the summary with links:
  - [bpf-next] selftests: bpf: test_kmod.sh: fix passing arguments via function
    https://git.kernel.org/bpf/bpf-next/c/2702c789996d

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] 2+ messages in thread

end of thread, other threads:[~2022-09-27 14:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26  9:23 [PATCH bpf-next] selftests: bpf: test_kmod.sh: fix passing arguments via function Yauheni Kaliuta
2022-09-27 14:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.