summaryrefslogtreecommitdiff
path: root/lib/tests
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2024-11-27 19:06:03 -0800
committerLuis Chamberlain <mcgrof@kernel.org>2024-11-28 11:17:30 -0800
commit3e1d95b63c97506d0d98c75fc72a60662981a3c6 (patch)
treec70eb67aa5aa7719e5f8745b0e43c3ebb260aa06 /lib/tests
parent7ea13556f7d287fb55f7cacc316ff7647550c702 (diff)
selftests: kallsyms: fix and clarify current test boundaries
Provide and clarify the existing ranges and what you should expect. Fix the gen_test_kallsyms.sh script to accept different ranges. Fixes: 84b4a51fce4ccc66 ("selftests: add new kallsyms selftests") Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Diffstat (limited to 'lib/tests')
-rwxr-xr-xlib/tests/module/gen_test_kallsyms.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/tests/module/gen_test_kallsyms.sh b/lib/tests/module/gen_test_kallsyms.sh
index 3f2c626350ad..561dcac0f359 100755
--- a/lib/tests/module/gen_test_kallsyms.sh
+++ b/lib/tests/module/gen_test_kallsyms.sh
@@ -7,6 +7,11 @@ NUM_SYMS=$2
SCALE_FACTOR=$3
TEST_TYPE=$(echo $TARGET | sed -e 's|lib/tests/module/test_kallsyms_||g')
TEST_TYPE=$(echo $TEST_TYPE | sed -e 's|.c||g')
+FIRST_B_LOOKUP=1
+
+if [[ $NUM_SYMS -gt 2 ]]; then
+ FIRST_B_LOOKUP=$((NUM_SYMS/2))
+fi
gen_template_module_header()
{
@@ -52,10 +57,10 @@ ____END_MODULE
gen_template_module_data_b()
{
- printf "\nextern int auto_test_a_%010d;\n\n" 28
+ printf "\nextern int auto_test_a_%010d;\n\n" $FIRST_B_LOOKUP
echo "static int auto_runtime_test(void)"
echo "{"
- printf "\nreturn auto_test_a_%010d;\n" 28
+ printf "\nreturn auto_test_a_%010d;\n" $FIRST_B_LOOKUP
echo "}"
}