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: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NStefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
Showing
想要评论请 注册 或 登录