[libvirt PATCH v2 10/21] tests: testutilsqemu: move virFindFileInPath into domaincapsmock

Pavel Hrdina phrdina at redhat.com
Tue Apr 20 11:02:36 UTC 2021


On Tue, Apr 20, 2021 at 11:11:54AM +0100, Daniel P. Berrangé wrote:
> On Mon, Apr 19, 2021 at 07:14:13PM +0200, Pavel Hrdina wrote:
> > Having the function on mock library reflect more closely what we usually
> > do in tests.
> 
> Yes & no - having it in testutilsqemu.c would make it available to all
> QEMU tests, while domaincapsmock.c only makes it available from those
> loading that mock.
>
> Using testutilsqemu.c might be simpler if we need to expand what it
> mocks, as we have one place to put all the hacks. It gets confusing
> if we have 2 mocks both overriding the same function.
> 
> This isn't a NACK - just saying that I don't think the commit message
> is a clear justification for the move. Guess I'd like an explanation
> of why it should be restricted to just tests using domaincapsmock
> vs any of those linking to testutilsqemu 

I don't have any explanation why it should be restricted. My main
motivation was to have it clearly separated in a mock library.

The alternative I had in mind was to introduce a mock library that would
be used for all tests but that is for different patch series.

I'll drop this patch as it is not necessary for this series.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20210420/228c5f9e/attachment-0001.sig>


More information about the libvir-list mailing list