From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: Michael Goldish <mgoldish@redhat.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM test: Create a verify_kernel_crash() VM method
Date: Wed, 02 Mar 2011 10:07:06 -0300 [thread overview]
Message-ID: <1299071227.2935.3.camel@freedom> (raw)
In-Reply-To: <4D6E2474.4070701@redhat.com>
On Wed, 2011-03-02 at 13:05 +0200, Michael Goldish wrote:
> On 03/02/2011 05:46 AM, Lucas Meneghel Rodrigues wrote:
> > + def verify_kernel_crash(self, timeout=2):
> > + """
> > + Find kernel crash message on serial console.
> > +
> > + @param timeout: Timeout used to verify expected output.
> > +
> > + @raise: VMDeadKernelCrashError, in case a kernel crash message was
> > + found.
> > + """
> > + data = self.serial_console.read_nonblocking()
>
> I'm not sure using these methdos (read_nonblocking,
> read_until_last_line_matches) is safe if verify_kernel_crash() is to be
> used in tests that already use the serial console. If a test uses the
> serial console for interactive shell sessions, it might read the BUG:
> message unintentionally (while waiting for a shell prompt, for example)
> and then verify_kernel_crash() will not read the BUG: message because
> data can't be read twice. It's safer to use
> self.serial_console.get_output(), which returns all the output seen so
> far from the moment the process was started, including the output
> already read by read_until_*(). However, it just returns a snapshot of
> the output, so if you happen to call it while a trace is being printed,
> you'll get a partial trace. But if the intended usage for the function
> is to be called periodically, that's fine, because the next time it's
> called you'll get the full trace. Does this make sense?
>
It does, certainly. It's a matter of changing the code to use
get_output() then, thanks for the suggestion, awesome!
Lucas
prev parent reply other threads:[~2011-03-02 13:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 3:46 [PATCH] KVM test: Create a verify_kernel_crash() VM method Lucas Meneghel Rodrigues
2011-03-02 5:30 ` Jason Wang
2011-03-02 10:56 ` Michael Goldish
2011-03-02 11:05 ` Michael Goldish
2011-03-02 13:07 ` Lucas Meneghel Rodrigues [this message]
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=1299071227.2935.3.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.