From: Thomas Huth <thuth@redhat.com>
To: Stefan Berger <stefanb@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
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 [thread overview]
Message-ID: <e1c724bf-4117-a938-bc20-3056991ce0ec@redhat.com> (raw)
In-Reply-To: <20181030214740.2294043-3-stefanb@linux.vnet.ibm.com>
On 2018-10-30 22:47, Stefan Berger wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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 <marcandre.lureau@redhat.com>
> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
> ---
> 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
next prev parent reply other threads:[~2018-11-06 11:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-30 21:47 [Qemu-devel] [PULL v2 0/5] Merge tpm 2018/10/29 v2 Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 1/5] tests/tpm: fix tpm_util_swtpm_has_tpm2() Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 2/5] tests/tpm: Display if swtpm is not found or --tpm2 not supported Stefan Berger
2018-11-06 11:51 ` Thomas Huth [this message]
2018-11-06 14:35 ` Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 3/5] docs: tpm: Mention implemented TPM CRB interface emulation and specs Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 4/5] MAINTAINERS: Change my email address to the new domain Stefan Berger
2018-10-30 21:47 ` [Qemu-devel] [PULL v2 5/5] tpm: Zero-init structure to avoid uninitialized variables in valgrind log Stefan Berger
2018-11-01 13:24 ` [Qemu-devel] [PULL v2 0/5] Merge tpm 2018/10/29 v2 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1c724bf-4117-a938-bc20-3056991ce0ec@redhat.com \
--to=thuth@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).