This directory contains the automation scripts for running Linux Kernel Selftests on Qualcomm-based platforms (e.g., RB3GEN2) using the standardized qcom-linux-testkit framework.
The selftest runner (run.sh) is designed to:
- Automatically detect and run enabled kernel selftests using a whitelist file (
enabled_tests.list) - Ensure all required dependencies and directories are present
- Log detailed test results for CI/CD integration
- Support both standalone execution and integration with LAVA/automated test infrastructure
- run.sh: Main test runner script. Executes all tests listed in
enabled_tests.listand produces.resand.runresult files. - enabled_tests.list: Whitelist of test suites or binaries to run (one per line). Supports comments and blank lines.
- Kernel_Selftests.res: Detailed result file, capturing PASS/FAIL/SKIP for each test or subtest.
- Kernel_Selftests.run: Cumulative PASS or FAIL summary, used by CI pipelines for quick parsing.
/kselftestdirectory must be present on the device/target. This is where the selftest binaries are located (usually deployed by the build or CI).- All test scripts must have the executable bit set (
chmod +x run.sh), enforced by GitHub Actions. enabled_tests.listmust exist and contain at least one non-comment, non-blank entry.
-
Environment Setup:
Dynamically locates and sourcesinit_envandfunctestlib.shto ensure robust, path-independent execution. -
Dependency Checks:
- Checks for required commands (e.g.,
find) - Ensures
/kselftestdirectory exists - Validates
enabled_tests.listis present and usable
- Checks for required commands (e.g.,
-
Test Discovery & Execution:
- Parses
enabled_tests.list, ignoring comments and blanks - Supports both directory and subtest (e.g.,
timers/thread_test) entries - Executes test binaries or
run_test.shfor each listed test - Logs individual and summary results
- Parses
-
Result Logging:
- Writes detailed results to
Kernel_Selftests.res - Writes overall PASS/FAIL to
Kernel_Selftests.run
- Writes detailed results to
-
CI Compatibility:
- Designed for direct invocation by LAVA or any CI/CD harness
- Fails early and logs meaningful errors if prerequisites are missing
# This is a comment
timers
thread
timers/thread_test
# Add more test names or subtests as needed
- Each non-comment, non-blank line specifies a test directory or a test binary under
/kselftest.
sh run.shor from a higher-level testkit runner:
./run-test.sh Kernel_Selftests-
Missing executable bit:
If you see permission errors, ensure all scripts arechmod +x. -
Missing
/kselftestdirectory:
Ensure selftests are built and deployed to the target system. -
Missing or empty
enabled_tests.list:
Add test entries as needed. The runner will fail if this file is absent or empty.
- Update
enabled_tests.listas test coverage expands. - Follow the coding and structure conventions enforced by CI (see
CONTRIBUTING.md). - All changes should pass permission checks and shellcheck lints in CI.
SPDX-License-Identifier: BSD-3-ClauseCopyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.