tests: Fix signalling race condition in TPM tests
commit2271b75fa9019a9ba10d38ea2cf53a2032b1d8fd
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 7 Sep 2018 15:47:06 +0000 (7 11:47 -0400)
committerStefan Berger <stefanb@linux.vnet.ibm.com>
Fri, 7 Sep 2018 20:37:47 +0000 (7 16:37 -0400)
treea8fd73afcb4cafbc7223803408a571737648b930
parent19b599f7664b2ebfd0f405fb79c14dd241557452
tests: Fix signalling race condition in TPM tests

This patch fixes a race condition and test failure where the main process
waits for the signal of a thread but the thread already sent that signal
via a condition. Since these signals are non-sticky, we need to introduce a
separate variable to make this signal sticky.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
tests/tpm-crb-test.c
tests/tpm-emu.c
tests/tpm-emu.h
tests/tpm-tis-test.c