All Projects → oracle → Ktf

oracle / Ktf

Licence: other
Kernel Test Framework - a unit test framework for the Linux kernel

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Ktf

Kakao
Nice and simple DSL for Espresso in Kotlin
Stars: ✭ 1,109 (+1269.14%)
Mutual labels:  testing-framework
Toaru Nih
NOTICE: The ToaruOS-NIH Project has been MERGED UPSTREAM. This repository is now archived.
Stars: ✭ 66 (-18.52%)
Mutual labels:  kernel
Tomatos
A 64bit tomato kernel
Stars: ✭ 75 (-7.41%)
Mutual labels:  kernel
Sutekh
An example rootkit that gives a userland process root permissions
Stars: ✭ 62 (-23.46%)
Mutual labels:  kernel
Bigtest
Tests that speed up development, not slow it down
Stars: ✭ 64 (-20.99%)
Mutual labels:  testing-framework
Binderfilter
A Linux kernel IPC firewall and logger for Android and Binder
Stars: ✭ 70 (-13.58%)
Mutual labels:  kernel
Cs140e
CS140e without Rust is not CS140e. Sergio Benitez plz come back.
Stars: ✭ 57 (-29.63%)
Mutual labels:  kernel
Zeke
A POSIX-like OS for ARM processors.
Stars: ✭ 79 (-2.47%)
Mutual labels:  kernel
Simplefs
A simple file system for Linux kernel
Stars: ✭ 65 (-19.75%)
Mutual labels:  kernel
Darwin Xnu
The Darwin Kernel (mirror). This repository is a pure mirror and contributions are currently not accepted via pull-requests, please submit your contributions via https://developer.apple.com/bug-reporting/
Stars: ✭ 9,504 (+11633.33%)
Mutual labels:  kernel
Wnfun
WNF Utilities 4 Newbies (WNFUN)
Stars: ✭ 63 (-22.22%)
Mutual labels:  kernel
Shadow Box For Arm
Shadow-Box: Lightweight and Practical Kernel Protector for ARM (Presented at BlackHat Asia 2018)
Stars: ✭ 64 (-20.99%)
Mutual labels:  kernel
Sparrow
My Operating System.
Stars: ✭ 71 (-12.35%)
Mutual labels:  kernel
Oneos
oneOS
Stars: ✭ 60 (-25.93%)
Mutual labels:  kernel
Ntphp
Ever wanted to execute PHP in your kernel driver? Look no further!
Stars: ✭ 76 (-6.17%)
Mutual labels:  kernel
Memstrack
A memory allocation tracer combined with stack trace.
Stars: ✭ 60 (-25.93%)
Mutual labels:  kernel
Linux
Armbian kernel mirrors
Stars: ✭ 66 (-18.52%)
Mutual labels:  kernel
Deos
The distributed exokernel operating system
Stars: ✭ 80 (-1.23%)
Mutual labels:  kernel
Webboot
Tools to let a u-root instance boot signed live distro images over the web
Stars: ✭ 78 (-3.7%)
Mutual labels:  kernel
Harmonyos
鸿蒙系统资料。Docs about HarmonyOS.
Stars: ✭ 1,191 (+1370.37%)
Mutual labels:  kernel

Kernel Test Framework (KTF)

KTF is a Google Test-like environment for writing C unit tests for kernel code. Tests are implemented as kernel modules which declare each test as part of a test case. The body of each test case consists of assertions. Tests look like this:

TEST(examples, hello_ok)
{
	EXPECT_TRUE(true);
}

"examples" is the test case name, "hello_ok" the test. KTF provides many different types of assertions, see kernel/ktf.h for the complete list.

Usually tests are added on test module init via

ADD_TEST(test_name);

This registers the test with the KTF framework for later execution. There are many examples in the examples/ directory.

"ktfrun" is provided to execute tests, it communicates with the KTF kernel module via netlink socket to query available tests and trigger test execution.

The design priorities for KTF are to make it

  • easy to run tests. Just ensure the ktf module is loaded, then load your test module and execute "ktfrun".

  • easy to interpret results. Output from ktfrun is clear and can be filtered easily. Assertion failures indicate the line of code where the failure occurred. Results of the last test run are always available from /sys/kernel/debug/ktf/results/

  • easy to add tests. Adding a test takes a few lines of code. Just (re)build the test module, unload/reload and KTF can run the test. See the examples/ directory for some hints.

  • easy to analyse test behaviour (code coverage, memory utilization during test execution). We provide "ktfcov" to support enabling coverage support on a per-module basis. Coverage data is available in /sys/kernel/debug/ktf/coverage, showing how often functions were called during the coverage period, and optionally any outstanding memory allocations originating from functions that were subject to coverage.

All of the above will hopefully help Linux kernel engineers practice continuous integration and more thoroughly unit test their code.

User Documentation

See ./doc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].