Testing a kernel module
I would proceed as follows:
- Implement your kernel module
- Define an API to let a user-level program test your module, which can be based either on:
- a character device in
/dev/
(where you can define proper ioctls); - a file in
/proc/
(discouraged); - specific system calls (discouraged);
- an entry in
/sys/
- a character device in
- Implement at user-level a program (in case, using a proper framework like CUnit or googletest), which interacts with the kernel module testing the various functionalities
Is it feasible to unit test kernel module code ?
Since Linux kernel version 5.5 KUnit is available. It's a lightweight unit test framework for the kernel.
For more details have a look at
- https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html
- https://kunit.dev/
- https://lwn.net/Articles/780985/
Testing modules/drivers of Linux kernel running in any target board
I doubt that there is any solution exists for this purpose. Each maintainer should test his driver, and how each maintainer does it -- it's up to him. The thing is, it would involve a ton of hardware in order to test all the drivers in kernel.
You are using Panda board, which is OMAP-based board, and the general approach for testing drivers on OMAP-based platforms is to use DDT (Device Driver Test). See DDT at OmapPedia and DDT repository. Btw, you should hurry to clone that DDT repository from Gitorious, because Gitorious is closing in the end of the May and I didn't find any clones of that repo.
Further, if you are interested in running Android on your board, you should run CTS (Compatibility Test Suite).
All that I listed above were used by our testing team when I was working for TI, so I think it should be applicable nowadays as well.
UPDATE
Also I remember that our testers were using this device: phidget. You may need to acquire one for testing purposes.
UPDATE 2
Take a look at Linaro's LKFT (Linux Kernel Functional Test). It's more about testing syscalls from user-space, so maybe not strictly relevant to your question, but still worth mentioning. It runs kselftest (can be found in kernel source code) and LTP project mainly. You can run the same tests for your board. It can be also automated using Jenkins and LAVA.
Related Topics
Kernel Oops Page Fault Error Codes for Arm
How to Get Started with Libsandbox
How to Set Umask Default for an User
"Sort Filename | Uniq" Does Not Work on Large Files
Whole-System Snapshot on Operating System
Bash: Ctrl+C During Input Breaks Current Terminal
Page Fault in Interrupt Context
Systemtap Script to Profile Latency of Functions
How to Launch a Background Process Through a Wrapper That'Ll Undo The Sigint Ignore
How to Get Icecast to Run on Port 80
Downgrade R Version and R Package Bioconductor
Starting Youtrack as a Service Fails Without Error Message
U-Boot: Cannot Boot Linux Kernel Despite Kernel Being Less Than Maximum Bootm_Len
How to Send Integer with Message Queue with Posix API in Linux
How to Generate Files in a Docker Container for Having The Same Owner as The Host's User
Qfiledialog: How to Filter Only Executables (Under Linux)
Accidentally Deleted Symlink Libc.So.6 in Centos 6.4. How to Get Sudo Privilege to Re-Create It