qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: "M.Kustova" <maxa@catit.be>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [RFC] image-fuzzer: Trivial test runner
Date: Thu, 5 Jun 2014 15:47:55 +0200	[thread overview]
Message-ID: <20140605134755.GC8759@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CALKf6DHTCLmZa4Qph=Ef0kM1gmyhN6agfM-sDvNJGjT3VrjEbg@mail.gmail.com>

On Thu, Jun 05, 2014 at 12:49:36PM +0400, M.Kustova wrote:
> On Wed, Jun 4, 2014 at 6:26 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Sat, May 31, 2014 at 01:56:46PM +0400, Maria Kustova wrote:
> >> +    def execute(self, q_args, seed, size=8*512):
> >> +        """ Execute a test.
> >> +
> >> +        The method creates a test image, runs 'qemu_img' and analyzes its exit
> >> +        status. If the application was killed by a signal, the test is marked
> >> +        as failed.
> >> +        """
> >> +        os.chdir(self.current_dir)
> >> +        seed = qcow2.create_image('test_image.qcow2', seed, size)
> >
> > The qcow2 module is missing from this patch series.
> 
> As far as the qcow2 module was just a stub and an image format should
> not be hardcoded, it will be sent as a patch as soon as it gets some
> functionality implemented.

Patch emails cannot contain dangling references.  It makes code review
hard when you don't actually have all the code.  And it means the
commits are not bisectable (if you try the code somewhere in the middle
of the commit history it won't work and this prevents git-bisect(1)
usage).

> >> +        multilog("Seed: %s\nCommand: %s\nTest directory: %s\n"\
> >> +                 %(seed, " ".join(q_args), self.current_dir),\
> >> +                 sys.stdout, self.log, self.parent_log)
> >
> > It will probably be useful to dial back the logging for test cases that
> > pass.
> 
> This information is kept for heisenbugs, that can be reproduced only
> in the sequence of several tests. It's significant if all passed tests
> data would be removed.

I think the amount of shared or accumulated state between runes is so
minimal that this type of failure will not happen.

Each test run has a uniquely generated image.  The qemu-img/qemu-io
processes are terminated and started from scratch.

Where is the shared state that allows "independent" runs to affect each
other?  If there is some, I think we need to fix that instead of trying
to log the whole sequence of success cases.

> >> +    work_dir = args[0]
> >> +    # run_log created in 'main', because multiple tests are expected to \
> >> +    # log in it
> >> +    # TODO: Make unique run_log names on every run (for one test per run
> >> +    # this functionality is omitted in favor of usability)
> >
> > I don't understand this TODO comment.  Here's roughly what I expected
> > when I read the --help output:
> >
> >   work_dir/
> >       run.log
> >       failure-01/
> >           core
> >           input.img
> >           cmdline
> >           seed
> >
> 
> You can do several test runs one by one in the same working directory.
> Each run will have a unique name and all tests of the run will write
> their output to the log with this unique name.
> Something like:
> 
> work_dir/
>        run-01.log
>        run-02.log
>        failure-02_01/
>         core
>         input.img
>         test-02_01.log

I don't understand how this works or why it's useful.  If you want to
separate test runs, use different work dirs.

> For now outputs of all runs are appended to the same file with name
> 'run.log' while there is only one test per run.

Yes, that's what I see in the code and I think more than that isn't
necessary.

      reply	other threads:[~2014-06-05 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1401530206-8323-1-git-send-email-maria.k@catit.be>
2014-06-04 14:26 ` [Qemu-devel] [RFC] image-fuzzer: Trivial test runner Stefan Hajnoczi
2014-06-05  8:49   ` M.Kustova
2014-06-05 13:47     ` Stefan Hajnoczi [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=20140605134755.GC8759@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=maxa@catit.be \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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;
as well as URLs for NNTP newsgroup(s).