[PATCH] ctdb-test: Add tests to verify queue processing

Martin Schwenke martin at meltin.net
Thu Mar 21 06:15:04 UTC 2019


Hi Swen,

On Mon, 18 Mar 2019 15:34:30 +0100, swen <swen at linux.ibm.com> wrote:

> On Mon, 2019-03-18 at 21:58 +1100, Martin Schwenke wrote:

> > I think the 2 infrastructure functions (ctdb_set_error() and
> > test_setup()) are similar enough that we don't need another file with
> > them essentially duplicated.  I would just add a struct ctdb_queue **
> > argument to test_setup() and set that if non-NULL is passed in.  Then
> > you're only really adding a couple of testcases...

> Thanks for your reply.
> I integrated the patches into ctdb_io_test.c and performed all the
> other updates as well (ctdb_io_test_001.sh)
> 
> Please review and push if happy.

I would suggest not changing test_setup() to *return* the queue, while
dropping the ctdb output parameter.  That forces the queue it into tests
that don't use it.

Instead, as I suggested in my previous email, I suggest adding an
optional output argument for the queue and only pass it out if non-NULL
is passed in.  That way, the change to existing tests is minimal: just
pass NULL for the extra argument.  This makes it clear that those tests
aren't looking inside the queue.

The new tests could then follow the existing pattern of using ctdb->ev
for the event loop and using queue when necessary.

How does that sound?

peace & happiness,
martin


> 
> Thanks for your support in advance.
> 
> Cheers Swen
> > Hi Swen,
> > 
> > On Thu, 14 Mar 2019 13:27:21 +0100, swen <swen at linux.ibm.com> wrote:
> >   
> > > On Thu, 2019-03-14 at 21:56 +1100, Martin Schwenke via samba-
> > > technical
> > > wrote:  
>  [...]  
>  [...]  
>  [...]  
> > > Hmm, well it actually doesn't fit nicely :-)
> > > 
> > > The existing tests do investigate what's received on "client" side
> > > and
> > > therefore, do not check or need anything on the servers side.
> > > 
> > > The tests I'm adding are actually covering the server side and
> > > investigate the queue itself and the byte-pushing there... not
> > > care'ing
> > > what's received.
> > > 
> > > Due to this difference the existing tests have no reference to the
> > > queue which is needed fo the tests I would like t add.
> > > 
> > > Aynhow, if you'd prefer to just have on file containing the tests,
> > > I guess, I could do that. Just thought it would be nicer to have
> > > the
> > > separation because of what I described.
> > > 
> > > You pick, I don't mind.  
> > 
> > 
> > peace & happiness,
> > martin  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190321/177951b7/attachment.sig>


More information about the samba-technical mailing list