tests/avocado: start PhoneServer upfront
authorBeraldo Leal <bleal@redhat.com>
Fri, 11 Mar 2022 17:11:27 +0000 (14:11 -0300)
committerThomas Huth <thuth@redhat.com>
Wed, 16 Mar 2022 07:43:10 +0000 (08:43 +0100)
commit5e2d19b3cd18184dde9a4793c3fbd8283ebffdfc
tree7f2d501c5fcd4b6252d092bfc061fe85be09e561
parentc587bddb530c2f48b1a43b6df5028f78c39c81c3
tests/avocado: start PhoneServer upfront

Race conditions can happen with the current code, because the port that
was available might not be anymore by the time the server is started.

By setting the port to 0, PhoneServer it will use the OS default
behavior to get a free port, then we save this information so we can
later configure the guest.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Beraldo Leal <bleal@redhat.com>
Message-Id: <20220311171127.2189534-1-bleal@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/avocado/avocado_qemu/__init__.py