From: Andrew Jones <drjones@redhat.com>
To: kvm@vger.kernel.org
Cc: rkrcmar@redhat.com, pbonzini@redhat.com, lvivier@redhat.com,
thuth@redhat.com
Subject: [PATCH kvm-unit-tests v3 7/9] README: add section on guarding unsafe tests
Date: Tue, 13 Jun 2017 13:54:49 +0200 [thread overview]
Message-ID: <20170613115451.6240-8-drjones@redhat.com> (raw)
In-Reply-To: <20170613115451.6240-1-drjones@redhat.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
README.md | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/README.md b/README.md
index 576584b752eb..453eb85bd7c4 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,40 @@ Additionally these self-explanatory variables are reserved
QEMU_MAJOR, QEMU_MINOR, QEMU_MICRO, KERNEL_VERSION, KERNEL_PATCHLEVEL,
KERNEL_SUBLEVEL, KERNEL_EXTRAVERSION
+# 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 : ./run_tests.sh -g mygroup
+ c) by specifying all tests should be run, ./run_tests.sh -a
+
+ 2) Making the test conditional on errata in the code,
+ if (ERRATA(abcdef012345)) {
+ do_unsafe_test();
+ }
+
+ With the errata condition the unsafe unit test is only run
+ when
+
+ 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, ./run_tests.sh -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
--
2.9.4
next prev parent reply other threads:[~2017-06-13 11:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-13 11:54 [PATCH kvm-unit-tests v3 0/9] Extend and apply the errata framework Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 1/9] arch-run: introduce initrd_create Andrew Jones
2017-06-13 12:09 ` Laurent Vivier
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 2/9] arch-run: provide errata from run env Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 3/9] x86/run: source config.mak Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 4/9] arch-run: generate errata when no environ is provided Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 5/9] mkstandalone: provide errata to tests Andrew Jones
2017-06-13 12:15 ` Laurent Vivier
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 6/9] errata: add ERRATA_FORCE Andrew Jones
2017-06-13 11:54 ` Andrew Jones [this message]
2017-06-13 12:15 ` [PATCH kvm-unit-tests v3 7/9] README: add section on guarding unsafe tests Laurent Vivier
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 8/9] AArch32: apply errata framework to unsafe pmccntr64 test Andrew Jones
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 9/9] arm/arm64: apply errata framework to unsafe cpu-on test Andrew Jones
2017-06-14 18:58 ` [PATCH kvm-unit-tests v3 0/9] Extend and apply the errata framework Radim Krčmář
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170613115451.6240-8-drjones@redhat.com \
--to=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox