]> git.proxmox.com Git - mirror_qemu.git/commit
tests/tpm: fix tpm_util_swtpm_has_tpm2()
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 3 Oct 2018 13:21:28 +0000 (17:21 +0400)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Thu, 25 Oct 2018 16:46:47 +0000 (12:46 -0400)
commitc1d99200dd3d7f73ebe13b32f12944d3e48a2cb9
treedbdd3560a08e6f6a2d7e3955803c89d2103abc5e
parenta4d710251fa5aa9ec26de4626f11c78500195d12
tests/tpm: fix tpm_util_swtpm_has_tpm2()

Using g_spawn_async_with_pipes() is more complicated than running the
sync version. The async version returns a file descriptor for stdout, which may
not be fully read. Sometime "--tpm2" will failed to be read, and will
cause the related test to be silently skipped.

Use g_spawn_sync() instead, simplifying the code and fixing the race.

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-util.c