diff mbox

[KVM-AUTOTEST,4/7] KVM test: step file tests: do not fail when receiving an invalid screendump

Message ID 348018b0e8c76a25b2f35829b1f376f77fd8d269.1249835925.git.mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish Aug. 9, 2009, 4:51 p.m. UTC
Warn, instead of failing, when receiving an invalid PPM screendump.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_guest_wizard.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_guest_wizard.py b/client/tests/kvm/kvm_guest_wizard.py
index 732e427..4efb0e9 100644
--- a/client/tests/kvm/kvm_guest_wizard.py
+++ b/client/tests/kvm/kvm_guest_wizard.py
@@ -88,14 +88,15 @@  def barrier_2(vm, words, params, debug_dir, data_scrdump_filename,
             logging.error("Could not fetch screendump")
             continue
 
-        # Make sure image is valid
-        if not ppm_utils.image_verify_ppm_file(scrdump_filename):
-            failure_message = "got invalid screendump"
-            break
-
         # Read image file
         (w, h, data) = ppm_utils.image_read_from_ppm_file(scrdump_filename)
 
+        # Make sure image is valid
+        if not ppm_utils.image_verify_ppm_file(scrdump_filename):
+            logging.warn("Got invalid screendump: dimensions: %dx%d, "
+                         "data size: %d" % (w, h, len(data)))
+            continue
+
         # Compute md5sum of whole image
         whole_image_md5sum = ppm_utils.image_md5sum(w, h, data)