public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <mrodrigu@redhat.com>
To: Bear Yang <byang@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	uril@redhat.com, kvm@vger.kernel.org
Subject: Re: [KVM-AUTOTEST][PATCH] timedrift support
Date: Wed, 13 May 2009 15:34:55 -0300	[thread overview]
Message-ID: <1242239695.2620.18.camel@localhost.localdomain> (raw)
In-Reply-To: <4A09748C.6040909@redhat.com>

On Tue, 2009-05-12 at 21:07 +0800, Bear Yang wrote:
> Sorry forgot to attach my new patch.
> Bear Yang wrote:
> > Hi Lucas:
> > First, I want to say really thanks for your kindly,carefully words and 
> > suggestions. now,  I modified my scripts follow your opinions.
> > 1. Add the genload to timedrift, but I am not sure whether it is right 
> > or not to add the information  CVS relevant. If it is not necessary. I 
> > will remove them next time.

Yes, we can remove the CVS related info, they just got mailed to you
because I got the code from a fresh LTP CVS checkout!

> > 2. Replace the API os.system to utils.system
> > 3. Replace the API os.environ.get('HOSTNAME') to socket.gethostname()
> > 4. for the snippet of the code below:
> > +    if utils.system(ntp_cmd, ignore_status=True) != 0:
> > +        raise error.TestFail, "NTP server has not starting correctly..."
> >
> > Your suggestion is "Instead of the if clause we'd put a try/except 
> > block", but I am not clear how to do it. Would you please give me some 
> > guides for this. Sorry.

You could re-write the above if statement using the form:

try:
    utils.system(ntp_cmd)
except:
    raise error.TestFail("NTP server has not started correctly")

Some comments:

 1) The try/except block works because utils.system already throws an
exception when the exit code is different from 0.
 2) The form 

raise error.TestFail("NTP server has not started correctly")

Is preferred on the upstream project over the equivalent

raise error.TestFail, "NTP server has not started correctly"

But on kvm autotest we are adopting the later, so don't worry and keep
the all the raises the way they are on your original patch. This was
just a side comment.

> > Other thing about functional the clauses which to get vm handle below:
> >
> > +    # get vm handle
> > +    vm = kvm_utils.env_get_vm(env,params.get("main_vm"))
> > +    if not vm:
> > +        raise error.TestError, "VM object not found in environment"
> > +    if not vm.is_alive():
> > +        raise error.TestError, "VM seems to be dead; Test requires a 
> > living VM"
> >
> > I agree with you on this point, I remember that somebody to do this 
> > before. but seems upstream not accept his modification.

Ok, will take a look at this. By the way, when you have an updated patch
please let us know!

Thank you very much,

-- 
Lucas Meneghel Rodrigues
Software Engineer (QE)
Red Hat - Emerging Technologies


  reply	other threads:[~2009-05-13 18:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-06  4:02 [KVM-AUTOTEST][PATCH] timedrift support Bear Yang
2009-05-06 13:02 ` Marcelo Tosatti
2009-05-11 10:40   ` Bear Yang
2009-05-11 11:05     ` Yaniv Kaul
2009-05-11 12:59     ` Lucas Meneghel Rodrigues
2009-05-12 12:31       ` Bear Yang
2009-05-12 13:07         ` Bear Yang
2009-05-13 18:34           ` Lucas Meneghel Rodrigues [this message]
2009-05-15 16:30             ` bear
2009-05-16 20:36               ` Yaniv Kaul
2009-05-18  1:54                 ` Bear Yang
2009-05-18  4:20                   ` Yaniv Kaul
2009-05-18  5:18                     ` Bear Yang

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=1242239695.2620.18.camel@localhost.localdomain \
    --to=mrodrigu@redhat.com \
    --cc=byang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=uril@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