bareos: master 2be10c60

Author Committer Branch Timestamp Parent
Sebastian Sura Sebastian Sura master 2024-07-31 08:41 master 10da7e0e Pending
Changeset bareos-test-sockets: change api

We were always trying to find an unused port, and then we try to bind
that port. This is not a good way to do it as there is
no guarantee that the port will still be free when we actually try to
bind the port, especially if there are a lot of concurrent tests
running.

Now we do it the opposite way: First we bind a random os-provided
free port and only then do we find out which port it actually is.
That should make sure that no two unit tests should ever try to bind
the same port.

There may still be conflicts between unittest ports and
system test ports, but that can be fixed in a different way (e.g. just
do not run that at the same time).
mod - core/src/tests/bareos_test_sockets.cc Diff File
mod - core/src/tests/bareos_test_sockets.h Diff File
mod - core/src/tests/test_bsock.cc Diff File