From: Uri Lublin <uril@redhat.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [KVM-AUTOTEST PATCH 2/4] kvm_guest_wizard: pass 'params' directly to barrier_2()
Date: Tue, 16 Jun 2009 17:57:19 +0300 [thread overview]
Message-ID: <4A37B2CF.3050800@redhat.com> (raw)
In-Reply-To: <ec71b9e574fac8a7d2e4d6e98ad135d7f312e789.1245094830.git.mgoldish@redhat.com>
On 06/15/2009 10:45 PM, Michael Goldish wrote:
> Currently parameters for barrier_2() are extracted from 'params' in the main
> run_steps() test routine, and then passed to barrier_2().
> Instead, let barrier_2() extract parameters from 'params' as it sees fit.
> This will make adding new parameters slightly easier and cleaner.
>
> Signed-off-by: Michael Goldish<mgoldish@redhat.com>
> ---
> client/tests/kvm/kvm_guest_wizard.py | 37 ++++++++++++++++-----------------
> 1 files changed, 18 insertions(+), 19 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_guest_wizard.py b/client/tests/kvm/kvm_guest_wizard.py
> index 143e61e..eb0e2d5 100644
> --- a/client/tests/kvm/kvm_guest_wizard.py
> +++ b/client/tests/kvm/kvm_guest_wizard.py
> @@ -41,6 +41,18 @@ def barrier_2(vm, words, fail_if_stuck_for, stuck_detection_history,
> "cropped_scrdump_expected.ppm")
> comparison_filename = os.path.join(debug_dir, "comparison.ppm")
>
> + fail_if_stuck_for = params.get("fail_if_stuck_for")
> + if fail_if_stuck_for:
> + fail_if_stuck_for = float(fail_if_stuck_for)
> + else:
> + fail_if_stuck_for = 1e308
> +
> + stuck_detection_history = params.get("stuck_detection_history")
> + if stuck_detection_history:
> + stuck_detection_history = int(stuck_detection_history)
> + else:
> + stuck_detection_history = 2
> +
Could be simplified by (preferably in a separate patch):
fail_if_stuck_for = params.get("fail_if_stuck_for", 1e308)
fail_if_stuck_for = float(fail_if_stuck_for)
stuck_detection_history = params.get("stuck_detection_history", 2)
stuck_detection_history = int(stuck_detection_history)
or even with a single line for each param:
var = cast(params.get(var_name, default_value))
Regards,
Uri
next prev parent reply other threads:[~2009-06-16 14:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-15 19:45 [KVM-AUTOTEST PATCH 0/4] Step file tests: introducing a new feature and some small changes Michael Goldish
2009-06-15 19:45 ` [KVM-AUTOTEST PATCH 1/4] kvm_guest_wizard: rename output_dir to debug_dir in barrier_2() Michael Goldish
2009-06-15 19:45 ` [KVM-AUTOTEST PATCH 2/4] kvm_guest_wizard: pass 'params' directly to barrier_2() Michael Goldish
2009-06-16 14:57 ` Uri Lublin [this message]
2009-06-15 19:45 ` [KVM-AUTOTEST PATCH 3/4] kvm_guest_wizard: allow keeping screendump history for debugging purposes Michael Goldish
2009-06-18 14:30 ` [Autotest] " Lucas Meneghel Rodrigues
2009-06-18 15:30 ` Michael Goldish
2009-06-15 19:45 ` [KVM-AUTOTEST PATCH 4/4] kvm_tests.cfg.sample: add 'keep_screendump_history = yes' to step file tests Michael Goldish
2009-06-18 14:31 ` [Autotest] " Lucas Meneghel Rodrigues
2009-06-18 14:40 ` [KVM-AUTOTEST PATCH 0/4] Step file tests: introducing a new feature and some small changes Lucas Meneghel Rodrigues
[not found] <1844774533.101541245166780909.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com>
2009-06-16 15:44 ` [KVM-AUTOTEST PATCH 2/4] kvm_guest_wizard: pass 'params' directly to barrier_2() Michael Goldish
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=4A37B2CF.3050800@redhat.com \
--to=uril@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox