Skip to content

selftests, sysctl, lib: Fix prime_numbers and sysctl test to run

Masami Hiramatsu linux-kselftest lkml 1 version In review

Get series with b4
b4 am 159067751438.229397.6746886115540895104.stgit@devnote2

Versions newest first

  1. v1 Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4lib: Make prime number generator independently selectablelib/math/Kconfig+6 -13 replies
2/4lib: Make test_sysctl initialized as modulelib/test_sysctl.c+1 -12 replies
3/4selftests/sysctl: Fix to load test_sysctl moduletools/testing/selftests/sysctl/sysctl.sh+2 -112 replies
4/4selftests/sysctl: Make sysctl test driver as a moduletools/testing/selftests/sysctl/config+1 -12 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchKees CookLuis Chamberlain
1/4R-b R-b
2/4R-b
3/4R-b R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] selftests, sysctl, lib: Fix prime_numbers and sysctl test to run

Hi,

Recently, I found some tests were always skipped. Here is a series of patches to fix those issues.

The prime_numbers test is skipped in some cases because prime_numbers.ko is not always compiled.
Since the CONFIG_PRIME_NUMBERS is not independently configurable item (it has no title and help), it is enabled only if other configs (DRM_DEBUG_SELFTEST etc.) select it.

To fix this issue, I added a title and help for CONFIG_PRIME_NUMBERS.

The sysctl test is skipped because
- selftests/sysctl/config requires CONFIG_TEST_SYSCTL=y. But since lib/test_sysctl.c doesn't use module_init(), the test_syscall is not listed under /sys/module/ and the test script gives up.
- Even if we make CONFIG_TEST_SYSCTL=m, the test script checks /sys/modules/test_sysctl before loading module and gives up.
- Ayway, since the test module introduces useless sysctl interface to the kernel, it would better be a module.

This series includes fixes for above 3 points.
- Fix lib/test_sysctl.c to use module_init()
- Fix tools/testing/selftests/sysctl/sysctl.sh to try to load test module if it is not loaded (nor embedded).
- Fix tools/testing/selftests/sysctl/config to require CONFIG_TEST_SYSCTL=m, not y.

Thank you,

---

Masami Hiramatsu (4):
lib: Make prime number generator independently selectable
lib: Make test_sysctl initialized as module selftests/sysctl: Fix to load test_sysctl module selftests/sysctl: Make sysctl test driver as a module

 lib/math/Kconfig                         |    7 ++++++-
 lib/test_sysctl.c                        |    2 +-
 tools/testing/selftests/sysctl/config    |    2 +-
 tools/testing/selftests/sysctl/sysctl.sh |   13 ++-----------
 4 files changed, 10 insertions(+), 14 deletions(-)

--
Masami Hiramatsu (Linaro) <[email protected]>