From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [KVM-AUTOTEST PATCH 1/2] KVM test: optionally convert PPM files to PNG format after test
Date: Thu, 18 Jun 2009 06:04:32 -0300 [thread overview]
Message-ID: <1245315872.11036.25.camel@freedom> (raw)
In-Reply-To: <2839fd912f78bbd89777f6da5f09480946809ac0.1245149801.git.mgoldish@redhat.com>
On Tue, 2009-06-16 at 14:00 +0300, Michael Goldish wrote:
> 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 <mgoldish@redhat.com>
> ---
> 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 7fac46a..26e5210 100644
> --- a/client/tests/kvm/kvm_preprocessing.py
> +++ b/client/tests/kvm/kvm_preprocessing.py
> @@ -223,11 +223,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)
As the above call can fail if ImageMagick is not installed, we might
perform a check before (the autotest lib os_dep does rudimentary command
and library presence checks), and proceed with conversion only if the
command does exist. It's safer this way.
> + # 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)
>
--
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies
next prev parent reply other threads:[~2009-06-18 9:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 11:00 [KVM-AUTOTEST PATCH 1/2] KVM test: optionally convert PPM files to PNG format after test Michael Goldish
2009-06-16 11:00 ` [KVM-AUTOTEST PATCH 2/2] KVM test: kvm_tests.cfg.sample: convert PPM files to PNG by default Michael Goldish
2009-06-18 9:04 ` Lucas Meneghel Rodrigues [this message]
2009-06-18 9:08 ` [KVM-AUTOTEST PATCH 1/2] KVM test: optionally convert PPM files to PNG format after test Lucas Meneghel Rodrigues
[not found] <1773774356.199411245322746771.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-06-18 10:59 ` Michael Goldish
2009-06-18 18:28 ` Lucas Meneghel Rodrigues
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1245315872.11036.25.camel@freedom \
--to=lmr@redhat.com \
--cc=autotest@test.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=mgoldish@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.