From patchwork Mon Jul 20 15:07:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 36351 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 n6KF4Jv8016769 for ; Mon, 20 Jul 2009 15:04:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbZGTPDd (ORCPT ); Mon, 20 Jul 2009 11:03:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751965AbZGTPDc (ORCPT ); Mon, 20 Jul 2009 11:03:32 -0400 Received: from mx2.redhat.com ([66.187.237.31]:59924 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbZGTPD0 (ORCPT ); Mon, 20 Jul 2009 11:03:26 -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 n6KF3QJM000567; Mon, 20 Jul 2009 11:03:26 -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 n6KF3Ptr025205; Mon, 20 Jul 2009 11:03:26 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n6KF39lN007669; Mon, 20 Jul 2009 11:03:24 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 10/17] KVM test: optionally convert PPM files to PNG format after test Date: Mon, 20 Jul 2009 18:07:17 +0300 Message-Id: <79d9f4e9e8ca62388f1a8be1a0f450a2f2329fc3.1248102188.git.mgoldish@redhat.com> In-Reply-To: References: <1248102444-31111-1-git-send-email-mgoldish@redhat.com> <4980fdb4f9630c89ba21bd4af49a3b7626fb29f1.1248102188.git.mgoldish@redhat.com> <747abbb55932d4fde553cf5187f7481aaced4d8c.1248102188.git.mgoldish@redhat.com> <53d7f316f181c7efb429e7b9f138ed3e8b239cce.1248102188.git.mgoldish@redhat.com> <7c14834269583764af3beb2e811ac62bec3a2c96.1248102188.git.mgoldish@redhat.com> <7f24fe107f3dc8e2693e12142ba97010c7063166.1248102188.git.mgoldish@redhat.com> In-Reply-To: References: 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 intended to save disk space. Requires ImageMagick (uses mogrify). To enable: convert_ppm_files_to_png = yes To enable only for failed tests: convert_ppm_files_to_png_on_error = yes Reminder: by default PPM files are removed after the test (and after the conversion, if requested). To keep them specify: keep_ppm_files = yes To keep them only for failed tests: keep_ppm_files_on_error = yes A reasonable choice would be to keep PNG files for failed tests, and never keep PPM files. To do this specify convert_ppm_files_to_png_on_error = yes without specifying 'keep_ppm_files = yes' or 'keep_ppm_files_on_error = yes' (or explicitly set to 'no', if it was set to 'yes' on a higher level in the config hierarchy). This patch also makes small cosmetic changes to the 'keep_ppm_files' feature. Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_preprocessing.py | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 7b97f00..71f7a6b 100644 --- a/client/tests/kvm/kvm_preprocessing.py +++ b/client/tests/kvm/kvm_preprocessing.py @@ -264,11 +264,19 @@ def postprocess(test, params, env): """ process(test, params, env, postprocess_image, postprocess_vm) - # See if we should get rid of all PPM files - if not params.get("keep_ppm_files") == "yes": - # Remove them all + # Should we convert PPM files to PNG format? + if params.get("convert_ppm_files_to_png") == "yes": + logging.debug("'convert_ppm_files_to_png' specified; converting PPM" + " files to PNG format...") + mogrify_cmd = ("mogrify -format png %s" % + os.path.join(test.debugdir, "*.ppm")) + kvm_subprocess.run_fg(mogrify_cmd, logging.debug, "(mogrify) ", + timeout=30.0) + + # Should we keep the PPM files? + if params.get("keep_ppm_files") != "yes": logging.debug("'keep_ppm_files' not specified; removing all PPM files" - " from results dir...") + " from debug dir...") rm_cmd = "rm -vf %s" % os.path.join(test.debugdir, "*.ppm") kvm_subprocess.run_fg(rm_cmd, logging.debug, "(rm) ", timeout=5.0)