qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL v2 2/5] tests/tpm: Display if swtpm is not found


From: Thomas Huth
Subject: Re: [Qemu-devel] [PULL v2 2/5] tests/tpm: Display if swtpm is not found or --tpm2 not supported
Date: Tue, 6 Nov 2018 12:51:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2018-10-30 22:47, Stefan Berger wrote:
> From: Marc-André Lureau <address@hidden>
> 
> If swtpm is not found in $PATH or --tpm2 isn't supported, we display
> this in the test log. We cannot mark the test as skipped due to a bug in
> certain versions of the gtester environment that interprets a skipped test
> as failure.
> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> Reviewed-by: Stefan Berger <address@hidden>
> Signed-off-by: Stefan Berger <address@hidden>
> ---
>  tests/tpm-tests.c | 33 +++++++++++++++++++++------------
>  tests/tpm-util.c  |  8 +-------
>  tests/tpm-util.h  |  2 ++
>  3 files changed, 24 insertions(+), 19 deletions(-)
> 
> diff --git a/tests/tpm-tests.c b/tests/tpm-tests.c
> index 10c6592aac..93a5beba01 100644
> --- a/tests/tpm-tests.c
> +++ b/tests/tpm-tests.c
> @@ -18,6 +18,17 @@
>  #include "libqtest.h"
>  #include "tpm-tests.h"
>  
> +static bool
> +tpm_test_swtpm_skip(void)
> +{
> +    if (!tpm_util_swtpm_has_tpm2()) {
> +        fprintf(stderr, "swtpm not in PATH or missing --tpm2 support; ");
> +        return true;
> +    }

I now get this ugly (4-times duplicated) output each time I run "make check":

swtpm not in PATH or missing --tpm2 support; swtpm not in PATH or missing 
--tpm2 support; swtpm not in PATH or missing --tpm2 support; swtpm not in PATH 
or missing --tpm2 support;

Could you please use g_test_message() here instead like we're doing
it in most of the other tests already?

 Thanks,
  Thomas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]