Skip to content

landlock-lsm/landlock-test-tools

Repository files navigation

Landlock test tools

This repository is a collection of scripts and configurations to easily test various Landlock kernels thanks to User-Mode Linux (UML).

To make tests quick, interesting kernels are stored in kernels/artifacts and built with the kernels/make-uml.sh script.

uml-run.sh can be used to launch an UML kernel with an init test script.

docker-run

Build a container to build the kernel, samples, tests and check everything for Landlock.

Required installed and configured software: docker and optionally docker-buildx.

git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux
.../docker-run.sh debian/sid

check-linux

Build the kernel, samples, tests and check everything for Landlock.

cd linux
.../check-linux.sh build kselftest kunit

To run all checks:

.../check-linux.sh all

To check on a virtual machine and get test coverage

ARCH=x86_64 .../check-linux.sh build_light kselftest

Optional dependencies

In order to test more filesystems, these commands should be installed:

To build and test against an x86_64 architecture, these commands should be installed:

To run check-linux.sh lint, we need to install Smatch.

rust-landlock

test-rust.sh can be used to test the Landlock crate against a specific kernel version:

cd rust-landlock
.../test-rust.sh linux-6.1 2

About

Landlock test tools

Topics

Resources

License

Stars

Watchers

Forks

Contributors