mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-05 14:16:03 +00:00
The test is currently not hooked up, but it pulls the latest 4.9.x kernel image, builds a simple kernel module against it and then creates a test package containing the kernel module and a shell script. The shell script prints out the 'modinfo' and then tries to 'insmod' the module. It checks the output of 'dmesg' of the load succeeded. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
16 lines
314 B
Bash
Executable File
16 lines
314 B
Bash
Executable File
#!/bin/sh
|
|
function failed {
|
|
printf "Kernel module test suite FAILED\n"
|
|
/sbin/poweroff -f
|
|
}
|
|
|
|
uname -a
|
|
modinfo hello_world.ko || failed
|
|
insmod hello_world.ko || failed
|
|
[ -n "$(dmesg | grep -o 'Hello LinuxKit')" ] || failed
|
|
rmmod hello_world || failed
|
|
|
|
printf "Kernel module test suite PASSED\n"
|
|
|
|
/sbin/poweroff -f
|