Commit fdcfbd9a authored by Andrew Jones's avatar Andrew Jones Committed by Radim Krčmář
Browse files

README: add section on guarding unsafe tests

Signed-off-by: Andrew Jones's avatarAndrew Jones <>
Reviewed-by: default avatarLaurent Vivier <>
Signed-off-by: default avatarRadim Krčmář <>
parent c346a8e0
......@@ -71,6 +71,40 @@ Additionally these self-explanatory variables are reserved
# Guarding unsafe tests
Some tests are not safe to run by default, as they may crash the
host. kvm-unit-tests provides two ways to handle tests like those.
1) Adding 'nodefault' to the groups field for the unit test in the
unittests.cfg file. When a unit test is in the nodefault group
it is only run when invoked
a) independently, arch-run arch/test
b) by specifying any other non-nodefault group it is in,
groups = nodefault,mygroup : ./ -g mygroup
c) by specifying all tests should be run, ./ -a
2) Making the test conditional on errata in the code,
if (ERRATA(abcdef012345)) {
With the errata condition the unsafe unit test is only run
a) the ERRATA_abcdef012345 environ variable is provided and 'y'
b) the ERRATA_FORCE environ variable is provided and 'y'
c) by specifying all tests should be run, ./ -a
(The -a switch ensures the ERRATA_FORCE is provided and set
to 'y'.)
The errata.txt file provides a mapping of the commits needed by errata
conditionals to their respective minimum kernel versions. By default,
when the user does not provide an environ, then an environ generated
from the errata.txt file and the host's kernel version is provided to
all unit tests.
# Contributing
## Directory structure
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment