public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
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 6/9] errata: add ERRATA_FORCE
Date: Tue, 13 Jun 2017 13:54:48 +0200	[thread overview]
Message-ID: <20170613115451.6240-7-drjones@redhat.com> (raw)
In-Reply-To: <20170613115451.6240-1-drjones@redhat.com>

Provide an easy way for test runners to run all tests, even those
guarded by an erratum. Setting ERRATA_FORCE forces errata() and
errata_relaxed() to always return true. ./run_tests.sh -a is
also updated to set it.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
---
 lib/errata.h | 21 +++++++++++++++++++--
 run_tests.sh |  2 ++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/errata.h b/lib/errata.h
index 7b089c2578ad..f3ebca2d8a6c 100644
--- a/lib/errata.h
+++ b/lib/errata.h
@@ -13,16 +13,33 @@
 #define _ERRATA_RELAXED(erratum) errata_relaxed("ERRATA_" # erratum)
 #define ERRATA_RELAXED(erratum) _ERRATA_RELAXED(erratum)
 
+static inline bool errata_force(void)
+{
+	char *s = getenv("ERRATA_FORCE");
+
+	return s && (*s == '1' || *s == 'y' || *s == 'Y');
+}
+
 static inline bool errata(const char *erratum)
 {
-	char *s = getenv(erratum);
+	char *s;
+
+	if (errata_force())
+		return true;
+
+	s = getenv(erratum);
 
 	return s && (*s == '1' || *s == 'y' || *s == 'Y');
 }
 
 static inline bool errata_relaxed(const char *erratum)
 {
-	char *s = getenv(erratum);
+	char *s;
+
+	if (errata_force())
+		return true;
+
+	s = getenv(erratum);
 
 	return !(s && (*s == '0' || *s == 'n' || *s == 'N'));
 }
diff --git a/run_tests.sh b/run_tests.sh
index c7972cbd198b..aa2e65f622ce 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -19,6 +19,7 @@ Usage: $0 [-h] [-v] [-a] [-g group] [-j NUM-TASKS]
     -h: Output this help text
     -v: Enables verbose mode
     -a: Run all tests, including those flagged as 'nodefault'
+        and those guarded by errata.
     -g: Only execute tests in the given group
     -j: Execute tests in parallel
 
@@ -35,6 +36,7 @@ while getopts "ag:hj:v" opt; do
     case $opt in
         a)
             run_all_tests="yes"
+            export ERRATA_FORCE=y
             ;;
         g)
             only_group=$OPTARG
-- 
2.9.4

  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 ` Andrew Jones [this message]
2017-06-13 11:54 ` [PATCH kvm-unit-tests v3 7/9] README: add section on guarding unsafe tests Andrew Jones
2017-06-13 12:15   ` 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-7-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