public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Goldish <mgoldish@redhat.com>
To: Lucas Meneghel Rodrigues <lmr@redhat.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [Autotest] [PATCH 2/3] KVM test: Modify enospc test to not require scripts/check_image.py
Date: Wed, 19 Jan 2011 08:05:07 +0200	[thread overview]
Message-ID: <4D367F13.2000207@redhat.com> (raw)
In-Reply-To: <1295394353-11688-3-git-send-email-lmr@redhat.com>

On 01/19/2011 01:45 AM, Lucas Meneghel Rodrigues wrote:
> With this we prepare to remove the aforementioned script.
> 
> Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
> ---
>  client/tests/kvm/tests/enospc.py |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/client/tests/kvm/tests/enospc.py b/client/tests/kvm/tests/enospc.py
> index 2d8b628..4dd694f 100644
> --- a/client/tests/kvm/tests/enospc.py
> +++ b/client/tests/kvm/tests/enospc.py
> @@ -1,7 +1,7 @@
>  import logging, commands, time, os, re
>  from autotest_lib.client.common_lib import error
>  from autotest_lib.client.bin import utils
> -import kvm_test_utils
> +import kvm_test_utils, kvm_vm
>  
>  
>  def run_enospc(test, params, env):
> @@ -46,11 +46,11 @@ def run_enospc(test, params, env):
>          if "paused" in status:
>              pause_n += 1
>              logging.info("Checking all images in use by the VM")
> -            script_path = os.path.join(test.bindir, "scripts/check_image.py")
> -            try:
> -                cmd_result = utils.run('python %s' % script_path)
> -            except error.CmdError, e:
> -                logging.debug(e.result_obj.stdout)
> +            for image_name in vm.params.objects("images"):
> +                image_params = vm.params.object_params(image_name)
> +                # Just to make sure the image check won't throw exceptions
> +                image_params["check_image_critical"] = 'no'

I think this would be nicer:

try:
    ...
except VMError, e:
    logging.warn(e)

> +                kvm_vm.check_image(image_params, test.bindir)
>              logging.info("Guest paused, extending Logical Volume size")
>              try:
>                  cmd_result = utils.run("lvextend -L +200M /dev/vgtest/lvtest")


  reply	other threads:[~2011-01-19  6:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18 23:45 [PATCH 0/3] Removing scripts/check_image.py Lucas Meneghel Rodrigues
2011-01-18 23:45 ` [PATCH 1/3] KVM test: Introduce check_image postprocess directive Lucas Meneghel Rodrigues
2011-01-18 23:58   ` Amos Kong
2011-01-19  5:56   ` Michael Goldish
2011-01-18 23:45 ` [PATCH 2/3] KVM test: Modify enospc test to not require scripts/check_image.py Lucas Meneghel Rodrigues
2011-01-19  6:05   ` Michael Goldish [this message]
2011-01-18 23:45 ` [PATCH 3/3] KVM test: Removing scripts/check_image.py 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=4D367F13.2000207@redhat.com \
    --to=mgoldish@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=lmr@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox