test: wait for the swtpm socket to appear
authorFrantisek Sumsal <frantisek@sumsal.cz>
Sat, 23 Sep 2023 07:13:56 +0000 (09:13 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sat, 23 Sep 2023 10:32:12 +0000 (11:32 +0100)
commit18c3ffbfcc2d4d6d1a4680092123e510945f7a78
treea7c4c24aa2ecd1dc4be51668c69b3801aec2936c
parent3a89904e45cbbd96fb1c5d0768de5e5fcdaaa508
test: wait for the swtpm socket to appear

On slower/overloaded systems it may take a bit for the swtpm socket
to show up:

I: Started swtpm as PID 189419 with state dir /tmp/tmp.pWqUutuGUj
I: Configured emulated TPM2 device tpm-spapr
+ tee /var/tmp/systemd-test-TEST-70-TPM2_1/console.log
+ timeout --foreground 1200 /bin/qemu-system-ppc64le -smp 4 ...
qemu-system-ppc64le: -chardev socket,id=chrtpm,path=/tmp/tmp.pWqUutuGUj/sock: Failed to connect to '/tmp/tmp.pWqUutuGUj/sock': No such file or directory
E: qemu failed with exit code 1

Spotted regularly in the ppc64le cron job and in some Ubuntu CI/CentOS CI
pr runs [0].

[0] https://github.com/systemd/systemd/pull/29183#issuecomment-1721727927
test/test-functions