All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <mwilck@suse.com>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH 15/15] tests: add directio unit tests
Date: Mon, 20 Jan 2020 09:25:57 -0600	[thread overview]
Message-ID: <20200120152557.GP30153@octiron.msp.redhat.com> (raw)
In-Reply-To: <e45a8a4058b97970412455f835c00e1982d8a5d0.camel@suse.de>

On Mon, Jan 20, 2020 at 09:27:25AM +0100, Martin Wilck wrote:
> On Thu, 2020-01-16 at 20:18 -0600, Benjamin Marzinski wrote:
> > Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> > ---
> >  tests/Makefile   |   3 +-
> >  tests/directio.c | 704
> > +++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 706 insertions(+), 1 deletion(-)
> >  create mode 100644 tests/directio.c
> > 
> > diff --git a/tests/Makefile b/tests/Makefile
> > index a5cdf390..275fdd7d 100644
> > +
> > +/* test async checkers pending and getting resovled by another
> > checker
> > + * as well as the loops for getting multiple events */
> > +static void test_check_state_async(void **state)
> > +{
> > +	int i;
> > +	struct checker c[257] = {0};
> > +	struct async_req *reqs[257];
> > +	int res[257] = {0};
> > +
> > +	do_libcheck_load();
> > +	for (i = 0; i < 257; i++)
> > +		do_libcheck_init(&c[i], 4096, &reqs[i]);
> > +	for (i = 0; i < 256; i++) {
> > +		return_io_getevents_none();
> > +		do_check_state(&c[i], 0, 30, PATH_PENDING);
> > +		assert_true(is_checker_running(&c[i]));
> > +	}
> > +	return_io_getevents_nr(&full_timeout, 256, reqs, res);
> > +	return_io_getevents_nr(NULL, 1, &reqs[256], &res[256]);
> > +	do_check_state(&c[256], 0, 30, PATH_UP);
> > +	assert_false(is_checker_running(&c[256]));
> > +	libcheck_free(&c[i]);
> 
> Writing &c[256] here would be better readable. Apart from that, this is
> looking good. Some of the tests are implementation-specific, but that's
> fine if we stick with this implementation.
> 
> I wish we could have some tests with real aio for this, but that would
> be difficult to set up right. Perhaps scsi_debug could be leveraged for
> it.

I initially wrote this using a config file in tests, where if you
uncommented a line, and set it to a device, the tests would run on that
device.  Otherwise, it would skip the directio tests entirely. It was
easier to get the failures that I wanted with completely faking the
device, so I switched to this. I reasoned that the parts where you are
talking to the device, and it is responding like it should are easy
enough to test by actually running multipath/multipathd. Perhaps I could
add that back, but only use it for some of the tests, or just use the
wrap code to be able to only use the underlying functions (which talk to
the device) some of the time, and skip them if I need a certain result.
I'll take a look. 

-Ben

> 
> Regards
> Martin
> 
> 

      reply	other threads:[~2020-01-20 15:25 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  2:18 [PATCH 00/15] Multipath patch dump Benjamin Marzinski
2020-01-17  2:18 ` [PATCH 01/15] multipathd: warn when configuration has been changed Benjamin Marzinski
2020-01-17 15:45   ` Martin Wilck
2020-01-22 11:59     ` Benjamin Marzinski
2020-01-17 15:51   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 02/15] libmultipath: fix leak in foreign code Benjamin Marzinski
2020-01-17 15:50   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 03/15] Fix leak in mpathpersist Benjamin Marzinski
2020-01-17 15:53   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 04/15] libmultipath: remove unused path->prio_args Benjamin Marzinski
2020-01-17 15:55   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 05/15] libmultipath: constify get_unaligned_be* Benjamin Marzinski
2020-01-17 15:57   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 06/15] libmultipath: add missing hwe mpe variable merges Benjamin Marzinski
2020-01-17 16:04   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 07/15] libmultipath: fix sgio_get_vpd looping Benjamin Marzinski
2020-01-17 16:27   ` Martin Wilck
2020-01-20 16:59     ` Benjamin Marzinski
2020-01-17  2:18 ` [PATCH 08/15] libmultipath: add vend_id to get_vpd_sgio Benjamin Marzinski
2020-01-17 16:58   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 09/15] libmultipath: add code to get vendor specific vpd data Benjamin Marzinski
2020-01-17 16:56   ` Martin Wilck
2020-01-22  8:51     ` Benjamin Marzinski
2020-01-22 11:52       ` Martin Wilck
2020-01-22 12:20         ` Benjamin Marzinski
2020-01-18 17:34   ` John Stoffel
2020-01-22  9:46     ` Benjamin Marzinski
2020-01-17  2:18 ` [PATCH 10/15] libmultipath: change how the checker async is set Benjamin Marzinski
2020-01-17 17:02   ` Martin Wilck
2020-01-17 17:04   ` Martin Wilck
2020-01-18 17:43   ` John Stoffel
2020-01-20 15:07     ` Benjamin Marzinski
2020-01-20 20:20       ` John Stoffel
2020-01-21 12:49         ` Benjamin Marzinski
2020-01-21 20:13           ` John Stoffel
2020-01-17  2:18 ` [PATCH 11/15] libmultipath: change failed path prio timeout Benjamin Marzinski
2020-01-17 17:18   ` Martin Wilck
2020-01-20 16:22     ` Benjamin Marzinski
2020-01-17  2:18 ` [PATCH 12/15] multipathd: add new paths under vecs lock Benjamin Marzinski
2020-01-17 17:39   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 13/15] libmultipath: add new checker class functions Benjamin Marzinski
2020-01-17 17:41   ` Martin Wilck
2020-01-17  2:18 ` [PATCH 14/15] libmultipath: make directio checker share io contexts Benjamin Marzinski
2020-01-20  8:09   ` Martin Wilck
2020-01-20 16:08     ` Benjamin Marzinski
2020-01-21  8:55       ` Martin Wilck
2020-01-17  2:18 ` [PATCH 15/15] tests: add directio unit tests Benjamin Marzinski
2020-01-20  8:27   ` Martin Wilck
2020-01-20 15:25     ` Benjamin Marzinski [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=20200120152557.GP30153@octiron.msp.redhat.com \
    --to=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mwilck@suse.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.