kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] scripts: Fix the check whether testname is in the only_tests list
@ 2020-07-01  8:37 Thomas Huth
  2020-07-01  8:51 ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2020-07-01  8:37 UTC (permalink / raw)
  To: Paolo Bonzini, kvm; +Cc: Drew Jones

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-01  9:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01  8:37 [kvm-unit-tests PATCH] scripts: Fix the check whether testname is in the only_tests list Thomas Huth
2020-07-01  8:51 ` Paolo Bonzini
2020-07-01  8:57   ` Thomas Huth
2020-07-01  9:43     ` Paolo Bonzini
2020-07-01  9:55     ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).