[libvirt] [PATCH v3 2/4] tests: Introduce global mock library

Peter Krempa pkrempa at redhat.com
Thu May 12 14:34:38 UTC 2016


On Thu, May 12, 2016 at 14:36:22 +0200, Michal Privoznik wrote:
> The intent is that this library is going to be called every time
> to check if we are not touching anything outside srcdir or
> builddir.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  cfg.mk                |   2 +-
>  tests/Makefile.am     |  13 +++-
>  tests/testutils.c     |   9 +++
>  tests/testutils.h     |  10 +--
>  tests/vircgroupmock.c |  15 ++---
>  tests/virpcimock.c    |  14 ++--
>  tests/virtestmock.c   | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  7 files changed, 210 insertions(+), 28 deletions(-)
>  create mode 100644 tests/virtestmock.c
> 

[...]

> diff --git a/tests/testutils.c b/tests/testutils.c
> index 79d0763..595b64d 100644
> --- a/tests/testutils.c
> +++ b/tests/testutils.c

[...]

> @@ -842,6 +845,12 @@ int virtTestMain(int argc,
>      char *oomstr;
>  #endif
>  
> +#ifdef __linux__
> +    VIRT_TEST_PRELOAD(TEST_MOCK);

So I was thinking about it a bit. I think we should pre-load this only
conditionally on a ENV var which will enable it.

This is due to the fact that the checker is not always run and still
requires the test suite to be re-run. (at least how make check-access is
implemented).

As this will be experimental for a while until we fix the tests or add
more stuff to the whitelist I think that would be a good compromise to
have this in the tree and not breaking anything.

With that I think this series can be ACKed.

Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160512/8d0acded/attachment-0001.sig>


More information about the libvir-list mailing list