Commit 2702c789 authored by Yauheni Kaliuta's avatar Yauheni Kaliuta Committed by Daniel Borkmann

selftests/bpf: Fix passing arguments via function in test_kmod.sh

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

Pass "$@" to the function as well.

Fixes: 272d1f4c ("selftests: bpf: test_kmod.sh: Pass parameters to the module")
Signed-off-by: default avatarYauheni Kaliuta <ykaliuta@redhat.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220926092320.564631-1-ykaliuta@redhat.com
parent 6a4ab886
...@@ -29,6 +29,7 @@ test_run() ...@@ -29,6 +29,7 @@ test_run()
sysctl -w net.core.bpf_jit_harden=$2 2>&1 > /dev/null sysctl -w net.core.bpf_jit_harden=$2 2>&1 > /dev/null
echo "[ JIT enabled:$1 hardened:$2 ]" echo "[ JIT enabled:$1 hardened:$2 ]"
shift 2
dmesg -C dmesg -C
if [ -f ${OUTPUT}/lib/test_bpf.ko ]; then if [ -f ${OUTPUT}/lib/test_bpf.ko ]; then
insmod ${OUTPUT}/lib/test_bpf.ko "$@" 2> /dev/null insmod ${OUTPUT}/lib/test_bpf.ko "$@" 2> /dev/null
...@@ -64,9 +65,9 @@ test_restore() ...@@ -64,9 +65,9 @@ test_restore()
rc=0 rc=0
test_save test_save
test_run 0 0 test_run 0 0 "$@"
test_run 1 0 test_run 1 0 "$@"
test_run 1 1 test_run 1 1 "$@"
test_run 1 2 test_run 1 2 "$@"
test_restore test_restore
exit $rc exit $rc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment