Message ID | 20220908120146.381218-1-ykaliuta@redhat.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 272d1f4cfa3c75d4828b62ef33ccb207da3b7350 |
Delegated to: | BPF |
Headers | show |
Series | [bpf-next,v3] selftests: bpf: test_kmod.sh: pass parameters to the module | expand |
Hello: This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <andrii@kernel.org>: On Thu, 8 Sep 2022 15:01:46 +0300 you wrote: > It's possible to specify particular tests for test_bpf.ko with > module parameters. Make it possible to pass the module parameters, > example: > > test_kmod.sh test_range=1,3 > > Since magnitude tests take long time it can be reasonable to skip > them. > > [...] Here is the summary with links: - [bpf-next,v3] selftests: bpf: test_kmod.sh: pass parameters to the module https://git.kernel.org/bpf/bpf-next/c/272d1f4cfa3c You are awesome, thank you!
diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh index 4f6444bcd53f..d4a4279c0181 100755 --- a/tools/testing/selftests/bpf/test_kmod.sh +++ b/tools/testing/selftests/bpf/test_kmod.sh @@ -1,6 +1,11 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 +# Usage: +# ./test_kmod.sh [module_param]... +# Ex.: ./test_kmod.sh test_range=1,3 +# All the parameters are passed to the kernel module. + # Kselftest framework requirement - SKIP code is 4. ksft_skip=4 @@ -26,15 +31,15 @@ test_run() echo "[ JIT enabled:$1 hardened:$2 ]" dmesg -C 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 if [ $? -ne 0 ]; then rc=1 fi else # Use modprobe dry run to check for missing test_bpf module - if ! /sbin/modprobe -q -n test_bpf; then + if ! /sbin/modprobe -q -n test_bpf "$@"; then echo "test_bpf: [SKIP]" - elif /sbin/modprobe -q test_bpf; then + elif /sbin/modprobe -q test_bpf "$@"; then echo "test_bpf: ok" else echo "test_bpf: [FAIL]"
It's possible to specify particular tests for test_bpf.ko with module parameters. Make it possible to pass the module parameters, example: test_kmod.sh test_range=1,3 Since magnitude tests take long time it can be reasonable to skip them. Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com> --- v2->v3: add usage comment. v1->v2: pass all the parameters, "$@", not only the first one. --- tools/testing/selftests/bpf/test_kmod.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)