public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Cc: Drew Jones <drjones@redhat.com>
Subject: [kvm-unit-tests PATCH] scripts: Fix the check whether testname is in the only_tests list
Date: Wed,  1 Jul 2020 10:37:53 +0200	[thread overview]
Message-ID: <20200701083753.31366-1-thuth@redhat.com> (raw)

When you currently run

 ./run_tests.sh ioapic-split

the kvm-unit-tests run scripts do not only execute the "ioapic-split"
test, but also the "ioapic" test, which is quite surprising. This
happens because we use "grep -w" for checking whether a test should
be run or not - and "grep -w" does not consider the "-" character as
part of a word.

To fix the issue, convert the dash into an underscore character before
running "grep -w".

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/runtime.bash | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 8bfe31c..03fd20a 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -84,7 +84,8 @@ function run()
         return
     fi
 
-    if [ -n "$only_tests" ] && ! grep -qw "$testname" <<<$only_tests; then
+    if [ -n "$only_tests" ] && ! sed s/-/_/ <<<$only_tests \
+                               | grep -qw $(sed s/-/_/ <<< "$testname") ; then
         return
     fi
 
-- 
2.18.1


             reply	other threads:[~2020-07-01  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01  8:37 Thomas Huth [this message]
2020-07-01  8:51 ` [kvm-unit-tests PATCH] scripts: Fix the check whether testname is in the only_tests list Paolo Bonzini
2020-07-01  8:57   ` Thomas Huth
2020-07-01  9:43     ` Paolo Bonzini
2020-07-01  9:55     ` Thomas Huth

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=20200701083753.31366-1-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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