]> git.ipfire.org Git - thirdparty/qemu.git/commit
tests/functional: Extract the find_free_ports() function into a helper file
authorThomas Huth <thuth@redhat.com>
Wed, 18 Dec 2024 13:14:38 +0000 (14:14 +0100)
committerThomas Huth <thuth@redhat.com>
Thu, 2 Jan 2025 07:58:08 +0000 (08:58 +0100)
commitb7edbbf4321fea9efefda2a5d6bcea4f7140f866
tree4e27b3769943d8218ea25cad201837d6533f292b
parent93a9fdc5504f15d319927c1497522cb72929d78e
tests/functional: Extract the find_free_ports() function into a helper file

We'll need this functionality in other functional tests, too, so
let's extract it into the qemu_test module.
Also add  an __enter__ and __exit__ function that can be used for
using this functionality in a locked context, so that tests that
are running in parallel don't try to compete for the same ports
later.
Also make sure to only use ports in the "Dynamic Ports" range
(see https://www.rfc-editor.org/rfc/rfc6335) and "randomize" the
start of the probed range with the PID of the test process to
further avoid possible clashes with other competing processes.

Message-ID: <20241218131439.255841-5-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/functional/qemu_test/ports.py [new file with mode: 0644]
tests/functional/test_vnc.py