Re: [PATCH kvm-unit-tests] scripts: Fix the check whether testname is in the only_tests list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/07/2020 11.46, Paolo Bonzini wrote:
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.  Because "grep -w" does not consider the "-" character as
part of a word, "ioapic" successfully matches against "ioapic-split".

To fix the issue, use spaces as the only delimiter when running "grep",
removing the problematic "-w" flag from the invocation.

Reported-by: Thomas Huth <thuth@xxxxxxxxxx>
Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
  scripts/runtime.bash | 11 ++++++++---
  1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 8bfe31c..6158e37 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -68,6 +68,11 @@ function print_result()
      fi
  }
+function find_word()
+{
+    grep -q " $1 " <<< " $2 "
+}

Ah, clever idea with the surrounding spaces here!

Works great for me, so:
Tested-by: Thomas Huth <thuth@xxxxxxxxxx>
Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux