From patchwork Wed Aug 12 09:34:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 40828 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7C9Yti4002466 for ; Wed, 12 Aug 2009 09:34:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932267AbZHLJeu (ORCPT ); Wed, 12 Aug 2009 05:34:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755197AbZHLJet (ORCPT ); Wed, 12 Aug 2009 05:34:49 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40653 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755034AbZHLJer (ORCPT ); Wed, 12 Aug 2009 05:34:47 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7C9Yme1028536 for ; Wed, 12 Aug 2009 05:34:48 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n7C9YlqG025522; Wed, 12 Aug 2009 05:34:47 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7C9YkbA022892; Wed, 12 Aug 2009 05:34:46 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 01676250AD8; Wed, 12 Aug 2009 12:34:46 +0300 (IDT) From: Avi Kivity To: Lucas Meneghel Rodrigues Cc: kvm@vger.kernel.org Subject: [PATCH KVM-AUTOTEST 2/2] Convert images to JPEG using PIL instead of an external program Date: Wed, 12 Aug 2009 12:34:45 +0300 Message-Id: <1250069685-17727-3-git-send-email-avi@redhat.com> In-Reply-To: <1250069685-17727-1-git-send-email-avi@redhat.com> References: <1250069685-17727-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This is faster since we don't need to fork/exec/wait for an external program each time. Signed-off-by: Avi Kivity --- client/tests/kvm/kvm_guest_wizard.py | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/tests/kvm/kvm_guest_wizard.py b/client/tests/kvm/kvm_guest_wizard.py index 73b830e..f9e5476 100644 --- a/client/tests/kvm/kvm_guest_wizard.py +++ b/client/tests/kvm/kvm_guest_wizard.py @@ -1,6 +1,7 @@ import os, time, md5, re, shutil, logging from autotest_lib.client.common_lib import utils, error import kvm_utils, ppm_utils, kvm_subprocess +import PIL.Image """ Utilities to perform automatic guest installation using step files. @@ -110,9 +111,8 @@ def barrier_2(vm, words, params, debug_dir, data_scrdump_filename, history_scrdump_filename = os.path.join(history_dir, "scrdump-step_%s-%s.jpg" % (current_step_num, time.strftime("%Y%m%d-%H%M%S"))) - kvm_subprocess.run_fg("convert -quality 30 %s %s" % - (scrdump_filename, history_scrdump_filename), - logging.debug, "(convert) ", timeout=30) + image = PIL.Image.open(scrdump_filename) + image.save(history_scrdump_filename, format = 'JPEG', quality = 30) # Compare md5sum of barrier region with the expected md5sum calced_md5sum = ppm_utils.get_region_md5sum(w, h, data, x1, y1, dx, dy,