Re: [PATCH 1/2] tests: mock gnutls_dh_params_generate2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 16, 2016 at 10:46:42 +0200, Ján Tomko wrote:
> This function generates some big random numbers.
> Skip it in tests to save time.
> ---
>  tests/virnettlscontexttest.c |  2 +-
>  tests/virnettlssessiontest.c |  2 +-
>  tests/virrandommock.c        | 12 ++++++++++++
>  3 files changed, 14 insertions(+), 2 deletions(-)

[...]

> diff --git a/tests/virrandommock.c b/tests/virrandommock.c
> index 6df5e20..05c7a23 100644
> --- a/tests/virrandommock.c
> +++ b/tests/virrandommock.c
> @@ -37,3 +37,15 @@ virRandomBytes(unsigned char *buf,
>  
>      return 0;
>  }
> +
> +#ifdef WITH_GNUTLS
> +# include <stdio.h>
> +# include <gnutls/gnutls.h>
> +
> +int
> +gnutls_dh_params_generate2(gnutls_dh_params_t dparams ATTRIBUTE_UNUSED,
> +                           unsigned int bits ATTRIBUTE_UNUSED)
> +{

I'm not okay with completely removing this function here since
virnettlssessiontest is creating a session and thus this might either
reduce test coverage or introduce a problem in some cases.

I suggest that you call it just once and then use gnutls_dh_params_cpy
to cache it in the test itself rather than just skipping the init.


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]