Re: [PATCH] scripts/runtime: Adjust the premature_failure check

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

 



Dne 31.5.2016 v 17:56 Radim Krčmář napsal(a):
2016-05-31 17:37+0200, Radim Krčmář:
2016-05-31 12:54+0200, Lukáš Doktor:
The premature_failure check fails on qemu-system-ppc64 as it uses
different message. This patch modifies the condition so it works
(hopefully) for all archs.
---
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
-    echo "$last_line" | grep -qi "could not load kernel" &&
+    echo "$last_line" | grep "_NO_FILE_4Uhere_" | grep -qi "no such file" &&

PPC uses "Could not open '_NO_FILE_4Uhere_': No such file [...]".
The problem is that "No such file [...]" might be localized, so what
about
  grep -qi "could not \(load kernel\|open\) '_NO_FILE_4Uhere_'"
?

My tested local repo has a different line there:
(no idea how the posted version came around ...)

  echo "$last_line" | grep -qi "_NO_FILE_4Uhere_" &&
Oups, I sent a wrong version. I didn't use the `last_line`, but full output to check for the result to be more lenient:

```
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 886814b..96c82c6 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -15,9 +15,8 @@ extract_summary()
 premature_failure()
 {
     local log="$(eval $(get_cmdline _NO_FILE_4Uhere_) 2>&1)"
-    local last_line=$(tail -1 <<< "$log")
- echo "$last_line" | grep "_NO_FILE_4Uhere_" | grep -qi "no such file" &&
+    echo "$log" | grep "_NO_FILE_4Uhere_" | grep -qi "no such file" &&
         return 1
RUNTIME_log_stderr <<< "$log"
```

Which works for me on ppc64 and x86_64. Anyway it fails on aarch64 as indeed the message is localized. I'm wondering how strict this check needs to be. I'd be fine with checking the exit_code + `grep -q "_NO_FILE_4Uhere_"` anywhere in the output.

Alternatively how about stronger version could check the last line in this way `echo "$last_line" | grep "_NO_FILE_4Uhere_" | grep -q -e "could not load kernel" -e "error loading" which works on my qemu-system-{x86_64,aarch64,ppc64}.

Any preferences?

Lukáš


so we might be fine with it too, but I like the context check.



Attachment: signature.asc
Description: OpenPGP digital signature


[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