[Qemu-devel] [RFC 1/6] device-crash-test: Make whitelist code a bit more flexible

Eduardo Habkost posted 6 patches 8 years, 4 months ago
[Qemu-devel] [RFC 1/6] device-crash-test: Make whitelist code a bit more flexible
Posted by Eduardo Habkost 8 years, 4 months ago
Allow test results without the 'log' and 'exitcode' keys.  The
new device_add code won't report exitcode/log because multiple
devices will be tested on a single QEMU run.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 scripts/device-crash-test | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index ddc8f72eca..598720ffa9 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -284,9 +284,10 @@ def whitelistResultMatch(wl, r):
     """
     assert whitelistTestCaseMatch(wl, r['testcase'])
     return ((wl.get('exitcode', 1) is None or
-             r['exitcode'] == wl.get('exitcode', 1)) and
+             r.get('exitcode') == wl.get('exitcode', 1)) and
             ('log' not in wl or
-             re.search(wl['log'], r['log'], re.MULTILINE)))
+             ('log' in r and
+              re.search(wl['log'], r['log'], re.MULTILINE))))
 
 
 def checkResultWhitelist(r):
-- 
2.13.5