Message ID | 79d9f4e9e8ca62388f1a8be1a0f450a2f2329fc3.1248102188.git.mgoldish@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Jul 20, 2009 at 12:07 PM, Michael Goldish<mgoldish@redhat.com> 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. Applied. > 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 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) > > -- > 1.5.4.1 > > _______________________________________________ > Autotest mailing list > Autotest@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest >
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)
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(-)